Merge lp:~chris.gagnon/qa-coverage-dashboard/reuse-inline-js-convert-to-static into lp:qa-coverage-dashboard

Proposed by Chris Gagnon
Status: Merged
Merged at revision: 761
Proposed branch: lp:~chris.gagnon/qa-coverage-dashboard/reuse-inline-js-convert-to-static
Merge into: lp:qa-coverage-dashboard
Diff against target: 1960 lines (+893/-895)
26 files modified
gaps/static/gaps/js/gaps_chart.js (+21/-0)
gaps/templates/branch_list.html (+0/-70)
gaps/templates/build.html (+0/-46)
gaps/templates/gaps/branch_list.html (+70/-0)
gaps/templates/gaps/build.html (+46/-0)
gaps/templates/gaps/gaps_layout.html (+10/-0)
gaps/templates/gaps/integration_list.html (+65/-0)
gaps/templates/gaps/job.html (+65/-0)
gaps/templates/gaps/job_list.html (+96/-0)
gaps/templates/gaps/main.html (+34/-0)
gaps/templates/gaps/project_detail.html (+83/-0)
gaps/templates/gaps/project_list.html (+202/-0)
gaps/templates/gaps/stack_detail.html (+100/-0)
gaps/templates/gaps/stack_list.html (+93/-0)
gaps/templates/gaps_layout.html (+0/-1)
gaps/templates/integration_list.html (+0/-65)
gaps/templates/job.html (+0/-65)
gaps/templates/job_list.html (+0/-96)
gaps/templates/main.html (+0/-34)
gaps/templates/project_detail.html (+0/-90)
gaps/templates/project_list.html (+0/-201)
gaps/templates/stack_detail.html (+0/-106)
gaps/templates/stack_list.html (+0/-113)
gaps/urls.py (+0/-3)
gaps/views.py (+4/-4)
qa_dashboard/settings.py (+4/-1)
To merge this branch: bzr merge lp:~chris.gagnon/qa-coverage-dashboard/reuse-inline-js-convert-to-static
Reviewer Review Type Date Requested Status
Allan LeSage (community) Approve
Review via email: mp+214345@code.launchpad.net
To post a comment you must log in.
761. By Chris Gagnon

remove extra { in gaps_layout

762. By Chris Gagnon

update settings.py to use local static js

763. By Chris Gagnon

resync with trunk

Revision history for this message
Chris Gagnon (chris.gagnon) wrote :

make sure to use ./manage collectstatic to make the static js files usable.

764. By Chris Gagnon

resync with trunk

Revision history for this message
Allan LeSage (allanlesage) wrote :

Ok this diff is pure murder--next time let's take one step at a time, no? I.e. make the changes and *then* move the files. I promise to be way more responsive to the MPs, sorry for the delay.

Please don't mark the bug *fix committed* until this branch is committed to trunk, IMO--or is this policy different in your ubuntu-history?

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== added directory 'gaps/static'
=== added directory 'gaps/static/gaps'
=== added directory 'gaps/static/gaps/js'
=== added file 'gaps/static/gaps/js/gaps_chart.js'
--- gaps/static/gaps/js/gaps_chart.js 1970-01-01 00:00:00 +0000
+++ gaps/static/gaps/js/gaps_chart.js 2014-04-07 22:20:52 +0000
@@ -0,0 +1,21 @@
1function create_gaps_line_chart(data_url) {
2 d3.json(data_url, function(data) {
3 nv.addGraph(function() {
4 var chart = nv.models.lineChart()
5 .width(1100).height(400);
6 chart.forceY([0, 1]);
7 chart.xAxis
8 .axisLabel('Date')
9 .tickFormat(function(d){return d3.time.format('%Y%m%d')(new Date(d * 1000));})
10
11 chart.yAxis
12 .axisLabel('%')
13 .tickFormat(d3.format('%'))
14 d3.select('#line-chart svg').datum(data).transition().duration(500).call(chart);
15
16 nv.utils.windowResize(chart.update);
17
18 return chart;
19 }); //d3.json
20 }); //addGraph
21} //create_gaps_chart
022
=== removed file 'gaps/templates/branch_list.html'
--- gaps/templates/branch_list.html 2014-03-07 16:58:26 +0000
+++ gaps/templates/branch_list.html 1970-01-01 00:00:00 +0000
@@ -1,70 +0,0 @@
1{% extends "layout.html" %}
2{% load dashboard_extras %}
3
4{% block content %}
5<script type='text/javascript'>
6 //<![CDATA[
7 $(document).ready(function() {
8 $(".data-table").dataTable({
9 "bPaginate": false,
10 "aaSorting": [[0, 'desc']]
11 });
12 });
13 //]]>
14</script>
15<div class='grid_15'>
16 <h2>
17 Branches
18 </h2>
19</div>
20<div class='grid_2'>
21 <h3 class='nav-title'>
22 BRANCH FILTER
23 </h3>
24 <ul class='left_nav'>
25 <li>
26 <a href='{% url branches %}'>All</a>
27 </li>
28 </ul>
29</div>
30<div class='grid_13'>
31 <table class='data-table basic wide'>
32 <thead>
33 <tr>
34 <th>Branch</th>
35 <th>Revno</th>
36 <th>Date</th>
37 <th>Series</th>
38 <th>Package</th>
39 <th>Upload Date</th>
40 </tr>
41 </thead>
42 <tbody>
43 {% for branch in branch_list %}
44 <tr>
45 <td>
46 <a href='job/{{ job.name }}'>
47 {{ branch.name }}
48 </a>
49 </td>
50 <td class='num'>
51 {{ branch.revno }}
52 </td>
53 <td>
54 {{ branch.rev_date }}
55 </td>
56 <td>
57 {{ branch.series }}
58 </td>
59 <td>
60 {{ branch.package }}
61 </td>
62 <td>
63 {{ branch.package_date }}
64 </td>
65 </tr>
66 {% endfor %}
67 </tbody>
68 </table>
69</div>
70{% endblock %}
710
=== removed file 'gaps/templates/build.html'
--- gaps/templates/build.html 2014-03-07 16:58:26 +0000
+++ gaps/templates/build.html 1970-01-01 00:00:00 +0000
@@ -1,46 +0,0 @@
1{% extends "layout.html" %}
2{% load dashboard_extras %}
3
4{% block page_name %}QA Coverage Dashboard{% endblock %}
5
6{% block content %}
7{{ build.timestamp }}
8<div class='grid_13'>
9 <table class='data-table basic wide'>
10 <thead>
11 <tr>
12 <th>Number</th>
13 <th>Flavor</th>
14 <th>Series</th>
15 <th>Result</th>
16 <th>Duration</th>
17 <th>Timestamp</th>
18 </tr>
19 </thead>
20 <tbody>
21 {% for run in runs %}
22 <tr>
23 <td>
24 <a href='{{ run.url }}'>{{ run.number }}</a>
25 <td>
26 {{ run.flavor }}
27 </td>
28 <td>
29 {{ run.series }}
30 </td>
31 <td>
32 {{ run.result }}
33 </td>
34 <td>
35 {{ run.duration }}
36 </td>
37 <td>
38 {{ run.timestamp }}
39 </td>
40 </tr>
41 {% endfor %}
42 </tbody>
43 </table>
44</div>
45
46{% endblock %}
470
=== added directory 'gaps/templates/gaps'
=== added file 'gaps/templates/gaps/branch_list.html'
--- gaps/templates/gaps/branch_list.html 1970-01-01 00:00:00 +0000
+++ gaps/templates/gaps/branch_list.html 2014-04-07 22:20:52 +0000
@@ -0,0 +1,70 @@
1{% extends "gaps/gaps_layout.html" %}
2{% load dashboard_extras %}
3
4{% block content %}
5<script type='text/javascript'>
6 //<![CDATA[
7 $(document).ready(function() {
8 $(".data-table").dataTable({
9 "bPaginate": false,
10 "aaSorting": [[0, 'desc']]
11 });
12 });
13 //]]>
14</script>
15<div class='grid_15'>
16 <h2>
17 Branches
18 </h2>
19</div>
20<div class='grid_2'>
21 <h3 class='nav-title'>
22 BRANCH FILTER
23 </h3>
24 <ul class='left_nav'>
25 <li>
26 <a href='{% url branches %}'>All</a>
27 </li>
28 </ul>
29</div>
30<div class='grid_13'>
31 <table class='data-table basic wide'>
32 <thead>
33 <tr>
34 <th>Branch</th>
35 <th>Revno</th>
36 <th>Date</th>
37 <th>Series</th>
38 <th>Package</th>
39 <th>Upload Date</th>
40 </tr>
41 </thead>
42 <tbody>
43 {% for branch in branch_list %}
44 <tr>
45 <td>
46 <a href='job/{{ job.name }}'>
47 {{ branch.name }}
48 </a>
49 </td>
50 <td class='num'>
51 {{ branch.revno }}
52 </td>
53 <td>
54 {{ branch.rev_date }}
55 </td>
56 <td>
57 {{ branch.series }}
58 </td>
59 <td>
60 {{ branch.package }}
61 </td>
62 <td>
63 {{ branch.package_date }}
64 </td>
65 </tr>
66 {% endfor %}
67 </tbody>
68 </table>
69</div>
70{% endblock %}
071
=== added file 'gaps/templates/gaps/build.html'
--- gaps/templates/gaps/build.html 1970-01-01 00:00:00 +0000
+++ gaps/templates/gaps/build.html 2014-04-07 22:20:52 +0000
@@ -0,0 +1,46 @@
1{% extends "gaps/gaps_layout.html" %}
2{% load dashboard_extras %}
3
4{% block page_name %}QA Coverage Dashboard{% endblock %}
5
6{% block content %}
7{{ build.timestamp }}
8<div class='grid_13'>
9 <table class='data-table basic wide'>
10 <thead>
11 <tr>
12 <th>Number</th>
13 <th>Flavor</th>
14 <th>Series</th>
15 <th>Result</th>
16 <th>Duration</th>
17 <th>Timestamp</th>
18 </tr>
19 </thead>
20 <tbody>
21 {% for run in runs %}
22 <tr>
23 <td>
24 <a href='{{ run.url }}'>{{ run.number }}</a>
25 <td>
26 {{ run.flavor }}
27 </td>
28 <td>
29 {{ run.series }}
30 </td>
31 <td>
32 {{ run.result }}
33 </td>
34 <td>
35 {{ run.duration }}
36 </td>
37 <td>
38 {{ run.timestamp }}
39 </td>
40 </tr>
41 {% endfor %}
42 </tbody>
43 </table>
44</div>
45
46{% endblock %}
047
=== added file 'gaps/templates/gaps/gaps_layout.html'
--- gaps/templates/gaps/gaps_layout.html 1970-01-01 00:00:00 +0000
+++ gaps/templates/gaps/gaps_layout.html 2014-04-07 22:20:52 +0000
@@ -0,0 +1,10 @@
1{% extends "layout.html" %}
2{% load staticfiles %}
3{% block extra_headers %}
4 <link type="text/css" href="//cdnjs.cloudflare.com/ajax/libs/nvd3/0.9/nv.d3.css" rel="stylesheet" />
5 <script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/d3/3.2.2/d3.min.js"></script>
6 <!-- need to switch back to cdnjs when bugs are fixed
7<script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/nvd3/0.9/nv.d3.js"></script>-->
8 <script type="text/javascript" src="//6df403e3d98e2ac67ac2-180150c581869d2c4c18db9c9e3179c4.r40.cf1.rackcdn.com/nv.d3.js"></script>
9 <script type='text/javascript' src='{% static "gaps/js/gaps_chart.js" %}'></script>
10{% endblock%}
011
=== added file 'gaps/templates/gaps/integration_list.html'
--- gaps/templates/gaps/integration_list.html 1970-01-01 00:00:00 +0000
+++ gaps/templates/gaps/integration_list.html 2014-04-07 22:20:52 +0000
@@ -0,0 +1,65 @@
1{% extends "gaps/gaps_layout.html" %}
2{% load dashboard_extras %}
3
4{% block page_name %}QA Coverage Dashboard{% endblock %}
5
6{% block content %}
7<script type='text/javascript'>
8 //<![CDATA[
9 $(document).ready(function() {
10 $(".data-table").dataTable({
11 "bPaginate": false,
12 "aaSorting": [[0, 'desc']]
13 });
14 });
15 //]]>
16</script>
17<div class='grid_15'>
18 <h2>
19 Integration Testing [TBD]
20 </h2>
21</div>
22<div class='grid_2'>
23 <h3 class='nav-title'>
24 STACKS
25 </h3>
26 <ul class='left_nav'>
27 <li>
28 <a href='{% url stacks %}'>All</a>
29 </li>
30 </ul>
31</div>
32<div class='grid_13'>
33 This page is work in progress.<BR>
34 It will be used to show test results for the daily-release process
35 integration tests.
36 <table class='data-table basic wide'>
37 <thead>
38 <tr>
39 <th>Name</th>
40 <th>Release</th>
41 <th>Series</th>
42 <th>Results</th>
43 </tr>
44 </thead>
45 <tbody>
46 {% for test in test_list %}
47 <tr>
48 <td>
49 <a href='{% url stacks %}/{{ test.stack_name }}'>{{ test.stack_name }}</a>
50 </td>
51 <td>
52 {{ test.release }}
53 </td>
54 <td>
55 {{ test.series }}
56 </td>
57 <td>
58 {{ test.results }}
59 </td>
60 </tr>
61 {% endfor %}
62 </tbody>
63 </table>
64</div>
65{% endblock %}
066
=== added file 'gaps/templates/gaps/job.html'
--- gaps/templates/gaps/job.html 1970-01-01 00:00:00 +0000
+++ gaps/templates/gaps/job.html 2014-04-07 22:20:52 +0000
@@ -0,0 +1,65 @@
1{% extends "gaps/gaps_layout.html" %}
2{% load dashboard_extras %}
3
4{% block page_name %}QA Coverage Dashboard{% endblock %}
5
6{% block content %}
7<script type='text/javascript'>
8 //<![CDATA[
9 $(document).ready(function() {
10 $(".data-table").dataTable({
11 "bPaginate": false,
12 "aaSorting": [[0, 'desc']]
13 });
14 });
15 //]]>
16</script>
17<div class='grid_15'>
18 <h2>
19 Job: {{ job.name }}
20 </h2>
21</div>
22<div class='grid_2'>
23 <h3 class='nav-title'>
24 BUILD FILTER
25 </h3>
26 <ul class='left_nav'>
27 <li>
28 <a href='?show=all'>All</a>
29 </li>
30 {% for result in result_list %}
31 <li>
32 <a href='{% url jobs %}{{ job.name }}?show={{ result.name }}'>{{ result.name }}</a>
33 </li>
34 {% endfor %}
35 </ul>
36</div>
37<div class='grid_13'>
38</div>
39<div class='grid_13'>
40 <table class='data-table basic wide'>
41 <thead>
42 <tr>
43 <th>Number</th>
44 <th>Status</th>
45 <th>Timestamp</th>
46 </tr>
47 </thead>
48 <tbody>
49 {% for build in build_list %}
50 <tr>
51 <td class='num'>
52 <a href="{{ build.url }}">{{ build.number }}</a>
53 </td>
54 <td>
55 {{ build.result }}
56 </td>
57 <td>
58 {{ build.timestamp }}
59 </td>
60 </tr>
61 {% endfor %}
62 </tbody>
63 </table>
64</div>
65{% endblock %}
066
=== added file 'gaps/templates/gaps/job_list.html'
--- gaps/templates/gaps/job_list.html 1970-01-01 00:00:00 +0000
+++ gaps/templates/gaps/job_list.html 2014-04-07 22:20:52 +0000
@@ -0,0 +1,96 @@
1{% extends "gaps/gaps_layout.html" %}
2{% load dashboard_extras %}
3
4{% block page_name %}QA Coverage Dashboard{% endblock %}
5
6{% block content %}
7<script type='text/javascript'>
8 //<![CDATA[
9 $(document).ready(function() {
10 $(".data-table").dataTable({
11 "bPaginate": false,
12 "aaSorting": [[0, 'desc']]
13 });
14 });
15 //]]>
16</script>
17<div class='grid_15'>
18 <h2>
19 Jobs
20 </h2>
21</div>
22<div class='grid_2'>
23 <h3 class='nav-title'>
24 JOB FILTER
25 </h3>
26 <ul class='left_nav'>
27 <li>
28 <a href='{% url jobs %}'>All</a>
29 </li>
30 <li>
31 <a href='{% url jobs %}?show=autolanding'>Autolanding</a>
32 </li>
33 <li>
34 <a href='{% url jobs %}?show=ci'>CI</a>
35 </li>
36 <li>
37 <a href='{% url jobs %}?show=daily'>Daily</a>
38 </li>
39 <li>
40 <a href='{% url jobs %}?show=coverity'>Coverity</a>
41 </li>
42 </ul>
43</div>
44<div class='grid_13'>
45 <table class='data-table basic wide'>
46 <thead>
47 <tr>
48 <th>Job</th>
49 <th>Release</th>
50 <th>Arch</th>
51 <th>Date</th>
52 <th>Build</th>
53 <th>Duration</th>
54 <th>Tests</th>
55 <th>Coverage</th>
56 <th>Bugs</th>
57 </tr>
58 </thead>
59 <tbody>
60 {% for job in job_list %}
61 <tr>
62 <td>
63 <a href='job/{{ job.name }}'>
64 {{ job.name }}
65 </a>
66 </td>
67 <td>
68 {{ job.series }}
69 </td>
70 <td>
71 {{ job.arch }}
72 </td>
73 <td>
74 {{ job.last_run_date }}
75 </td>
76 <td class='num'>
77 {{ job.build_count }}
78 </td>
79 <td class='num'>
80 {{ job.duration }}
81 </td>
82 <td class='num'>
83 {{ job.test_count }}
84 </td>
85 <td class='num {{job.coverage_rate|pass_rate_color}}'>
86 {{ job.coverage_rate_pct }}
87 </td>
88 <td class='num'>
89 {{ job.bug_count }}
90 </td>
91 </tr>
92 {% endfor %}
93 </tbody>
94 </table>
95</div>
96{% endblock %}
097
=== added file 'gaps/templates/gaps/main.html'
--- gaps/templates/gaps/main.html 1970-01-01 00:00:00 +0000
+++ gaps/templates/gaps/main.html 2014-04-07 22:20:52 +0000
@@ -0,0 +1,34 @@
1{% extends "gaps/gaps_layout.html" %}
2{% load dashboard_extras %}
3
4{% block content %}
5<script type='text/javascript'>
6 //<![CDATA[
7 $(document).ready(function() {
8 $(".data-table").dataTable({
9 "bPaginate": false,
10 "aaSorting": [[0, 'desc']]
11 });
12 });
13 //]]>
14</script>
15<div class='grid_15'>
16 <ul>
17 <li>
18 <h2>
19 <a href='{% url stacks %}?show=head'>Stacks</a>
20 </h2>
21 </li>
22 <li>
23 <h2>
24 <a href='{% url projects %}'>Projects</a>
25 </h2>
26 </li>
27 <li>
28 <h2>
29 <a href='{% url integration %}'>Daily Integration [TBD]</a>
30 </h2>
31 </li>
32 </ul>
33</div>
34{% endblock %}
035
=== added file 'gaps/templates/gaps/project_detail.html'
--- gaps/templates/gaps/project_detail.html 1970-01-01 00:00:00 +0000
+++ gaps/templates/gaps/project_detail.html 2014-04-07 22:20:52 +0000
@@ -0,0 +1,83 @@
1{% extends "gaps/gaps_layout.html" %}
2{% load dashboard_extras staticfiles %}
3{% load percentage %}
4
5{% block content %}
6<style>
7 #line-chart svg {
8 height: 400px;
9 width: 1100px;
10 }
11</style>
12<script type='text/javascript'>
13 //<![CDATA[
14 $(document).ready(function() {
15 $(".data-table").dataTable({
16 "bPaginate": false,
17 "aaSorting": [[2, 'desc']]
18 });
19 });
20 //]]>
21</script>
22<script type="text/javascript">
23 d3.json('{% url "gaps_api_project" project.name %}', function(data) {
24 nv.addGraph(function() {
25 var chart = nv.models.lineChart()
26 .width(1100).height(400);
27 chart.forceY([0, 1]);
28 chart.xAxis
29 .axisLabel('Date')
30 .tickFormat(function(d){return d3.time.format('%Y%m%d')(new Date(d * 1000));})
31
32 chart.yAxis
33 .axisLabel('%')
34 .tickFormat(d3.format('%'))
35 d3.select('#line-chart svg').datum(data).transition().duration(500).call(chart);
36
37 nv.utils.windowResize(chart.update);
38
39 return chart;
40 });
41 });
42</script>
43<div class='grid_15'>
44 <h2>
45 Project: {{ project.name }}
46 </h2>
47</div>
48<div class='grid_13'>
49 {% if coverage_datas|length > 0 %}
50 <div class="grid_13">
51 <div id="line-chart">
52 <svg></svg>
53 </div>
54 </div>
55 <table class='data-table basic wide'>
56 <thead>
57 <tr>
58 <th>Jenkins Build</th>
59 <th>Line Coverage</th>
60 <th>Branch Coverage</th>
61 </tr>
62 </thead>
63 <tbody>
64 {% for coverage_data in coverage_datas %}
65 <tr>
66 <td>
67 <a href='{{ coverage_data.coverage_build.url }}'>{{ coverage_data.coverage_build.ran_at }}</a>
68 </td>
69 <td class='num'>
70 {{ coverage_data.line_coverage|percentage }}%
71 </td>
72 <td class='num'>
73 {{ coverage_data.branch_coverage|percentage }}%
74 </td>
75 </tr>
76 {% endfor %}
77 </tbody>
78 </table>
79 {% else %}
80No coverage data was found for this project. Please pursue with your QA contact or on freenode in the #ubuntu-quality channel.
81 {% endif %}
82</div>
83{% endblock %}
084
=== added file 'gaps/templates/gaps/project_list.html'
--- gaps/templates/gaps/project_list.html 1970-01-01 00:00:00 +0000
+++ gaps/templates/gaps/project_list.html 2014-04-07 22:20:52 +0000
@@ -0,0 +1,202 @@
1{% extends "gaps/gaps_layout.html" %}
2{% load staticfiles %}
3{% load dashboard_extras %}
4{% load percentage %}
5
6{% block content %}
7<script type='text/javascript'>
8 //<![CDATA[
9 $(document).ready(function() {
10 $(".data-table").dataTable({
11 "bPaginate": false,
12 "aaSorting": [[3, 'desc'], [0, 'asc']],
13 "aoColumns": [
14 null,
15 null,
16 {"aDataSort": [3]},
17 {"bVisible": false},
18 {"aDataSort": [5]},
19 {"bVisible": false},
20 ]
21 });
22 });
23 //]]>
24</script>
25<div class='grid_15'>
26 <h2>
27 Projects
28 </h2>
29 {% if project_list %}
30 <div class='grid_13'></div>
31 <div id='avg_chart_text' class='avg_chart_box'>
32 <div class='chart_title'>Code Coverage</div>
33 <div class='avg_chart_box'>
34 <div id='lineGaugeContainer'></div>
35 </div>
36 <div class='avg_chart_box'>
37 <div id='branchGaugeContainer'></div>
38 </div>
39 <div class='avg_chart_box'>
40 <div id='reportingGaugeContainer'></div>
41 </div>
42 </div>
43 {% endif %}
44</div>
45<div class='grid_2'>
46 <h3 class='nav-title'>
47 PROJECT FILTER
48 </h3>
49 <ul class='left_nav'>
50 <li>
51 <a href='{% url 'projects' %}'>All</a>
52 </li>
53 {% for release in release_list %}
54 <li>
55 <a href='{% url 'projects' %}?show={{ release }} '>{{ release }}</a>
56 </li>
57 {% endfor %}
58 </ul>
59</div>
60<div class='grid_13'>
61 <table class='data-table basic wide'>
62 <thead>
63 <tr>
64 <th>Name</th>
65 <th>Last Build</th>
66 <th>Line Coverage</th>
67 <th>Line Coverage Sorting Criterion</th>
68 <th>Branch Coverage</th>
69 <th>Branch Coverage Sorting Criterion</th>
70 </tr>
71 </thead>
72 <tbody>
73 {% for project in project_list %}
74 <tr>
75 <td>
76 <a href='{% url 'projects' %}{{ project.name }}'>{{ project.name }}</a>
77 </td>
78 <td>
79 {{ project.last_build.ran_at }}
80 </td>
81 <td class='num'>
82 {% if project.last_coverage_data.line_coverage == None %}
83 N/A
84 {% else %}
85 {{ project.last_coverage_data.line_coverage|percentage }}%
86 {% endif %}
87 </td>
88 <td class='num'>
89 {{ project.last_coverage_data.line_coverage|percentage }}
90 </td>
91 <td class='num'>
92 {% if project.last_coverage_data.line_coverage == None %}
93 N/A
94 {% else %}
95 {{ project.last_coverage_data.branch_coverage|percentage }}%
96 {% endif %}
97 </td>
98 <td class='num'>
99 {{ project.last_coverage_data.branch_coverage|percentage }}
100 </td>
101 </tr>
102 {% endfor %}
103 </tbody>
104 </table>
105</div>
106{% if project_list %}
107 {% load staticfiles %}
108 <script type="text/javascript" src='{% static "js/d3v3.js" %}'></script>
109 <script type="text/javascript" src='{% static "js/gauge.js" %}'></script>
110 <script type="text/javascript">
111
112 function avgLines() {
113 // project reporting list
114 var total_projects = 0;
115 var reporting_project = 0;
116 var line_sum = 0;
117 var hit_sum = 0;
118 var total_sum = 0;
119 var taken_sum = 0;
120
121 {% for project in project_list %}
122
123 var line_count = {{ project.ci_project.line_count|default_if_none:"0" }} + 0;
124
125 total_projects = total_projects + 1;
126
127 if ( line_count > 0) {
128 reporting_project = reporting_project + 1;
129 }
130
131 line_sum = line_sum + line_count;
132 hit_sum = hit_sum + {{ project.ci_project.hit_count|default_if_none:"0" }} + 0;
133 total_sum = total_sum + {{ project.ci_project.total_count|default_if_none:"0" }} + 0;
134 taken_sum = taken_sum + {{ project.ci_project.taken_count|default_if_none:"0" }} + 0;
135
136 {% endfor %}
137
138
139 line_percent = (hit_sum / line_sum)
140 branch_percent = (taken_sum / total_sum)
141 proj_report_percent = (reporting_project / total_projects)
142 return [Math.round(line_percent * 100), Math.round(branch_percent * 100), Math.round(proj_report_percent * 100)]
143}
144
145 var coverage_data = avgLines()
146 var gauges = [];
147 var gauge_size = 106.5;
148 function create_coverage_gauge(name, label, value) {
149 var config =
150 {
151 size: gauge_size,
152 label: label,
153 minorTicks: 5
154 }
155
156 config.redZones = [];
157 config.redZones.push({ from: 0, to: 50 });
158
159 config.yellowZones = [];
160 config.yellowZones.push({ from: 50, to: 85 });
161
162 config.greenZones = [];
163 config.greenZones.push = ({ from: 85, to: 100 });
164
165 gauges[name] = new Gauge(name + "GaugeContainer", config);
166 gauges[name].render();
167 gauges[name].redraw(value);
168 }
169
170  function create_proj_report_gauge(name, label, value) {
171  var config =
172 {
173 size: gauge_size,
174 label: label,
175 minorTicks: 5
176 }
177
178 config.redZones = [];
179 config.redZones.push({ from: 0, to: 85 });
180
181 config.yellowZones = [];
182 config.yellowZones.push({ from: 85, to: 95 });
183
184 config.greenZones = [];
185 config.greenZones.push = ({ from: 95, to: 100 });
186
187 gauges[name] = new Gauge(name + "GaugeContainer", config);
188 gauges[name].render();
189 gauges[name].redraw(value);
190 }
191    
192
193 function init_charts() {
194 create_coverage_gauge("line", "Line", coverage_data[0])
195 create_coverage_gauge("branch", "Branch", coverage_data[1])
196 create_proj_report_gauge("reporting", "Reporting", coverage_data[2])
197 }
198
199 window.onload = init_charts()
200 </script>
201{% endif %}
202{% endblock %}
0203
=== added file 'gaps/templates/gaps/stack_detail.html'
--- gaps/templates/gaps/stack_detail.html 1970-01-01 00:00:00 +0000
+++ gaps/templates/gaps/stack_detail.html 2014-04-07 22:20:52 +0000
@@ -0,0 +1,100 @@
1{% extends "gaps/gaps_layout.html" %}
2{% load staticfiles %}
3{% load dashboard_extras %}
4{% load gaps_extras %}
5{% load percentage %}
6
7{% block content %}
8<style>
9 #line-chart svg {
10 height: 400px;
11 width: 1100px;
12 }
13</style>
14<script type='text/javascript'>
15 //<![CDATA[
16 $(document).ready(function() {
17 $(".data-table").dataTable({
18 "bPaginate": false,
19 "aaSorting": [[2, 'desc']]
20 });
21 });
22 //]]>
23</script>
24<script type="text/javascript">
25 d3.json('{% url 'gaps_api_stack' stack.name %}', function(data) {
26 nv.addGraph(function() {
27 var chart = nv.models.lineChart()
28 .width(900).height(400);
29 chart.forceY([0, 1]);
30 chart.xAxis
31 .axisLabel('Date')
32 .tickFormat(function(d){return d3.time.format('%Y%m%d')(new Date(d * 1000));})
33 chart.yAxis
34 .axisLabel('%')
35 .tickFormat(d3.format('%'))
36 d3.select('#line-chart svg').datum(data).transition().duration(500).call(chart);
37 nv.utils.windowResize(chart.update);
38 return chart;
39 });
40 });
41</script>
42<div class='grid_15'>
43 <h2>
44 Stack: {{ stack.name }}
45 </h2>
46</div>
47<div class='grid_2'>
48 <h3 class='nav-title'>
49 STACKS
50 </h3>
51 <ul class='left_nav'>
52 {% for stack in stack_list %}
53 <li>
54 <a href='{% url 'stacks' %}{{ stack }}'>{{ stack }}</a>
55 </li>
56 {% endfor %}
57 </ul>
58</div>
59 <div class="grid_13">
60 <div id="line-chart">
61 <svg></svg>
62 </div>
63 <table class='data-table basic wide'>
64 <thead>
65 <tr>
66 <th>Name</th>
67 <th>Last Build</th>
68 <th>Line Coverage</th>
69 <th>Branch Coverage</th>
70 </tr>
71 </thead>
72 <tbody>
73 {% for project in project_list %}
74 <tr>
75 <td>
76 <a href='{% url 'projects' %}{{ project.name }}/'>{{ project.name }}</a>
77 </td>
78 <td>
79 {{ project.last_build.ran_at }}
80 </td>
81 <td class='num'>
82 {% if project.last_coverage_data.line_coverage == None %}
83 N/A
84 {% else %}
85 {{ project.last_coverage_data.line_coverage|percentage }}%
86 {% endif %}
87 </td>
88 <td class='num'>
89 {% if project.last_coverage_data.branch_coverage == None %}
90 N/A
91 {% else %}
92 {{ project.last_coverage_data.branch_coverage|percentage }}%
93 {% endif %}
94 </td>
95 </tr>
96 {% endfor %}
97 </tbody>
98 </table>
99</div>
100{% endblock %}
0101
=== added file 'gaps/templates/gaps/stack_list.html'
--- gaps/templates/gaps/stack_list.html 1970-01-01 00:00:00 +0000
+++ gaps/templates/gaps/stack_list.html 2014-04-07 22:20:52 +0000
@@ -0,0 +1,93 @@
1{% extends "gaps/gaps_layout.html" %}
2{% load staticfiles %}
3{% load dashboard_extras %}
4{% load gaps_extras %}
5{% load percentage %}
6
7{% block content %}
8<style>
9 #line-chart svg {
10 height: 400px;
11 width: 1100px;
12 }
13</style>
14<script type='text/javascript'>
15 //<![CDATA[
16 $(document).ready(function() {
17 $(".data-table").dataTable({
18 "bPaginate": false,
19 "aaSorting": [[0, 'desc']]
20 });
21 });
22 //]]>
23</script>
24<script type="text/javascript">
25 var chart_url = '{% url "gaps_api_stack_list" %}'
26 create_gaps_line_chart(chart_url)
27</script>
28<div class='grid_15'>
29 <h2>
30 {% if show_filter %}
31 Stack : {{ show_filter }}
32 {% else %}
33 All Stacks
34 {% endif %}
35 </h2>
36</div>
37<div class='grid_2'>
38 <h3 class='nav-title'>
39
40 </h3>
41 <ul class='left_nav'>
42 <li>
43 <a href='{% url 'stacks' %}'>All</a>
44 </li>
45 {% for release in release_list %}
46 <li>
47 <a href='{% url 'stacks' %}?show={{ release }} '>{{ release }}</a>
48 </li>
49 {% endfor %}
50 </ul>
51</div>
52<div class="grid_13">
53<div id="line-chart">
54 <svg></svg>
55</div>
56 <table class='data-table basic wide'>
57 <thead>
58 <tr>
59 <th>Name</th>
60 <th>Projects Reporting</th>
61 <th>Line Coverage</th>
62 <th>Branch Coverage</th>
63 </tr>
64 </thead>
65 <tbody>
66 {% for stack in stack_list %}
67 <tr>
68 <td>
69 <a href='{% url 'stacks' %}{{ stack.name }}/'>{{ stack.name }}</a>
70 </td>
71 <td class='{{ stack.percent_reporting|percent_reporting_color }}'>
72 {{ stack.percent_reporting|percentage }}
73 </td>
74 <td class='num'>
75 {% if stack.last_coverage_observation.line_coverage == None %}
76 N/A
77 {% else %}
78 {{ stack.last_coverage_observation.line_coverage|percentage }}%
79 {% endif %}
80 </td>
81 <td class='num'>
82 {% if stack.last_coverage_observation.branch_coverage == None %}
83 N/A
84 {% else %}
85 {{ stack.last_coverage_observation.branch_coverage|percentage }}%
86 {% endif %}
87 </td>
88 </tr>
89 {% endfor %}
90 </tbody>
91 </table>
92</div>
93{% endblock %}
094
=== removed file 'gaps/templates/gaps_layout.html'
--- gaps/templates/gaps_layout.html 2014-03-09 21:55:39 +0000
+++ gaps/templates/gaps_layout.html 1970-01-01 00:00:00 +0000
@@ -1,1 +0,0 @@
1{% extends "layout.html" %}
20
=== removed file 'gaps/templates/integration_list.html'
--- gaps/templates/integration_list.html 2014-03-07 16:58:26 +0000
+++ gaps/templates/integration_list.html 1970-01-01 00:00:00 +0000
@@ -1,65 +0,0 @@
1{% extends "gaps_layout.html" %}
2{% load dashboard_extras %}
3
4{% block page_name %}QA Coverage Dashboard{% endblock %}
5
6{% block content %}
7<script type='text/javascript'>
8 //<![CDATA[
9 $(document).ready(function() {
10 $(".data-table").dataTable({
11 "bPaginate": false,
12 "aaSorting": [[0, 'desc']]
13 });
14 });
15 //]]>
16</script>
17<div class='grid_15'>
18 <h2>
19 Integration Testing [TBD]
20 </h2>
21</div>
22<div class='grid_2'>
23 <h3 class='nav-title'>
24 STACKS
25 </h3>
26 <ul class='left_nav'>
27 <li>
28 <a href='{% url stacks %}'>All</a>
29 </li>
30 </ul>
31</div>
32<div class='grid_13'>
33 This page is work in progress.<BR>
34 It will be used to show test results for the daily-release process
35 integration tests.
36 <table class='data-table basic wide'>
37 <thead>
38 <tr>
39 <th>Name</th>
40 <th>Release</th>
41 <th>Series</th>
42 <th>Results</th>
43 </tr>
44 </thead>
45 <tbody>
46 {% for test in test_list %}
47 <tr>
48 <td>
49 <a href='{% url stacks %}/{{ test.stack_name }}'>{{ test.stack_name }}</a>
50 </td>
51 <td>
52 {{ test.release }}
53 </td>
54 <td>
55 {{ test.series }}
56 </td>
57 <td>
58 {{ test.results }}
59 </td>
60 </tr>
61 {% endfor %}
62 </tbody>
63 </table>
64</div>
65{% endblock %}
660
=== removed file 'gaps/templates/job.html'
--- gaps/templates/job.html 2014-03-07 16:58:26 +0000
+++ gaps/templates/job.html 1970-01-01 00:00:00 +0000
@@ -1,65 +0,0 @@
1{% extends "layout.html" %}
2{% load dashboard_extras %}
3
4{% block page_name %}QA Coverage Dashboard{% endblock %}
5
6{% block content %}
7<script type='text/javascript'>
8 //<![CDATA[
9 $(document).ready(function() {
10 $(".data-table").dataTable({
11 "bPaginate": false,
12 "aaSorting": [[0, 'desc']]
13 });
14 });
15 //]]>
16</script>
17<div class='grid_15'>
18 <h2>
19 Job: {{ job.name }}
20 </h2>
21</div>
22<div class='grid_2'>
23 <h3 class='nav-title'>
24 BUILD FILTER
25 </h3>
26 <ul class='left_nav'>
27 <li>
28 <a href='?show=all'>All</a>
29 </li>
30 {% for result in result_list %}
31 <li>
32 <a href='{% url jobs %}{{ job.name }}?show={{ result.name }}'>{{ result.name }}</a>
33 </li>
34 {% endfor %}
35 </ul>
36</div>
37<div class='grid_13'>
38</div>
39<div class='grid_13'>
40 <table class='data-table basic wide'>
41 <thead>
42 <tr>
43 <th>Number</th>
44 <th>Status</th>
45 <th>Timestamp</th>
46 </tr>
47 </thead>
48 <tbody>
49 {% for build in build_list %}
50 <tr>
51 <td class='num'>
52 <a href="{{ build.url }}">{{ build.number }}</a>
53 </td>
54 <td>
55 {{ build.result }}
56 </td>
57 <td>
58 {{ build.timestamp }}
59 </td>
60 </tr>
61 {% endfor %}
62 </tbody>
63 </table>
64</div>
65{% endblock %}
660
=== removed file 'gaps/templates/job_list.html'
--- gaps/templates/job_list.html 2014-03-07 16:58:26 +0000
+++ gaps/templates/job_list.html 1970-01-01 00:00:00 +0000
@@ -1,96 +0,0 @@
1{% extends "layout.html" %}
2{% load dashboard_extras %}
3
4{% block page_name %}QA Coverage Dashboard{% endblock %}
5
6{% block content %}
7<script type='text/javascript'>
8 //<![CDATA[
9 $(document).ready(function() {
10 $(".data-table").dataTable({
11 "bPaginate": false,
12 "aaSorting": [[0, 'desc']]
13 });
14 });
15 //]]>
16</script>
17<div class='grid_15'>
18 <h2>
19 Jobs
20 </h2>
21</div>
22<div class='grid_2'>
23 <h3 class='nav-title'>
24 JOB FILTER
25 </h3>
26 <ul class='left_nav'>
27 <li>
28 <a href='{% url jobs %}'>All</a>
29 </li>
30 <li>
31 <a href='{% url jobs %}?show=autolanding'>Autolanding</a>
32 </li>
33 <li>
34 <a href='{% url jobs %}?show=ci'>CI</a>
35 </li>
36 <li>
37 <a href='{% url jobs %}?show=daily'>Daily</a>
38 </li>
39 <li>
40 <a href='{% url jobs %}?show=coverity'>Coverity</a>
41 </li>
42 </ul>
43</div>
44<div class='grid_13'>
45 <table class='data-table basic wide'>
46 <thead>
47 <tr>
48 <th>Job</th>
49 <th>Release</th>
50 <th>Arch</th>
51 <th>Date</th>
52 <th>Build</th>
53 <th>Duration</th>
54 <th>Tests</th>
55 <th>Coverage</th>
56 <th>Bugs</th>
57 </tr>
58 </thead>
59 <tbody>
60 {% for job in job_list %}
61 <tr>
62 <td>
63 <a href='job/{{ job.name }}'>
64 {{ job.name }}
65 </a>
66 </td>
67 <td>
68 {{ job.series }}
69 </td>
70 <td>
71 {{ job.arch }}
72 </td>
73 <td>
74 {{ job.last_run_date }}
75 </td>
76 <td class='num'>
77 {{ job.build_count }}
78 </td>
79 <td class='num'>
80 {{ job.duration }}
81 </td>
82 <td class='num'>
83 {{ job.test_count }}
84 </td>
85 <td class='num {{job.coverage_rate|pass_rate_color}}'>
86 {{ job.coverage_rate_pct }}
87 </td>
88 <td class='num'>
89 {{ job.bug_count }}
90 </td>
91 </tr>
92 {% endfor %}
93 </tbody>
94 </table>
95</div>
96{% endblock %}
970
=== removed file 'gaps/templates/main.html'
--- gaps/templates/main.html 2014-03-07 16:58:26 +0000
+++ gaps/templates/main.html 1970-01-01 00:00:00 +0000
@@ -1,34 +0,0 @@
1{% extends "layout.html" %}
2{% load dashboard_extras %}
3
4{% block content %}
5<script type='text/javascript'>
6 //<![CDATA[
7 $(document).ready(function() {
8 $(".data-table").dataTable({
9 "bPaginate": false,
10 "aaSorting": [[0, 'desc']]
11 });
12 });
13 //]]>
14</script>
15<div class='grid_15'>
16 <ul>
17 <li>
18 <h2>
19 <a href='{% url stacks %}?show=head'>Stacks</a>
20 </h2>
21 </li>
22 <li>
23 <h2>
24 <a href='{% url projects %}'>Projects</a>
25 </h2>
26 </li>
27 <li>
28 <h2>
29 <a href='{% url integration %}'>Daily Integration [TBD]</a>
30 </h2>
31 </li>
32 </ul>
33</div>
34{% endblock %}
350
=== removed file 'gaps/templates/project_detail.html'
--- gaps/templates/project_detail.html 2014-03-14 19:54:57 +0000
+++ gaps/templates/project_detail.html 1970-01-01 00:00:00 +0000
@@ -1,90 +0,0 @@
1{% extends "layout.html" %}
2{% load dashboard_extras %}
3{% load percentage %}
4{% block extra_headers %}
5<link type="text/css" href="//cdnjs.cloudflare.com/ajax/libs/nvd3/0.9/nv.d3.css" rel="stylesheet" />
6<script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/d3/3.2.2/d3.min.js"></script>
7<!-- need to switch back to cdnjs when bugs are fixed
8<script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/nvd3/0.9/nv.d3.js"></script>-->
9<script type="text/javascript" src="//6df403e3d98e2ac67ac2-180150c581869d2c4c18db9c9e3179c4.r40.cf1.rackcdn.com/nv.d3.js"></script>
10{% endblock extra_headers %}
11
12{% block content %}
13<style>
14 #line-chart svg {
15 height: 400px;
16 width: 1100px;
17 }
18</style>
19<script type='text/javascript'>
20 //<![CDATA[
21 $(document).ready(function() {
22 $(".data-table").dataTable({
23 "bPaginate": false,
24 "aaSorting": [[2, 'desc']]
25 });
26 });
27 //]]>
28</script>
29<script type="text/javascript">
30 d3.json('{% url "gaps_api_project" project.name %}', function(data) {
31 nv.addGraph(function() {
32 var chart = nv.models.lineChart()
33 .width(1100).height(400);
34 chart.forceY([0, 1]);
35 chart.xAxis
36 .axisLabel('Date')
37 .tickFormat(function(d){return d3.time.format('%Y%m%d')(new Date(d * 1000));})
38
39 chart.yAxis
40 .axisLabel('%')
41 .tickFormat(d3.format('%'))
42 d3.select('#line-chart svg').datum(data).transition().duration(500).call(chart);
43
44 nv.utils.windowResize(chart.update);
45
46 return chart;
47 });
48 });
49</script>
50<div class='grid_15'>
51 <h2>
52 Project: {{ project.name }}
53 </h2>
54</div>
55<div class='grid_13'>
56 {% if coverage_datas|length > 0 %}
57 <div class="grid_13">
58 <div id="line-chart">
59 <svg></svg>
60 </div>
61 </div>
62 <table class='data-table basic wide'>
63 <thead>
64 <tr>
65 <th>Jenkins Build</th>
66 <th>Line Coverage</th>
67 <th>Branch Coverage</th>
68 </tr>
69 </thead>
70 <tbody>
71 {% for coverage_data in coverage_datas %}
72 <tr>
73 <td>
74 <a href='{{ coverage_data.coverage_build.url }}'>{{ coverage_data.coverage_build.ran_at }}</a>
75 </td>
76 <td class='num'>
77 {{ coverage_data.line_coverage|percentage }}%
78 </td>
79 <td class='num'>
80 {{ coverage_data.branch_coverage|percentage }}%
81 </td>
82 </tr>
83 {% endfor %}
84 </tbody>
85 </table>
86 {% else %}
87No coverage data was found for this project. Please pursue with your QA contact or on freenode in the #ubuntu-quality channel.
88 {% endif %}
89</div>
90{% endblock %}
910
=== removed file 'gaps/templates/project_list.html'
--- gaps/templates/project_list.html 2014-03-14 16:52:09 +0000
+++ gaps/templates/project_list.html 1970-01-01 00:00:00 +0000
@@ -1,201 +0,0 @@
1{% extends "gaps_layout.html" %}
2{% load dashboard_extras %}
3{% load percentage %}
4
5{% block content %}
6<script type='text/javascript'>
7 //<![CDATA[
8 $(document).ready(function() {
9 $(".data-table").dataTable({
10 "bPaginate": false,
11 "aaSorting": [[3, 'desc'], [0, 'asc']],
12 "aoColumns": [
13 null,
14 null,
15 {"aDataSort": [3]},
16 {"bVisible": false},
17 {"aDataSort": [5]},
18 {"bVisible": false},
19 ]
20 });
21 });
22 //]]>
23</script>
24<div class='grid_15'>
25 <h2>
26 Projects
27 </h2>
28 {% if project_list %}
29 <div class='grid_13'></div>
30 <div id='avg_chart_text' class='avg_chart_box'>
31 <div class='chart_title'>Code Coverage</div>
32 <div class='avg_chart_box'>
33 <div id='lineGaugeContainer'></div>
34 </div>
35 <div class='avg_chart_box'>
36 <div id='branchGaugeContainer'></div>
37 </div>
38 <div class='avg_chart_box'>
39 <div id='reportingGaugeContainer'></div>
40 </div>
41 </div>
42 {% endif %}
43</div>
44<div class='grid_2'>
45 <h3 class='nav-title'>
46 PROJECT FILTER
47 </h3>
48 <ul class='left_nav'>
49 <li>
50 <a href='{% url 'projects' %}'>All</a>
51 </li>
52 {% for release in release_list %}
53 <li>
54 <a href='{% url 'projects' %}?show={{ release }} '>{{ release }}</a>
55 </li>
56 {% endfor %}
57 </ul>
58</div>
59<div class='grid_13'>
60 <table class='data-table basic wide'>
61 <thead>
62 <tr>
63 <th>Name</th>
64 <th>Last Build</th>
65 <th>Line Coverage</th>
66 <th>Line Coverage Sorting Criterion</th>
67 <th>Branch Coverage</th>
68 <th>Branch Coverage Sorting Criterion</th>
69 </tr>
70 </thead>
71 <tbody>
72 {% for project in project_list %}
73 <tr>
74 <td>
75 <a href='{% url 'projects' %}{{ project.name }}'>{{ project.name }}</a>
76 </td>
77 <td>
78 {{ project.last_build.ran_at }}
79 </td>
80 <td class='num'>
81 {% if project.last_coverage_data.line_coverage == None %}
82 N/A
83 {% else %}
84 {{ project.last_coverage_data.line_coverage|percentage }}%
85 {% endif %}
86 </td>
87 <td class='num'>
88 {{ project.last_coverage_data.line_coverage|percentage }}
89 </td>
90 <td class='num'>
91 {% if project.last_coverage_data.line_coverage == None %}
92 N/A
93 {% else %}
94 {{ project.last_coverage_data.branch_coverage|percentage }}%
95 {% endif %}
96 </td>
97 <td class='num'>
98 {{ project.last_coverage_data.branch_coverage|percentage }}
99 </td>
100 </tr>
101 {% endfor %}
102 </tbody>
103 </table>
104</div>
105{% if project_list %}
106 {% load staticfiles %}
107 <script type="text/javascript" src='{% static "js/d3v3.js" %}'></script>
108 <script type="text/javascript" src='{% static "js/gauge.js" %}'></script>
109 <script type="text/javascript">
110
111 function avgLines() {
112 // project reporting list
113 var total_projects = 0;
114 var reporting_project = 0;
115 var line_sum = 0;
116 var hit_sum = 0;
117 var total_sum = 0;
118 var taken_sum = 0;
119
120 {% for project in project_list %}
121
122 var line_count = {{ project.ci_project.line_count|default_if_none:"0" }} + 0;
123
124 total_projects = total_projects + 1;
125
126 if ( line_count > 0) {
127 reporting_project = reporting_project + 1;
128 }
129
130 line_sum = line_sum + line_count;
131 hit_sum = hit_sum + {{ project.ci_project.hit_count|default_if_none:"0" }} + 0;
132 total_sum = total_sum + {{ project.ci_project.total_count|default_if_none:"0" }} + 0;
133 taken_sum = taken_sum + {{ project.ci_project.taken_count|default_if_none:"0" }} + 0;
134
135 {% endfor %}
136
137
138 line_percent = (hit_sum / line_sum)
139 branch_percent = (taken_sum / total_sum)
140 proj_report_percent = (reporting_project / total_projects)
141 return [Math.round(line_percent * 100), Math.round(branch_percent * 100), Math.round(proj_report_percent * 100)]
142}
143
144 var coverage_data = avgLines()
145 var gauges = [];
146 var gauge_size = 106.5;
147 function create_coverage_gauge(name, label, value) {
148 var config =
149 {
150 size: gauge_size,
151 label: label,
152 minorTicks: 5
153 }
154
155 config.redZones = [];
156 config.redZones.push({ from: 0, to: 50 });
157
158 config.yellowZones = [];
159 config.yellowZones.push({ from: 50, to: 85 });
160
161 config.greenZones = [];
162 config.greenZones.push = ({ from: 85, to: 100 });
163
164 gauges[name] = new Gauge(name + "GaugeContainer", config);
165 gauges[name].render();
166 gauges[name].redraw(value);
167 }
168
169  function create_proj_report_gauge(name, label, value) {
170  var config =
171 {
172 size: gauge_size,
173 label: label,
174 minorTicks: 5
175 }
176
177 config.redZones = [];
178 config.redZones.push({ from: 0, to: 85 });
179
180 config.yellowZones = [];
181 config.yellowZones.push({ from: 85, to: 95 });
182
183 config.greenZones = [];
184 config.greenZones.push = ({ from: 95, to: 100 });
185
186 gauges[name] = new Gauge(name + "GaugeContainer", config);
187 gauges[name].render();
188 gauges[name].redraw(value);
189 }
190    
191
192 function init_charts() {
193 create_coverage_gauge("line", "Line", coverage_data[0])
194 create_coverage_gauge("branch", "Branch", coverage_data[1])
195 create_proj_report_gauge("reporting", "Reporting", coverage_data[2])
196 }
197
198 window.onload = init_charts()
199 </script>
200{% endif %}
201{% endblock %}
2020
=== removed file 'gaps/templates/stack_detail.html'
--- gaps/templates/stack_detail.html 2014-03-14 16:52:09 +0000
+++ gaps/templates/stack_detail.html 1970-01-01 00:00:00 +0000
@@ -1,106 +0,0 @@
1{% extends "gaps_layout.html" %}
2{% load dashboard_extras %}
3{% load gaps_extras %}
4{% load percentage %}
5{% block extra_headers %}
6<link type="text/css" href="//cdnjs.cloudflare.com/ajax/libs/nvd3/0.9/nv.d3.css" rel="stylesheet" />
7<script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/d3/3.2.2/d3.min.js"></script>
8<!-- need to switch back to cdnjs when bugs are fixed
9<script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/nvd3/0.9/nv.d3.js"></script>-->
10<script type="text/javascript" src="//6df403e3d98e2ac67ac2-180150c581869d2c4c18db9c9e3179c4.r40.cf1.rackcdn.com/nv.d3.js"></script>
11{% endblock extra_headers %}
12
13{% block content %}
14<style>
15 #line-chart svg {
16 height: 400px;
17 width: 1100px;
18 }
19</style>
20<script type='text/javascript'>
21 //<![CDATA[
22 $(document).ready(function() {
23 $(".data-table").dataTable({
24 "bPaginate": false,
25 "aaSorting": [[2, 'desc']]
26 });
27 });
28 //]]>
29</script>
30<script type="text/javascript">
31 d3.json('{% url 'gaps_api_stack' stack.name %}', function(data) {
32 nv.addGraph(function() {
33 var chart = nv.models.lineChart()
34 .width(900).height(400);
35 chart.forceY([0, 1]);
36 chart.xAxis
37 .axisLabel('Date')
38 .tickFormat(function(d){return d3.time.format('%Y%m%d')(new Date(d * 1000));})
39 chart.yAxis
40 .axisLabel('%')
41 .tickFormat(d3.format('%'))
42 d3.select('#line-chart svg').datum(data).transition().duration(500).call(chart);
43 nv.utils.windowResize(chart.update);
44 return chart;
45 });
46 });
47</script>
48<div class='grid_15'>
49 <h2>
50 Stack: {{ stack.name }}
51 </h2>
52</div>
53<div class='grid_2'>
54 <h3 class='nav-title'>
55 STACKS
56 </h3>
57 <ul class='left_nav'>
58 {% for stack in stack_list %}
59 <li>
60 <a href='{% url 'stacks' %}{{ stack }}'>{{ stack }}</a>
61 </li>
62 {% endfor %}
63 </ul>
64</div>
65 <div class="grid_13">
66 <div id="line-chart">
67 <svg></svg>
68 </div>
69 <table class='data-table basic wide'>
70 <thead>
71 <tr>
72 <th>Name</th>
73 <th>Last Build</th>
74 <th>Line Coverage</th>
75 <th>Branch Coverage</th>
76 </tr>
77 </thead>
78 <tbody>
79 {% for project in project_list %}
80 <tr>
81 <td>
82 <a href='{% url 'projects' %}{{ project.name }}/'>{{ project.name }}</a>
83 </td>
84 <td>
85 {{ project.last_build.ran_at }}
86 </td>
87 <td class='num'>
88 {% if project.last_coverage_data.line_coverage == None %}
89 N/A
90 {% else %}
91 {{ project.last_coverage_data.line_coverage|percentage }}%
92 {% endif %}
93 </td>
94 <td class='num'>
95 {% if project.last_coverage_data.branch_coverage == None %}
96 N/A
97 {% else %}
98 {{ project.last_coverage_data.branch_coverage|percentage }}%
99 {% endif %}
100 </td>
101 </tr>
102 {% endfor %}
103 </tbody>
104 </table>
105</div>
106{% endblock %}
1070
=== removed file 'gaps/templates/stack_list.html'
--- gaps/templates/stack_list.html 2014-03-14 16:52:09 +0000
+++ gaps/templates/stack_list.html 1970-01-01 00:00:00 +0000
@@ -1,113 +0,0 @@
1{% extends "gaps_layout.html" %}
2{% load dashboard_extras %}
3{% load gaps_extras %}
4{% load percentage %}
5{% block extra_headers %}
6<link type="text/css" href="//cdnjs.cloudflare.com/ajax/libs/nvd3/0.9/nv.d3.css" rel="stylesheet" />
7<script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/d3/3.2.2/d3.min.js"></script>
8<!-- need to switch back to cdnjs when bugs are fixed
9<script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/nvd3/0.9/nv.d3.js"></script>-->
10<script type="text/javascript" src="//6df403e3d98e2ac67ac2-180150c581869d2c4c18db9c9e3179c4.r40.cf1.rackcdn.com/nv.d3.js"></script>
11{% endblock extra_headers %}
12
13{% block content %}
14<style>
15 #line-chart svg {
16 height: 400px;
17 width: 1100px;
18 }
19</style>
20<script type='text/javascript'>
21 //<![CDATA[
22 $(document).ready(function() {
23 $(".data-table").dataTable({
24 "bPaginate": false,
25 "aaSorting": [[0, 'desc']]
26 });
27 });
28 //]]>
29</script>
30<script type="text/javascript">
31 d3.json('{% url 'gaps_api_stack_list' %}', function(data) {
32 nv.addGraph(function() {
33 var chart = nv.models.lineChart()
34 .width(900).height(400);
35 chart.forceY([0, 1]);
36 chart.xAxis
37 .axisLabel('Date')
38 .tickFormat(function(d){return d3.time.format('%Y%m%d')(new Date(d * 1000));})
39 chart.yAxis
40 .axisLabel('%')
41 .tickFormat(d3.format('%'))
42 d3.select('#line-chart svg').datum(data).transition().duration(500).call(chart);
43 nv.utils.windowResize(chart.update);
44 return chart;
45 });
46 });
47</script>
48<div class='grid_15'>
49 <h2>
50 {% if show_filter %}
51 Stack : {{ show_filter }}
52 {% else %}
53 All Stacks
54 {% endif %}
55 </h2>
56</div>
57<div class='grid_2'>
58 <h3 class='nav-title'>
59
60 </h3>
61 <ul class='left_nav'>
62 <li>
63 <a href='{% url 'stacks' %}'>All</a>
64 </li>
65 {% for release in release_list %}
66 <li>
67 <a href='{% url 'stacks' %}?show={{ release }} '>{{ release }}</a>
68 </li>
69 {% endfor %}
70 </ul>
71</div>
72<div class="grid_13">
73<div id="line-chart">
74 <svg></svg>
75</div>
76 <table class='data-table basic wide'>
77 <thead>
78 <tr>
79 <th>Name</th>
80 <th>Projects Reporting</th>
81 <th>Line Coverage</th>
82 <th>Branch Coverage</th>
83 </tr>
84 </thead>
85 <tbody>
86 {% for stack in stack_list %}
87 <tr>
88 <td>
89 <a href='{% url 'stacks' %}{{ stack.name }}/'>{{ stack.name }}</a>
90 </td>
91 <td class='{{ stack.percent_reporting|percent_reporting_color }}'>
92 {{ stack.percent_reporting|percentage }}
93 </td>
94 <td class='num'>
95 {% if stack.last_coverage_observation.line_coverage == None %}
96 N/A
97 {% else %}
98 {{ stack.last_coverage_observation.line_coverage|percentage }}%
99 {% endif %}
100 </td>
101 <td class='num'>
102 {% if stack.last_coverage_observation.branch_coverage == None %}
103 N/A
104 {% else %}
105 {{ stack.last_coverage_observation.branch_coverage|percentage }}%
106 {% endif %}
107 </td>
108 </tr>
109 {% endfor %}
110 </tbody>
111 </table>
112</div>
113{% endblock %}
1140
=== modified file 'gaps/urls.py'
--- gaps/urls.py 2014-03-07 21:20:19 +0000
+++ gaps/urls.py 2014-04-07 22:20:52 +0000
@@ -12,9 +12,6 @@
1212
13# You should have received a copy of the GNU Affero General Public License13# You should have received a copy of the GNU Affero General Public License
14# along with this program. If not, see <http://www.gnu.org/licenses/>.14# along with this program. If not, see <http://www.gnu.org/licenses/>.
15
16from django.conf.urls import patterns, url
17
18from django.conf.urls import (15from django.conf.urls import (
19 patterns,16 patterns,
20 url,17 url,
2118
=== modified file 'gaps/views.py'
--- gaps/views.py 2014-03-14 16:52:09 +0000
+++ gaps/views.py 2014-04-07 22:20:52 +0000
@@ -19,7 +19,7 @@
19@BreadCrumb("Stacks")19@BreadCrumb("Stacks")
20def stack_list(request):20def stack_list(request):
21 stack_list_ = CoverageStack.objects.all()21 stack_list_ = CoverageStack.objects.all()
22 t = loader.get_template('stack_list.html')22 t = loader.get_template('gaps/stack_list.html')
23 c = Context({'stack_list': stack_list_,23 c = Context({'stack_list': stack_list_,
24 'bread_crumb_trail': BreadCrumbTrail.leading_to(24 'bread_crumb_trail': BreadCrumbTrail.leading_to(
25 stack_list)})25 stack_list)})
@@ -31,7 +31,7 @@
31 stack_list = CoverageStack.objects.all()31 stack_list = CoverageStack.objects.all()
32 project_list = CoverageProject.objects.filter(32 project_list = CoverageProject.objects.filter(
33 stack__name=name)33 stack__name=name)
34 t = loader.get_template('stack_detail.html')34 t = loader.get_template('gaps/stack_detail.html')
35 c = Context({'stack': stack_,35 c = Context({'stack': stack_,
36 'stack_list': stack_list,36 'stack_list': stack_list,
37 'project_list': project_list,37 'project_list': project_list,
@@ -42,7 +42,7 @@
42@BreadCrumb("Projects")42@BreadCrumb("Projects")
43def project_list(request):43def project_list(request):
44 project_list_ = CoverageProject.objects.all()44 project_list_ = CoverageProject.objects.all()
45 t = loader.get_template('project_list.html')45 t = loader.get_template('gaps/project_list.html')
46 c = Context({'project_list': project_list_,46 c = Context({'project_list': project_list_,
47 'bread_crumb_trail': BreadCrumbTrail.leading_to(47 'bread_crumb_trail': BreadCrumbTrail.leading_to(
48 project_list)})48 project_list)})
@@ -56,7 +56,7 @@
56 coverage_datas = CoverageData.objects.filter(56 coverage_datas = CoverageData.objects.filter(
57 coverage_build__project=project_).order_by(57 coverage_build__project=project_).order_by(
58 '-coverage_build__ran_at')[:10]58 '-coverage_build__ran_at')[:10]
59 t = loader.get_template('project_detail.html')59 t = loader.get_template('gaps/project_detail.html')
60 c = Context({'project': project_,60 c = Context({'project': project_,
61 'coverage_datas': coverage_datas,61 'coverage_datas': coverage_datas,
62 'bread_crumb_trail': BreadCrumbTrail.leading_to(62 'bread_crumb_trail': BreadCrumbTrail.leading_to(
6363
=== modified file 'qa_dashboard/settings.py'
--- qa_dashboard/settings.py 2014-03-07 00:07:26 +0000
+++ qa_dashboard/settings.py 2014-04-07 22:20:52 +0000
@@ -102,7 +102,10 @@
102102
103# URL prefix for static files.103# URL prefix for static files.
104# Example: "http://media.lawrence.com/static/"104# Example: "http://media.lawrence.com/static/"
105STATIC_URL = STATIC_URL_BASE + assets_revision + '/'105
106#TODO CHANGE THIS BACK!!! WHEN WE MERGE BACK IN
107#STATIC_URL = STATIC_URL_BASE + assets_revision + '/'
108STATIC_URL = '/static/'
106109
107# URL prefix for admin static files -- CSS, JavaScript and images.110# URL prefix for admin static files -- CSS, JavaScript and images.
108# Make sure to use a trailing slash.111# Make sure to use a trailing slash.

Subscribers

People subscribed via source and target branches

to all changes: