From b93eb82cad06b1510f355186a643264cf86ea64e Mon Sep 17 00:00:00 2001 From: "James E. Blair" Date: Sat, 17 Aug 2013 17:40:48 -0700 Subject: [PATCH] Add testresult commentlink Will take effect when Zuul is running this change: I74702fd7d37358e6f4caa7e7ac0a3ede73184077 This change also adds that feature to the Zuul config and enables it for OpenStack. It also adds the ability to specify HTML in a commentlink (and uses it). Change-Id: Idb4ad8e6079165d681271987a92cab5d8b7c81be --- modules/gerrit/templates/gerrit.config.erb | 5 ++++ .../files/gerrit/GerritSite.css | 27 +++++++++++++++++++ modules/openstack_project/manifests/gerrit.pp | 5 ++++ .../openstack_project/manifests/zuul_dev.pp | 1 + .../openstack_project/manifests/zuul_prod.pp | 1 + modules/zuul/manifests/init.pp | 1 + modules/zuul/templates/zuul.conf.erb | 1 + 7 files changed, 41 insertions(+) diff --git a/modules/gerrit/templates/gerrit.config.erb b/modules/gerrit/templates/gerrit.config.erb index ae9c8f6420..85ff5091db 100644 --- a/modules/gerrit/templates/gerrit.config.erb +++ b/modules/gerrit/templates/gerrit.config.erb @@ -64,8 +64,13 @@ <% commentlinks.each do |commentlink| -%> [commentlink "<%= commentlink['name'] %>"] match = "<%= commentlink['match'] %>" +<% if commentlink['link'] != "" -%> link = "<%= commentlink['link'] %>" <% end -%> +<% if commentlink['html'] != "" -%> + html = "<%= commentlink['html'] %>" +<% end -%> +<% end -%> [theme] backgroundColor = ffffff topMenuColor = ffffff diff --git a/modules/openstack_project/files/gerrit/GerritSite.css b/modules/openstack_project/files/gerrit/GerritSite.css index c808632b59..7b289d27d7 100644 --- a/modules/openstack_project/files/gerrit/GerritSite.css +++ b/modules/openstack_project/files/gerrit/GerritSite.css @@ -18,3 +18,30 @@ a.gwt-InlineHyperlink {background: none !important} .gwt-TabBar .gwt-TabBarItem, .gwt-TabBar .gwt-TabBarRest, .gwt-TabPanelBottom {background: 0 !important;} #gerrit_topmenu .gwt-TextBox {width: 250px} + +.comment_test_name { + display: inline-block; + *display: inline; + *zoom: 1; + width: auto !important; + width: 25em; + min-width: 20em; + padding-bottom: 2pt; +} + +.comment_test_result { +} + +.result_SUCCESS { + color: #007f00; +} +.result_FAILURE { + color: #cf2f19; +} +.result_UNSTABLE { + color: #e39f00; +} +.result_LOST { + color: #e39f00; +} +ul {list-style-type: none; } diff --git a/modules/openstack_project/manifests/gerrit.pp b/modules/openstack_project/manifests/gerrit.pp index 7e878462bd..3ffe12a2b2 100644 --- a/modules/openstack_project/manifests/gerrit.pp +++ b/modules/openstack_project/manifests/gerrit.pp @@ -139,6 +139,11 @@ class openstack_project::gerrit ( match => '(\\b[Bb]lue[Pp]rint\\b|\\b[Bb][Pp]\\b)[ \\t#:]*([A-Za-z0-9\\-]+)', link => 'https://blueprints.launchpad.net/openstack/?searchtext=$2', }, + { + name => 'testresult', + match => '
  • ([^ ]+) ([^<]+) : ([^ ]+)([^<]*)
  • ', + html => '
  • $1 $3$4
  • ', + }, ], war => $war, contactstore => $contactstore, diff --git a/modules/openstack_project/manifests/zuul_dev.pp b/modules/openstack_project/manifests/zuul_dev.pp index 8e62c251c3..7ffab57a00 100644 --- a/modules/openstack_project/manifests/zuul_dev.pp +++ b/modules/openstack_project/manifests/zuul_dev.pp @@ -27,6 +27,7 @@ class openstack_project::zuul_dev( zuul_ssh_private_key => $zuul_ssh_private_key, url_pattern => $url_pattern, push_change_refs => false, + job_name_in_report => true, status_url => 'http://zuul-dev.openstack.org/', statsd_host => $statsd_host, } diff --git a/modules/openstack_project/manifests/zuul_prod.pp b/modules/openstack_project/manifests/zuul_prod.pp index ab9a30055b..67818fc78d 100644 --- a/modules/openstack_project/manifests/zuul_prod.pp +++ b/modules/openstack_project/manifests/zuul_prod.pp @@ -27,6 +27,7 @@ class openstack_project::zuul_prod( zuul_ssh_private_key => $zuul_ssh_private_key, url_pattern => $url_pattern, push_change_refs => false, + job_name_in_report => true, status_url => 'http://status.openstack.org/zuul/', statsd_host => $statsd_host, } diff --git a/modules/zuul/manifests/init.pp b/modules/zuul/manifests/init.pp index 04ca40c78a..855acfd056 100644 --- a/modules/zuul/manifests/init.pp +++ b/modules/zuul/manifests/init.pp @@ -29,6 +29,7 @@ class zuul ( $status_url = "https://${::fqdn}/", $git_source_repo = 'https://github.com/openstack-infra/zuul.git', $push_change_refs = false, + $job_name_in_report = false, $revision = 'master', $statsd_host = '' ) { diff --git a/modules/zuul/templates/zuul.conf.erb b/modules/zuul/templates/zuul.conf.erb index 4cbd57e7c6..0ccc302cf4 100644 --- a/modules/zuul/templates/zuul.conf.erb +++ b/modules/zuul/templates/zuul.conf.erb @@ -18,3 +18,4 @@ git_dir=/var/lib/zuul/git push_change_refs=<%= push_change_refs %> url_pattern=<%= url_pattern %> status_url=<%= status_url %> +job_name_in_report=<%= job_name_in_report %>