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
1=== modified file 'tickets/static/app.js'
2--- tickets/static/app.js 2015-07-31 20:21:45 +0000
3+++ tickets/static/app.js 2015-08-03 19:46:18 +0000
4@@ -34,6 +34,10 @@
5 text += '<a target="_blank" href="/static/dashboard.html#?q=' + names[i] + '">' + names[i] + '</a> ';
6 }
7 }
8+ if (text && field == 'dest') {
9+ var parts = text.split(/\//);
10+ text = '<a target="_blank" href="https://launchpad.net/~' + parts[0] + '/+archive/' + parts[1] + '/' + parts[2] + '">' + parts[2] + '</a>';
11+ }
12 return text;
13 }
14
15
16=== modified file 'tickets/static/dashboard.js'
17--- tickets/static/dashboard.js 2015-08-03 16:31:40 +0000
18+++ tickets/static/dashboard.js 2015-08-03 19:46:18 +0000
19@@ -20,9 +20,6 @@
20
21 var KNOWN_DISTROS = [ 'ubuntu' ];
22
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.
26 STATUS_COLORS = {
27 'caught signal': 'red',
28 'uncaught exception': 'red',
29@@ -40,10 +37,16 @@
30 'publication failed': 'red',
31 'publication needs': 'blue',
32 'reconfigure failed': 'red',
33- 'silo ready': 'blue',
34+ 'silo ready': 'purple',
35 'silo dirty': 'olive',
36 };
37
38+BILETO_COLORS = {
39+ 'qa granted': 'blue',
40+ 'publish without qa': 'blue',
41+ 'qa failed': 'red',
42+};
43+
44
45 function getStatusColor(status) {
46 return STATUS_COLORS[nWords(status, 2).toLowerCase()] || 'black';
47@@ -207,6 +210,7 @@
48 return function(data) {
49 bileto.reqs = {};
50 data.requests.forEach(function(req) {
51+ req.color = BILETO_COLORS[(req.qa_signoff || '').toLowerCase()] || '';
52 bileto.reqs[req.request_id] = req;
53 });
54 }
55@@ -260,8 +264,18 @@
56 })
57
58 $scope.getSiloColor = function(siloname) {
59- var siloColor = ($scope.silos[siloname] || {}).statusColor || '';
60- return siloColor || 'black';
61+ var req = $scope.silos[siloname] || {};
62+ if (!req.requestid || !req.shortStatus) {
63+ return 'black';
64+ }
65+ var siloColor = req.statusColor || 'black';
66+ var bileto = $scope.bileto.reqs || {};
67+ var qaColor = (bileto[req.requestid] || {}).color || 'black';
68+ if (req.shortStatus.match(/packages built/i)) {
69+ return qaColor;
70+ } else {
71+ return siloColor;
72+ }
73 };
74
75 function getQuery() {
76
77=== modified file 'tickets/static/test/test.js'
78--- tickets/static/test/test.js 2015-06-24 23:43:17 +0000
79+++ tickets/static/test/test.js 2015-08-03 19:46:18 +0000
80@@ -22,10 +22,12 @@
81 it('should know what statuses are blue.', function() {
82 expect(getStatusColor('Migration: All birds have flown home.'))
83 .toBe('blue');
84+ expect(getStatusColor('Publication needs: a swift kick in the pants.'))
85+ .toBe('blue');
86+ });
87+ it('should know what statuses are purple.', function() {
88 expect(getStatusColor('Silo ready to be filled with grain.'))
89- .toBe('blue');
90- });
91- it('should know what statuses are purple.', function() {
92+ .toBe('purple');
93 expect(getStatusColor('Free'))
94 .toBe('purple');
95 });
96@@ -468,15 +470,18 @@
97 appController(scopeMock, locationMock, httpMock);
98 expect(httpMock.get).toHaveBeenCalled();
99 var getCalls = httpMock.get.calls.all();
100- expect(getCalls.length).toBe(61);
101+ expect(getCalls.length).toBe(62);
102 getCalls.forEach(function(call, index) {
103- index = index % 61;
104+ index = index % 62;
105 index = ('000' + index).slice(-3);
106 expect(call.args.length).toBe(1);
107- expect(call.args[0]).toMatch(
108- '^(http://people.canonical.com)?/static/json/ubuntu(-rtm)?/landing-'
109- + index
110- + '\\?nocache=\\d+$');
111+ if (call.args[0] != '/v1/tickets') {
112+ expect(call.args[0]).toMatch(
113+ '^/static/json/ubuntu(-rtm)?/landing-'
114+ + index + '\\?nocache=\\d+$');
115+ } else {
116+ expect(call.args[0]).toBe('/v1/tickets');
117+ }
118 });
119 });
120 });

Subscribers

People subscribed via source and target branches