Hashar has uploaded a new change for review. https://gerrit.wikimedia.org/r/250414
Change subject: zuul: sync with upstream @1cc37f7 ...................................................................... zuul: sync with upstream @1cc37f7 Includes a lot of changes Timo upstreamed. Most notably related to live/non live changes in the new version of Zuul. Change-Id: I7e8815af9e253e6df6d6e872b3f804cee64146b2 --- M zuul-status/.gitignore M zuul-status/fetch-dependencies.sh M zuul-status/public_html/index.html M zuul-status/public_html/jquery.zuul.js M zuul-status/public_html/styles/zuul.css M zuul-status/public_html/zuul.app.js 6 files changed, 51 insertions(+), 34 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/integration/docroot refs/changes/14/250414/1 diff --git a/zuul-status/.gitignore b/zuul-status/.gitignore index 39e5d74..218f297 100644 --- a/zuul-status/.gitignore +++ b/zuul-status/.gitignore @@ -1,3 +1 @@ -public_html/jquery.min.js -public_html/bootstrap -public_html/jquery.graphite.js +public_html/lib diff --git a/zuul-status/fetch-dependencies.sh b/zuul-status/fetch-dependencies.sh index b31d0de..ccaf74c 100755 --- a/zuul-status/fetch-dependencies.sh +++ b/zuul-status/fetch-dependencies.sh @@ -1,21 +1,23 @@ #!/bin/bash BASE_DIR=$(cd $(dirname $0); pwd) -echo "Destination: $BASE_DIR/public_html" +DEST_DIR=$BASE_DIR/public_html/lib +mkdir -p $DEST_DIR +echo "Destination: $DEST_DIR" echo "Fetching jquery.min.js..." -curl -L --silent http://code.jquery.com/jquery.min.js > $BASE_DIR/public_html/jquery.min.js +curl -L --silent http://code.jquery.com/jquery.min.js > $DEST_DIR/jquery.min.js echo "Fetching jquery-visibility.min.js..." -curl -L --silent https://raw.githubusercontent.com/mathiasbynens/jquery-visibility/master/jquery-visibility.js > $BASE_DIR/public_html/jquery-visibility.js +curl -L --silent https://raw.githubusercontent.com/mathiasbynens/jquery-visibility/master/jquery-visibility.js > $DEST_DIR/jquery-visibility.js echo "Fetching jquery.graphite.js..." curl -L --silent https://github.com/prestontimmons/graphitejs/archive/master.zip > jquery-graphite.zip -unzip -q -o jquery-graphite.zip -d $BASE_DIR/public_html/ -mv $BASE_DIR/public_html/graphitejs-master/jquery.graphite.js $BASE_DIR/public_html/ -rm -R jquery-graphite.zip $BASE_DIR/public_html/graphitejs-master +unzip -q -o jquery-graphite.zip -d $DEST_DIR/ +mv $DEST_DIR/graphitejs-master/jquery.graphite.js $DEST_DIR/ +rm -R jquery-graphite.zip $DEST_DIR/graphitejs-master echo "Fetching bootstrap..." curl -L --silent https://github.com/twbs/bootstrap/releases/download/v3.1.1/bootstrap-3.1.1-dist.zip > bootstrap.zip -unzip -q -o bootstrap.zip -d $BASE_DIR/public_html/ -mv $BASE_DIR/public_html/bootstrap-3.1.1-dist $BASE_DIR/public_html/bootstrap +unzip -q -o bootstrap.zip -d $DEST_DIR/ +mv $DEST_DIR/bootstrap-3.1.1-dist $DEST_DIR/bootstrap rm bootstrap.zip diff --git a/zuul-status/public_html/index.html b/zuul-status/public_html/index.html index 3bd7a12..07fa7f8 100644 --- a/zuul-status/public_html/index.html +++ b/zuul-status/public_html/index.html @@ -19,16 +19,16 @@ <html dir="ltr" lang="en"> <head> <title>Zuul Status</title> - <link rel="stylesheet" href="bootstrap/css/bootstrap.min.css"> + <link rel="stylesheet" href="lib/bootstrap/css/bootstrap.min.css"> <link rel="stylesheet" href="styles/zuul.css" /> </head> <body> <div id="zuul_container"></div> - <script src="jquery.min.js"></script> - <script src="jquery-visibility.js"></script> - <script src="jquery.graphite.js"></script> + <script src="lib/jquery.min.js"></script> + <script src="lib/jquery-visibility.js"></script> + <script src="lib/jquery.graphite.js"></script> <script src="jquery.zuul.js"></script> <script src="zuul.app.js"></script> <script> diff --git a/zuul-status/public_html/jquery.zuul.js b/zuul-status/public_html/jquery.zuul.js index 2b604bc..0ca2718 100644 --- a/zuul-status/public_html/jquery.zuul.js +++ b/zuul-status/public_html/jquery.zuul.js @@ -16,9 +16,10 @@ // WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the // License for the specific language governing permissions and limitations // under the License. -'use strict'; (function ($) { + 'use strict'; + function set_cookie(name, value) { document.cookie = name + '=' + value + '; path=/'; } @@ -39,7 +40,7 @@ } $.zuul = function(options) { - var options = $.extend({ + options = $.extend({ 'enabled': true, 'graphite_url': '', 'source': 'status.json', @@ -72,7 +73,7 @@ hideGrid: true, target: [ "color(stats.gauges.zuul.pipeline." + pipeline_name - + ".current_changes, '6b8182')" + + ".current_changes, '6b8182')" ] }); } @@ -288,10 +289,10 @@ } var $change_progress_row_left = $('<div />') - .addClass('col-xs-3') + .addClass('col-xs-4') .append($change_link); var $change_progress_row_right = $('<div />') - .addClass('col-xs-9') + .addClass('col-xs-8') .append(this.change_total_progress_bar(change)); var $change_progress_row = $('<div />') @@ -316,9 +317,11 @@ var $enqueue_time = $('<small />').addClass('time') .attr('title', 'Elapsed Time').html(enqueue_time); - var $right = $('<div />') - .addClass('col-xs-4 text-right') - .append($remaining_time, $('<br />'), $enqueue_time); + var $right = $('<div />'); + if (change.live === true) { + $right.addClass('col-xs-4 text-right') + .append($remaining_time, $('<br />'), $enqueue_time); + } var $header = $('<div />') .addClass('row') @@ -369,6 +372,11 @@ icon_name = 'grey.png'; icon_title = 'Waiting until closer to head of queue to' + ' start jobs'; + } + else if (change.live !== true) { + // Grey icon + icon_name = 'grey.png'; + icon_title = 'Dependent change required for testing'; } else if (change.failing_reasons && change.failing_reasons.length > 0) { @@ -609,7 +617,7 @@ var app = { schedule: function (app) { - var app = app || this; + app = app || this; if (!options.enabled) { setTimeout(function() {app.schedule(app);}, 5000); return; @@ -635,7 +643,7 @@ this.emit('update-start'); var app = this; - var $msg = $(options.msg_id) + var $msg = $(options.msg_id); xhr = $.getJSON(options.source) .done(function (data) { if ('message' in data) { @@ -675,11 +683,11 @@ data.result_event_queue.length : '0' ); }) - .fail(function (jqXHR) { - if (jqXHR.statusText === 'abort') { + .fail(function (jqXHR, statusText, errMsg) { + if (statusText === 'abort') { return; } - $msg.text(options.source + ': ' + jqXHR.statusText) + $msg.text(options.source + ': ' + errMsg) .addClass('alert-danger') .removeClass('zuul-msg-wrap-off') .show(); @@ -697,7 +705,7 @@ var newimg = new Image(); var parts = url.split('#'); newimg.src = parts[0] + '#' + new Date().getTime(); - $(newimg).load(function (x) { + $(newimg).load(function () { zuul_sparkline_urls[name] = newimg.src; }); }); @@ -838,7 +846,9 @@ }); $.each(change_queue.heads, function(head_i, head) { $.each(head, function(change_i, change) { - count += 1; + if (change.live === true) { + count += 1; + } var idx = tree.indexOf(change.id); if (idx > -1) { change._tree_index = idx; @@ -891,5 +901,5 @@ app: app, jq: $jq }; - } + }; }(jQuery)); diff --git a/zuul-status/public_html/styles/zuul.css b/zuul-status/public_html/styles/zuul.css index e833f4b..44fd737 100644 --- a/zuul-status/public_html/styles/zuul.css +++ b/zuul-status/public_html/styles/zuul.css @@ -16,7 +16,9 @@ .zuul-change-total-result { height: 10px; width: 100px; - margin: 5px 0 0 0; + margin: 0; + display: inline-block; + vertical-align: middle; } .zuul-spinner, diff --git a/zuul-status/public_html/zuul.app.js b/zuul-status/public_html/zuul.app.js index eee5749..6321af8 100644 --- a/zuul-status/public_html/zuul.app.js +++ b/zuul-status/public_html/zuul.app.js @@ -17,9 +17,11 @@ // License for the specific language governing permissions and limitations // under the License. +/*exported zuul_build_dom, zuul_start */ + function zuul_build_dom($, container) { // Build a default-looking DOM - default_layout = '<div class="container">' + var default_layout = '<div class="container">' + '<h1>Zuul Status</h1>' + '<p>Real-time status monitor of Zuul, the pipeline manager between Gerrit and Workers.</p>' + '<div class="zuul-container" id="zuul-container">' @@ -34,11 +36,14 @@ $(function ($) { // DOM ready - $container = $(container); + var $container = $(container); $container.html(default_layout); }); } +/** + * @return The $.zuul instance + */ function zuul_start($) { // Start the zuul app (expects default dom) -- To view, visit https://gerrit.wikimedia.org/r/250414 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I7e8815af9e253e6df6d6e872b3f804cee64146b2 Gerrit-PatchSet: 1 Gerrit-Project: integration/docroot Gerrit-Branch: master Gerrit-Owner: Hashar <has...@free.fr> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits