diff --git a/playbooks/roles/gerrit/files/etc/GerritSite.css b/playbooks/roles/gerrit/files/etc/GerritSite.css deleted file mode 100644 index c1c9d47575..0000000000 --- a/playbooks/roles/gerrit/files/etc/GerritSite.css +++ /dev/null @@ -1,179 +0,0 @@ -body {color: #000 !important;} -a,a:visited {color: #264D69 !important; text-decoration: none;} -a:hover {color: #000 !important; text-decoration: underline} - -a.gwt-InlineHyperlink {background: none !important} - -#openstack-logo img { height: 40px; } -#openstack-logo h1 { margin: 20px; } -#gerrit_header #openstack-logo h1 { margin: 20px 0 0 0; } - -#gerrit_header {display: block !important; position: relative; top: -60px; margin-bottom: -60px; width: 200px; padding-left: 17px} -#gerrit_header h1 {font-family: 'PT Sans', sans-serif; font-weight: normal; letter-spacing: -1px} - -#gerrit_topmenu {background: none; position:relative; top: 0px; left: 220px; margin-right: 220px} - -#gerrit_topmenu tbody tr td table {border: 0} - -#gerrit_topmenu tbody tr td table.gwt-TabBar {color: #353535; border-bottom: 1px solid #C5E2EA;} -#gerrit_topmenu .gwt-Button {padding: 3px 6px} -.gwt-TabBarItem-selected {color: #CF2F19 !important; border-bottom: 3px solid #CF2F19;} -.gwt-TabBarItem {color: #353535; border-right: 0 !important} -.gwt-TabBar .gwt-TabBarItem, .gwt-TabBar .gwt-TabBarRest, .gwt-TabPanelBottom {background: 0 !important;} - -#gerrit_topmenu .searchTextBox {width: 250px} - -#change_infoTable { - border-collapse: collapse; -} - -#change_infoTable th { - padding: 2px 4px 2px 6px; - background-color: #eef3f5; - font-style: italic; - text-align: left; -} - -#change_infoTable td { - padding: 2px 4px 2px 6px; - border-bottom: 1px solid #eef3f5; - border-right: 1px solid #eef3f5; -} - -#change_infoTable tr:last-child td { - border: none; -} - -.com-google-gerrit-client-change-ChangeScreen_BinderImpl_GenCss_style-cs2 { - padding-left: 10px; - padding-right: 10px; -} - -/* Section headers */ -.com-google-gerrit-client-change-ChangeScreen_BinderImpl_GenCss_style-cs2 - .com-google-gerrit-client-change-ChangeScreen_BinderImpl_GenCss_style-headerLine, -.com-google-gerrit-client-change-ChangeScreen_BinderImpl_GenCss_style-cs2 - .com-google-gerrit-client-change-ChangeScreen_BinderImpl_GenCss_style-sectionHeader { - margin-top: 10px !important; - margin-bottom: 10px !important; -} - -/* Commit message */ -.com-google-gerrit-client-change-ChangeScreen_BinderImpl_GenCss_style-cs2 - .com-google-gerrit-client-change-CommitBox_BinderImpl_GenCss_style-text::first-line { - font-weight: bold !important; -} - -/* Commit metadata */ -.com-google-gerrit-client-change-ChangeScreen_BinderImpl_GenCss_style-cs2 - .com-google-gerrit-client-change-ChangeScreen_BinderImpl_GenCss_style-commitColumn - .com-google-gerrit-client-change-CommitBox_BinderImpl_GenCss_style-header th { - padding: 2px 4px 2px 6px; - background-color: #eef3f5; - font-style: italic; - text-align: left; -} - -.com-google-gerrit-client-change-ChangeScreen_BinderImpl_GenCss_style-cs2 - .com-google-gerrit-client-change-ChangeScreen_BinderImpl_GenCss_style-commitColumn - .com-google-gerrit-client-change-CommitBox_BinderImpl_GenCss_style-header td { - border-bottom: 1px solid #eef3f5; - padding: 2px 4px 2px 6px; -} - -.com-google-gerrit-client-change-ChangeScreen_BinderImpl_GenCss_style-cs2 - .com-google-gerrit-client-change-ChangeScreen_BinderImpl_GenCss_style-commitColumn - .com-google-gerrit-client-change-CommitBox_BinderImpl_GenCss_style-header td:last-child { - border-right: 1px solid #eef3f5; -} - -/* increase the middle info column to fill empty space (for wide -monitors), but ensure there is a sufficient lower bound to kick in -horiz scroll bar. This will relieve the preasure on the hideci test -results. */ -.com-google-gerrit-client-change-ChangeScreen_BinderImpl_GenCss_style-infoColumn { - width: 100% !important; - min-width: 400px; -} - -/* Review history */ -.com-google-gerrit-client-change-ChangeScreen_BinderImpl_GenCss_style-cs2 - .com-google-gerrit-client-change-Message_BinderImpl_GenCss_style-name { - font-weight: bold !important; -} -.com-google-gerrit-client-change-ChangeScreen_BinderImpl_GenCss_style-cs2 - .com-google-gerrit-client-change-Message_BinderImpl_GenCss_style-messageBox { - width: inherit; - max-width: 1168px; -} - -.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, .result_POST_FAILURE, .result_TIMED_OUT, .result_RETRY_LIMIT, .result_DISK_FULL { - color: #cf2f19; -} -.result_UNSTABLE, .result_WARNING { - color: #e39f00; -} -.result_LOST { - color: #e39f00; -} -li.comment_test {list-style-type: none; } - -/* this is for support of 'Display Person Name In Review Category' */ -.cAPPROVAL { - max-width: 100px; - overflow: hidden; -} -/* fixes to make this like old gerrit */ -.changeTable td.dataCell { - height: 1em; -} - -/* don't make the non voting stand out more than the voting */ -table.infoTable td.notVotable, -.changeTable td.dataCell.labelNotApplicable { - background: inherit; -} - -.test_result_table { - border-collapse: collapse; -} - -.test_result_table tr { - border-left: 1px solid #eef3f5; - border-right: 1px solid #eef3f5; -} - -.test_result_table td.header { - background-color: #eef3f5; -} - -.test_result_table td { - padding: 2px 4px 2px 6px; - border: 1px solid #eef3f5; -} - -.addMemberTextBox { - width: 20em; -} - -/* css attribute selector to make -1s show up red in new screen */ -[title="Doesn't seem to work"], -[title="This patch needs further work before it can be merged"] { - color: red; -} diff --git a/playbooks/roles/gerrit/files/etc/GerritSiteHeader.html b/playbooks/roles/gerrit/files/etc/GerritSiteHeader.html deleted file mode 100644 index 0e2f060fa8..0000000000 --- a/playbooks/roles/gerrit/files/etc/GerritSiteHeader.html +++ /dev/null @@ -1,6 +0,0 @@ -
diff --git a/playbooks/roles/gerrit/files/static/hideci.js b/playbooks/roles/gerrit/files/static/hideci.js deleted file mode 100644 index 012b2c9512..0000000000 --- a/playbooks/roles/gerrit/files/static/hideci.js +++ /dev/null @@ -1,575 +0,0 @@ -// Copyright (c) 2014 VMware, Inc. -// Copyright (c) 2014 Hewlett-Packard Development Company, L.P. -// -// Licensed under the Apache License, Version 2.0 (the "License"); you may -// not use this file except in compliance with the License. You may obtain -// a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -// License for the specific language governing permissions and limitations -// under the License. - -// this regex matches the hash part of review pages -var hashRegex = /^\#\/c\/([\d]+)((\/\d+)([.][.](\d+))?)?\/?$/; -// this regex matches CI comments -var ciRegex = /^(.* CI|Jenkins|Zuul)$/; -// this regex matches "Patch set #" -var psRegex = /^(Uploaded patch set|Patch Set) (\d+)(:|\.)/; -// this regex matches merge failure messages -var mergeFailedRegex = /Merge Failed\./; -// this regex matches the name of CI systems we trust to report merge failures -var trustedCIRegex = /^(OpenStack CI|Jenkins|Zuul)$/; -// this regex matches the name+pipeline that we want at the top of the CI list -var firstPartyCI = /^(Jenkins|Zuul)/; -// this regex matches the pipeline markup -var pipelineNameRegex = /Build \w+ \(([-\w]+) pipeline\)/; -// The url to full status information on running jobs -var zuulStatusURL = 'https://zuul.openstack.org'; -// The json URL to check for running jobs -var zuulStatusJSON = 'https://zuul.openstack.org/status/change/'; - -// This is a variable to determine if we're in debugging mode, which -// lets you globally set it to see what's going on in the flow. -var hideci_debug = false; -// This is a variable to enable zuul integration, we default it off so -// that it creates no additional load, and that it's easy to turn off -// the feature. -var zuul_inline = false; - -/** - dbg(...) - prints a list of items out to the javascript - console.log. This allows us to leave tracing in this file which is a - no-op by default, but can be triggered if you enter a javascript - console and set hideci_debug = true. -*/ -function dbg () { - if (hideci_debug == true) { - for (var i = 0; i < arguments.length; i++) { - console.log(arguments[i]); - } - } -} - - -function format_time(ms, words) { - if (ms == null) { - return "unknown"; - } - var seconds = (+ms)/1000; - var minutes = Math.floor(seconds/60); - var hours = Math.floor(minutes/60); - seconds = Math.floor(seconds % 60); - minutes = Math.floor(minutes % 60); - r = ''; - if (words) { - if (hours) { - r += hours; - r += ' hr '; - } - r += minutes + ' min'; - } else { - if (hours < 10) r += '0'; - r += hours + ':'; - if (minutes < 10) r += '0'; - r += minutes + ':'; - if (seconds < 10) r += '0'; - r += seconds; - } - return r; -} - -var ci_parse_psnum = function($panel) { - var match = psRegex.exec($panel.html()); - if (match !== null) { - return parseInt(match[2]); - } - return 0; -}; - -var ci_parse_is_merge_conflict = function($panel) { - return (mergeFailedRegex.exec($panel.html()) !== null); -}; - -var ci_find_pipeline = function($panel) { - var match = pipelineNameRegex.exec($panel.html()); - if (match !== null) { - return match[1]; - } else { - return null; - } -}; - -var ci_parse_results = function($panel) { - var result_list = []; - var test_results = $panel.find("li.comment_test"); - var pipeline = null; - if (test_results !== null) { - test_results.each(function(i, li) { - var result = {}; - if ($(li).find("a").length > 0) { - result["name"] = $(li).find("span.comment_test_name").find("a")[0].innerHTML; - result["link"] = $(li).find("span.comment_test_name").find("a")[0]; - } - else { - result["name"] = $(li).find("span.comment_test_name")[0].innerHTML; - } - result["result"] = $(li).find("span.comment_test_result")[0]; - result_list.push(result); - }); - } - return result_list; -}; - -/*** - * function ci_group_by_ci_pipeline - create a group by structure for - * iterating on CI's pipelines - * - * This function takes the full list of comments, the current patch - * number, and builds an array of (ci_name_pipelinename, comments array) - * tuples. That makes it very easy to process during the display - * phase to ensure we only display the latest result for every CI - * pipeline. - * - * Comments that do not have a parsable pipeline (3rd party ci - * systems) get collapsed by name, and we specify 'check' for their - * pipeline. - * - **/ - -var ci_group_by_ci_pipeline = function(current, comments) { - var ci_pipelines = []; - var ci_pipeline_comments = []; - for (var i = 0; i < comments.length; i++) { - var comment = comments[i]; - if ((comment.psnum != current) || !comment.is_ci || (comment.results.length == 0)) { - continue; - } - var name_pipeline = comment.name; - if (comment.pipeline !== null) { - name_pipeline += ' ' + comment.pipeline; - } - - var index = ci_pipelines.indexOf(name_pipeline); - if (index == -1) { - // not found, so create new entries - ci_pipelines.push(name_pipeline); - ci_pipeline_comments.push([comment]); - } else { - ci_pipeline_comments[index].push(comment); - } - } - - function sort_by_name(a,b) { - if (a[0] < b[0]) - return -1; - else if (a[0] > b[0]) - return 1; - else - return 0; - } - - var results = []; - var notfirstparty = []; - // we want to separate out first party CI results to always be the - // top of the list, and third party CI to come after, so that - // hunting for first party CI isn't tough. - for (i = 0; i < ci_pipelines.length; i++) { - if (firstPartyCI.test(ci_pipelines[i])) { - results.push([ci_pipelines[i], ci_pipeline_comments[i]]); - } else { - notfirstparty.push([ci_pipelines[i], ci_pipeline_comments[i]]); - } - } - - notfirstparty.sort(sort_by_name); - - for (i = 0; i < notfirstparty.length; i++) { - results.push(notfirstparty[i]); - } - return results; -}; - -var ci_parse_comments = function() { - var comments = []; - $("p").each(function() { - var match = psRegex.exec($(this).html()); - if (match !== null) { - var psnum = parseInt(match[2]); - var top = $(this).parent().parent().parent(); - // old change screen - var name = top.attr("name"); - if (!name) { - // new change screen - name = $(this).parent().parent().parent().children().children()[0].innerHTML; - top = $(this).parent().parent().parent().parent(); - } - var comment = {}; - comment.name = name; - - var date_cell = top.find(".commentPanelDateCell"); - if (date_cell.attr("title")) { - // old change screen - comment.date = date_cell.attr("title"); - } else { - // new change screen - comment.date = $(this).parent().parent().parent().children().children()[2].innerHTML - } - var comment_panel = $(this).parent(); - comment.psnum = psnum; - comment.merge_conflict = ci_parse_is_merge_conflict(comment_panel); - comment.pipeline = ci_find_pipeline(comment_panel); - comment.results = ci_parse_results(comment_panel); - comment.is_ci = (ciRegex.exec(comment.name) !== null); - comment.is_trusted_ci = (trustedCIRegex.exec(comment.name) !== null); - comment.ref = top; - dbg("Found comment", comment); - comments.push(comment); - } - }); - return comments; -}; - -var ci_latest_patchset = function(comments) { - var psnum = 0; - for (var i = 0; i < comments.length; i++) { - psnum = Math.max(psnum, comments[i].psnum); - } - return psnum; -}; - -var ci_is_merge_conflict = function(comments) { - var latest = ci_latest_patchset(comments); - var conflict = false; - for (var i = 0; i < comments.length; i++) { - var comment = comments[i]; - // only if we are actually talking about the latest patch set - if (comment.psnum == latest) { - if (comment.is_trusted_ci) { - conflict = comment.merge_conflict; - } - } - } - return conflict; -}; - -var ci_prepare_results_table = function() { - // Create a table and insert it after the approval table - var table = $("table.test_result_table")[0]; - if (!table) { - table = document.createElement("table"); - $(table).addClass("test_result_table"); - $(table).addClass("infoTable").css({"margin-top":"1em", "margin-bottom":"1em"}); - - var approval_table = $("div.approvalTable"); - if (approval_table.length) { - var outer_table = document.createElement("table"); - $(outer_table).insertBefore(approval_table); - var outer_table_row = document.createElement("tr"); - $(outer_table).append(outer_table_row); - var td = document.createElement("td"); - $(outer_table_row).append(td); - $(td).css({"vertical-align":"top"}); - $(td).append(approval_table); - td = document.createElement("td"); - $(outer_table_row).append(td); - $(td).css({"vertical-align":"top"}); - $(td).append(table); - } else { - var big_table_row = $("div.screen>div>div>table>tbody>tr"); - var td = $(big_table_row).children()[1]; - $(td).append(table); - } - } else { - $(table).empty(); - } - return table; -}; - -var ci_display_results = function(comments) { - var table = ci_prepare_results_table(); - if (ci_is_merge_conflict(comments)) { - var mc_header = $("