Rename to zuul-results-summary, futher cleanups
diff --git a/BUILD b/BUILD
index 23f7b9e..80fb03d 100644
--- a/BUILD
+++ b/BUILD
@@ -2,16 +2,16 @@
load("//tools/bzl:js.bzl", "bundle_assets", "polygerrit_plugin")
polygerrit_plugin(
- name = "zuul_summary_status",
- app = "zuul-summary-status-bundle.js",
- plugin_name = "zuul-summary-status",
+ name = "zuul_results_summary",
+ app = "zuul-results-summary-bundle.js",
+ plugin_name = "zuul-results-summary",
)
rollup_bundle(
- name = "zuul-summary-status-bundle",
- srcs = glob(["gr-zuul-summary-status/*.js"]),
- entry_point = "gr-zuul-summary-status/gr-zuul-summary-status.js",
+ name = "zuul-results-summary-bundle",
+ srcs = glob(["zuul-results-summary/*.js"]),
+ entry_point = "zuul-results-summary/zuul-results-summary.js",
format = "iife",
rollup_bin = "//tools/node_tools:rollup-bin",
sourcemap = "hidden",
diff --git a/README.md b/README.md
index 5719a25..71074eb 100644
--- a/README.md
+++ b/README.md
@@ -1,6 +1,6 @@
-# Zuul Summary Status
+# Zuul Results Summary
-Show a summary of Zuul results in Polygerrit
+Polygerrit plugin to show a summary of Zuul results in a change tab
## UI tests
@@ -14,4 +14,4 @@
1. Clone plugin to `plugins/zuul-summary-status` `cd plugins; git clone https://github.com/ianw/gerrit-zuul-summary-status zuul-summary-status`
1. Run build `cd ..; bazel build plugins/zuul-summary-status:zuul_summary_status`
1. Copy resulting plugin `bazel-bin/plugins/zuul-summary-status/zuul-summary-status-bundle.js` to Gerrit plugins directory
-
+
diff --git a/bower.json b/bower.json
index 4bada9a..230ba96 100644
--- a/bower.json
+++ b/bower.json
@@ -1,5 +1,5 @@
{
- "name": "zuul-summary-status",
+ "name": "zuul-results-summary",
"authors": [
"iwienand@redhat.com"
],
diff --git a/gr-zuul-summary-status/gr-zuul-summary-status_test.html b/gr-zuul-summary-status/gr-zuul-summary-status_test.html
deleted file mode 100644
index 586d703..0000000
--- a/gr-zuul-summary-status/gr-zuul-summary-status_test.html
+++ /dev/null
@@ -1,68 +0,0 @@
-<!DOCTYPE html>
-<!--
-@license
-Copyright (C) 2018 The Android Open Source Project
-
-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.
--->
-
-<meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1.0, user-scalable=yes">
-<title>gr-editor</title>
-<script src="/node_modules/@webcomponents/webcomponentsjs/custom-elements-es5-adapter.js"></script>
-<script src="../node_modules/@webcomponents/webcomponentsjs/webcomponents-loader.js"></script>
-<script src="../bower_components/web-component-tester/browser.js"></script>
-
-<test-fixture id="basic">
- <template>
- <gr-editor></gr-editor>
- </template>
-</test-fixture>
-
-<script type="module">
-import '../test/common-test-setup.js';
-import './gr-editor.js';
-suite('gr-editor tests', () => {
- let element;
- let sandbox;
-
- setup(() => {
- sandbox = sinon.sandbox.create();
-
- stub('gr-editor', {
- _importCodeMirror() {
- return new Promise((resolve, reject) => {
- Polymer.importHref('./codemirror-element.html', resolve, reject);
- });
- },
- });
- element = fixture('basic');
- });
-
- teardown(() => { sandbox.restore(); });
-
- test('renders', done => {
- element.fileType = 'text/x-php';
- element.fileContent = '<?php echo test; ?>';
- element.prefs = {};
-
- element._initializeMirror().then(() => {
- assert.ok(element.mirror);
- assert.equal(
- element.mirror._nativeMirror.getValue(),
- element.fileContent
- );
- done();
- });
- });
-});
-</script>
diff --git a/package.json b/package.json
index 4d8ff8f..2ab5d98 100644
--- a/package.json
+++ b/package.json
@@ -1,5 +1,5 @@
{
- "name": "zuul-summary-status",
+ "name": "zuul-results-summary",
"browser": true,
"scripts": {
"test": "polymer serve",
diff --git a/gr-zuul-summary-status/gr-zuul-summary-status.js b/zuul-results-summary/zuul-results-summary.js
similarity index 91%
rename from gr-zuul-summary-status/gr-zuul-summary-status.js
rename to zuul-results-summary/zuul-results-summary.js
index 7757d20..1bf9de4 100644
--- a/gr-zuul-summary-status/gr-zuul-summary-status.js
+++ b/zuul-results-summary/zuul-results-summary.js
@@ -65,6 +65,10 @@
.status-FAILURE {
color: red;
}
+
+ .status-NODE_FAILURE {
+ color: orange;
+ }
</style>
<template is="dom-repeat" items="[[__table]]">
@@ -127,6 +131,7 @@
ready() {
super.ready();
+
/*
* change-view-tab-content gets passed ChangeInfo object [1],
* registered in the property "change". We walk the list of
@@ -158,19 +163,19 @@
return;
}
- let date = new Date(message.date);
- let revision = message._revision_number;
- let sp = this._get_status_and_pipeline(message);
+ const date = new Date(message.date);
+ const revision = message._revision_number;
+ const sp = this._get_status_and_pipeline(message);
if (!sp) {
// This shouldn't happen as we've validated it is a Zuul message.
return;
}
- let status = sp[0];
- let pipeline = sp[1];
+ const status = sp[0];
+ const pipeline = sp[1];
// We only want the latest entry for each CI system in
// each pipeline
- let existing = this.__table.findIndex(entry =>
+ const existing = this.__table.findIndex(entry =>
(entry.author_id === message.author._account_id) &&
(entry.pipeline === pipeline));
@@ -188,16 +193,16 @@
* - openstack-tox-py35 http://... : SUCCESS in 2m 45
*/
let results = [];
- let lines = message.message.split("\n");
- let resultRe = /^- (?<job>[^ ]+) (?<link>[^ ]+) : (?<result>[^ ]+) in (?<time>.*)/
+ const lines = message.message.split("\n");
+ const resultRe = /^- (?<job>[^ ]+) (?<link>[^ ]+) : (?<result>[^ ]+) in (?<time>.*)/
lines.forEach((line) => {
- let result = resultRe.exec(line);
+ const result = resultRe.exec(line);
if (result) {
results.push(result.groups);
}
});
- let table = {
+ const table = {
'author_name': message.author.name,
'author_id': message.author._account_id,
'revision': revision,
@@ -251,6 +256,8 @@
*/
Gerrit.install(plugin => {
+ 'use strict';
+
plugin.registerDynamicCustomComponent(
'change-view-tab-header',
'zuul-summary-status-tab-header'