Merge lp:~robru/bileto/dashboard-colors into lp:bileto

Proposed by Robert Bruce Park
Status: Merged
Approved by: Robert Bruce Park
Approved revision: 217
Merged at revision: 206
Proposed branch: lp:~robru/bileto/dashboard-colors
Merge into: lp:bileto
Diff against target: 120 lines (+38/-15)
3 files modified
tickets/static/app.js (+4/-0)
tickets/static/dashboard.js (+20/-6)
tickets/static/test/test.js (+14/-9)
To merge this branch: bzr merge lp:~robru/bileto/dashboard-colors
Reviewer Review Type Date Requested Status
Robert Bruce Park (community) Approve
PS Jenkins bot continuous-integration Approve
Review via email: mp+266785@code.launchpad.net

Commit message

Make QA states highlighted in dashboard.

To post a comment you must log in.
lp:~robru/bileto/dashboard-colors updated
214. By Robert Bruce Park

More test fixes.

215. By Robert Bruce Park

MOAR.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

PASSED: Continuous integration, rev:215
http://jenkins.qa.ubuntu.com/job/bileto-ci/19/
Executed test runs:

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/bileto-ci/19/rebuild

review: Approve (continuous-integration)
lp:~robru/bileto/dashboard-colors updated
216. By Robert Bruce Park

Linkify destination PPA.

217. By Robert Bruce Park

Missing semicolon.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

PASSED: Continuous integration, rev:217
http://jenkins.qa.ubuntu.com/job/bileto-ci/20/
Executed test runs:

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/bileto-ci/20/rebuild

review: Approve (continuous-integration)
Revision history for this message
Robert Bruce Park (robru) wrote :

Looks great in staging.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'tickets/static/app.js'
--- tickets/static/app.js 2015-07-31 20:21:45 +0000
+++ tickets/static/app.js 2015-08-03 19:46:18 +0000
@@ -34,6 +34,10 @@
34 text += '<a target="_blank" href="/static/dashboard.html#?q=' + names[i] + '">' + names[i] + '</a> ';34 text += '<a target="_blank" href="/static/dashboard.html#?q=' + names[i] + '">' + names[i] + '</a> ';
35 }35 }
36 }36 }
37 if (text && field == 'dest') {
38 var parts = text.split(/\//);
39 text = '<a target="_blank" href="https://launchpad.net/~' + parts[0] + '/+archive/' + parts[1] + '/' + parts[2] + '">' + parts[2] + '</a>';
40 }
37 return text;41 return text;
38}42}
3943
4044
=== modified file 'tickets/static/dashboard.js'
--- tickets/static/dashboard.js 2015-08-03 16:31:40 +0000
+++ tickets/static/dashboard.js 2015-08-03 19:46:18 +0000
@@ -20,9 +20,6 @@
2020
21var KNOWN_DISTROS = [ 'ubuntu' ];21var KNOWN_DISTROS = [ 'ubuntu' ];
2222
23// red statuses are error conditions that need to be resolved.
24// blue statuses are non-error conditions that require action.
25// green are good things that don't require action.
26STATUS_COLORS = {23STATUS_COLORS = {
27 'caught signal': 'red',24 'caught signal': 'red',
28 'uncaught exception': 'red',25 'uncaught exception': 'red',
@@ -40,10 +37,16 @@
40 'publication failed': 'red',37 'publication failed': 'red',
41 'publication needs': 'blue',38 'publication needs': 'blue',
42 'reconfigure failed': 'red',39 'reconfigure failed': 'red',
43 'silo ready': 'blue',40 'silo ready': 'purple',
44 'silo dirty': 'olive',41 'silo dirty': 'olive',
45};42};
4643
44BILETO_COLORS = {
45 'qa granted': 'blue',
46 'publish without qa': 'blue',
47 'qa failed': 'red',
48};
49
4750
48function getStatusColor(status) {51function getStatusColor(status) {
49 return STATUS_COLORS[nWords(status, 2).toLowerCase()] || 'black';52 return STATUS_COLORS[nWords(status, 2).toLowerCase()] || 'black';
@@ -207,6 +210,7 @@
207 return function(data) {210 return function(data) {
208 bileto.reqs = {};211 bileto.reqs = {};
209 data.requests.forEach(function(req) {212 data.requests.forEach(function(req) {
213 req.color = BILETO_COLORS[(req.qa_signoff || '').toLowerCase()] || '';
210 bileto.reqs[req.request_id] = req;214 bileto.reqs[req.request_id] = req;
211 });215 });
212 }216 }
@@ -260,8 +264,18 @@
260 })264 })
261265
262 $scope.getSiloColor = function(siloname) {266 $scope.getSiloColor = function(siloname) {
263 var siloColor = ($scope.silos[siloname] || {}).statusColor || '';267 var req = $scope.silos[siloname] || {};
264 return siloColor || 'black';268 if (!req.requestid || !req.shortStatus) {
269 return 'black';
270 }
271 var siloColor = req.statusColor || 'black';
272 var bileto = $scope.bileto.reqs || {};
273 var qaColor = (bileto[req.requestid] || {}).color || 'black';
274 if (req.shortStatus.match(/packages built/i)) {
275 return qaColor;
276 } else {
277 return siloColor;
278 }
265 };279 };
266280
267 function getQuery() {281 function getQuery() {
268282
=== modified file 'tickets/static/test/test.js'
--- tickets/static/test/test.js 2015-06-24 23:43:17 +0000
+++ tickets/static/test/test.js 2015-08-03 19:46:18 +0000
@@ -22,10 +22,12 @@
22 it('should know what statuses are blue.', function() {22 it('should know what statuses are blue.', function() {
23 expect(getStatusColor('Migration: All birds have flown home.'))23 expect(getStatusColor('Migration: All birds have flown home.'))
24 .toBe('blue');24 .toBe('blue');
25 expect(getStatusColor('Publication needs: a swift kick in the pants.'))
26 .toBe('blue');
27 });
28 it('should know what statuses are purple.', function() {
25 expect(getStatusColor('Silo ready to be filled with grain.'))29 expect(getStatusColor('Silo ready to be filled with grain.'))
26 .toBe('blue');30 .toBe('purple');
27 });
28 it('should know what statuses are purple.', function() {
29 expect(getStatusColor('Free'))31 expect(getStatusColor('Free'))
30 .toBe('purple');32 .toBe('purple');
31 });33 });
@@ -468,15 +470,18 @@
468 appController(scopeMock, locationMock, httpMock);470 appController(scopeMock, locationMock, httpMock);
469 expect(httpMock.get).toHaveBeenCalled();471 expect(httpMock.get).toHaveBeenCalled();
470 var getCalls = httpMock.get.calls.all();472 var getCalls = httpMock.get.calls.all();
471 expect(getCalls.length).toBe(61);473 expect(getCalls.length).toBe(62);
472 getCalls.forEach(function(call, index) {474 getCalls.forEach(function(call, index) {
473 index = index % 61;475 index = index % 62;
474 index = ('000' + index).slice(-3);476 index = ('000' + index).slice(-3);
475 expect(call.args.length).toBe(1);477 expect(call.args.length).toBe(1);
476 expect(call.args[0]).toMatch(478 if (call.args[0] != '/v1/tickets') {
477 '^(http://people.canonical.com)?/static/json/ubuntu(-rtm)?/landing-'479 expect(call.args[0]).toMatch(
478 + index480 '^/static/json/ubuntu(-rtm)?/landing-'
479 + '\\?nocache=\\d+$');481 + index + '\\?nocache=\\d+$');
482 } else {
483 expect(call.args[0]).toBe('/v1/tickets');
484 }
480 });485 });
481 });486 });
482});487});

Subscribers

People subscribed via source and target branches