Merge lp:~doanac/ubuntu-ci-services-itself/webui-status into lp:ubuntu-ci-services-itself

Proposed by Andy Doan
Status: Superseded
Proposed branch: lp:~doanac/ubuntu-ci-services-itself/webui-status
Merge into: lp:ubuntu-ci-services-itself
Prerequisite: lp:~doanac/ubuntu-ci-services-itself/json-jsonp-status
Diff against target: 120 lines (+85/-1)
4 files modified
webui/index.html (+1/-0)
webui/status.html (+33/-0)
webui/ticket.html (+2/-1)
webui/webui_status.js (+49/-0)
To merge this branch: bzr merge lp:~doanac/ubuntu-ci-services-itself/webui-status
Reviewer Review Type Date Requested Status
Andy Doan (community) Approve
Evan (community) Needs Information
Vincent Ladeuil (community) Approve
PS Jenkins bot (community) continuous-integration Approve
Review via email: mp+208917@code.launchpad.net

This proposal has been superseded by a proposal from 2014-03-04.

Commit message

display health of all our ci web services via the webui

Description of the change

display status of all our ci web services via the webui

To post a comment you must log in.
Revision history for this message
Andy Doan (doanac) wrote :

webui: add status display for ci services

Provide a simplified view of the status of each service known
to the webui.

Revision history for this message
Chris Johnston (cjohnston) wrote :

I wonder if the link to "Status" should be "Component status" or something
similar. I think status may be too vague.

Revision history for this message
Andy Doan (doanac) wrote :

On 03/01/2014 07:30 AM, Chris Johnston wrote:
> I wonder if the link to "Status" should be "Component status" or something
> similar. I think status may be too vague.

I was worried about the same thing. I don't like "component status"
because it feels too big be putting in a menu. Maybe someone with a
better vocabulary than me can come up with a good word for this?

Revision history for this message
Evan (ev) wrote :
Revision history for this message
Andy Doan (doanac) wrote :

I'm going to try "System Status" in my setup today and see how it looks. If that's terrible, i'll try Health.

Revision history for this message
Andy Doan (doanac) wrote :

This should be ready now. I've changed the wording to "Engine Health"

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

FAILED: Continuous integration, rev:302
No commit message was specified in the merge proposal. Click on the following link and set the commit message (if you want a jenkins rebuild you need to trigger it yourself):
https://code.launchpad.net/~doanac/ubuntu-ci-services-itself/webui-status/+merge/208917/+edit-commit-message

http://s-jenkins.ubuntu-ci:8080/job/uci-engine-ci/268/
Executed test runs:

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/uci-engine-ci/268/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

FAILED: Continuous integration, rev:302
No commit message was specified in the merge proposal. Click on the following link and set the commit message (if you want a jenkins rebuild you need to trigger it yourself):
https://code.launchpad.net/~doanac/ubuntu-ci-services-itself/webui-status/+merge/208917/+edit-commit-message

http://s-jenkins.ubuntu-ci:8080/job/uci-engine-ci/270/
Executed test runs:

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/uci-engine-ci/270/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

PASSED: Continuous integration, rev:302
http://s-jenkins.ubuntu-ci:8080/job/uci-engine-ci/274/
Executed test runs:

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/uci-engine-ci/274/rebuild

review: Approve (continuous-integration)
Revision history for this message
Vincent Ladeuil (vila) wrote :

Shame I can't test it easily even manually :-/

'Engine Health' sounds good.

review: Approve
Revision history for this message
Evan (ev) wrote :
review: Needs Information
Revision history for this message
Andy Doan (doanac) wrote :

On 03/04/2014 04:59 AM, Evan Dandrea wrote:
> Was http://yuilibrary.com/yui/docs/datatable/ not a good fit here?

We don't have a consistent set of values coming back. So I was basically
just dumping the dictionary that comes back. I'm sure someone with
DataTables knowledge (which josepht has) could help me here.

As an example we'll get data back like this:

  = ppa-django/0
  {
   'launchpad_configured': true,
   'total ppas': 4,
   'available ppas': 1
  }

= bsb-restish/0
{
   'rabbit_configured': true,
}

I think this brings up 2 orthogonal decisions:

1) display strategy: should we use something more professional like
DataTables. And if so, should we do it in this MP? I'd say, use
DataTables, but convert in a follow-on MP. No strong opininion

2) data strategy: Maybe we should try and get these "json status
providers" to send status back in a more understood format that the
webui could provide more intelligent display on. I think "yes" for this,
and its probably not that hard. We could change the format to something
like:

  = ppa-django/0
  [
   {
     'label': 'launchpad_configured',
     'value': true,
     'status': 'PASS'
   },
   {
     'label': 'total ppas',
     'value': 4,
     'status': 'WARNING'
   },
   {
     'label': 'available ppas',
     'value': 0,
     'status': 'ERROR'
   }
  ]

is this worth shooting for in phase0?

Revision history for this message
Joe Talbott (joetalbott) wrote :

On Tue, Mar 04, 2014 at 03:36:26PM -0000, Andy Doan wrote:
> On 03/04/2014 04:59 AM, Evan Dandrea wrote:
> > Was http://yuilibrary.com/yui/docs/datatable/ not a good fit here?
>
> We don't have a consistent set of values coming back. So I was basically
> just dumping the dictionary that comes back. I'm sure someone with
> DataTables knowledge (which josepht has) could help me here.
>
> As an example we'll get data back like this:
>
> = ppa-django/0
> {
> 'launchpad_configured': true,
> 'total ppas': 4,
> 'available ppas': 1
> }
>
> = bsb-restish/0
> {
> 'rabbit_configured': true,
> }
>
> I think this brings up 2 orthogonal decisions:
>
> 1) display strategy: should we use something more professional like
> DataTables. And if so, should we do it in this MP? I'd say, use
> DataTables, but convert in a follow-on MP. No strong opininion

I'd recommend a follow-on MP because I always end up with big messy
commits when I try to use data-tables.
>
> 2) data strategy: Maybe we should try and get these "json status
> providers" to send status back in a more understood format that the
> webui could provide more intelligent display on. I think "yes" for this,
> and its probably not that hard. We could change the format to something
> like:

I think "yes" too, but that adds coupling between each component and the
webui. Or at worst requires all components to adhere to a "standard"
status format.

Revision history for this message
Andy Doan (doanac) wrote :

okay. i think the concensus is merge this and fix better later. I'll start on that now.

review: Approve
Revision history for this message
Evan (ev) wrote :

+1

Revision history for this message
Chris Johnston (cjohnston) wrote :

Unmerged revisions

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'webui/index.html'
2--- webui/index.html 2014-02-17 10:13:29 +0000
3+++ webui/index.html 2014-03-03 17:32:11 +0000
4@@ -20,6 +20,7 @@
5 </div>
6 <ul>
7 <li><a href="/" class="first ">Ticket List</a></li>
8+ <li><a href="/status.html">Engine Health</a></li>
9 </ul>
10 </nav>
11 </header><!-- /#header -->
12
13=== added file 'webui/status.html'
14--- webui/status.html 1970-01-01 00:00:00 +0000
15+++ webui/status.html 2014-03-03 17:32:11 +0000
16@@ -0,0 +1,33 @@
17+<html>
18+ <head>
19+ <link href='https://fonts.googleapis.com/css?family=Ubuntu:400,300,300italic,400italic,700,700italic|Ubuntu+Mono' rel='stylesheet' type='text/css' />
20+ <script type="text/javascript" src="http://yui.yahooapis.com/3.14.0/build/yui/yui.js"></script>
21+ <script type="text/javascript" src="webui.js"></script>
22+ <script type="text/javascript" src="webui_status.js"></script>
23+ <link rel="stylesheet" type="text/css" media="screen" href="ubuntu-styles.css" />
24+ <link rel="stylesheet" href="webui.css">
25+ <title>Ubuntu CI Engine - Service Status</title>
26+ </head>
27+ <body>
28+ <header class="banner global" role="banner">
29+ <nav role="navigation" class="nav-primary nav-right">
30+ <div class="logo">
31+ <a class="logo-ubuntu" href="/">
32+ <img width="118" height="27" src="logo-ubuntu-orange.png" alt="Ubuntu logo for print" />
33+ <span>CI Engine</span>
34+ </a>
35+ </div>
36+ <ul>
37+ <li><a href="/" class="first ">Ticket List</a></li>
38+ <li><a href="/status.html">Engine Health</a></li>
39+ </ul>
40+ </nav>
41+ </header><!-- /#header -->
42+
43+ <div class='container_15 clearfix'>
44+ <div class="wrapper">
45+ <div id="main-content" class="inner-wrapper">
46+ <div id="container"></div>
47+ </div></div></div>
48+ </body>
49+</html>
50
51=== modified file 'webui/ticket.html'
52--- webui/ticket.html 2014-02-17 10:13:29 +0000
53+++ webui/ticket.html 2014-03-03 17:32:11 +0000
54@@ -19,10 +19,11 @@
55 </div>
56 <ul>
57 <li><a href="/" class="first ">Ticket List</a></li>
58+ <li><a href="/status.html">Engine Health</a></li>
59 </ul>
60 </nav>
61 </header><!-- /#header -->
62-
63+
64 <div class='container_15 clearfix'>
65 <div class="wrapper">
66 <div id="main-content" class="inner-wrapper">
67
68=== added file 'webui/webui_status.js'
69--- webui/webui_status.js 1970-01-01 00:00:00 +0000
70+++ webui/webui_status.js 2014-03-03 17:32:11 +0000
71@@ -0,0 +1,49 @@
72+YUI().use('io', 'json-parse', 'jsonp', 'node', 'webui', function(Y) {
73+
74+ Y.one("div#main-content").setHTML("<h3>CI Engine Health</h3>");
75+ table = Y.Node.create("<table>");
76+ Y.one("div#main-content").append(table)
77+
78+ Y.io("/status_urls.json", {
79+ on: {
80+ success: function(tx, r) {
81+ console.log("success");
82+ try {
83+ data = Y.JSON.parse(r.responseText);
84+ for(key in data) {
85+ row = Y.Node.create("<tr>");
86+ row.append(Y.Node.create("<td>"+data[key].unit+"</td>"));
87+ sts = Y.Node.create("<td><a href='"+data[key].url+ "'>loading...</a></td>");
88+ row.append(sts);
89+ table.append(row);
90+ url = data[key].url + "?format=jsonp&callback={callback}";
91+ Y.jsonp(url, {
92+ args: [sts, url],
93+ on: {
94+ success: function(resp, sts, url) {
95+ txt = "<pre>";
96+ for (key in resp) {
97+ txt += key + ": " + resp[key] + "\n";
98+ }
99+ txt += "</pre>";
100+ sts.setHTML(txt);
101+ },
102+ failure: function(e, sts, url) {
103+ console.log('failed to load: ' + data[key].unit);
104+ sts.setHTML("<a href='" + url + "'>failed to load</a>");
105+ }
106+ }
107+ });
108+ }
109+ }
110+ catch (e) {
111+ Y.one("div#main-content").setHTML(e);
112+ return;
113+ }
114+ },
115+ failure: function(tx, r, e) {
116+ console.log("failure: ", tx, r, e);
117+ }
118+ }
119+ });
120+});

Subscribers

People subscribed via source and target branches