/
targeted.html
298 lines (270 loc) · 14 KB
/
targeted.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<!-- This Source Code Form is subject to the terms of the Mozilla Public
- License, v. 2.0. If a copy of the MPL was not distributed with this
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
<HTML>
<HEAD>
<title>Targeted - FxOS</title>
<script type="text/javascript">function importScript(dep, func){if (func!==undefined) func();}</script>
<script type="text/javascript" src="modevlib/Settings.js"></script>
<script type="text/javascript" src="modevlib/rest/BugzillaClient.js"></script>
<link type="text/css" rel="stylesheet" href="js/blockers.css"/>
<script type="text/javascript" src="modevlib/util/aUtil.js"></script>
<script type="text/javascript" src="modevlib/util/aString.js"></script>
<script type="text/javascript" src="js/owners.js"></script>
<script type="text/javascript" src="modevlib/collections/aMatrix.js"></script>
<script type="text/javascript" src="modevlib/qb/Qb.aggregate.js"></script>
<script type="text/javascript" src="modevlib/qb/Qb.column.js"></script>
<script type="text/javascript" src="modevlib/qb/Qb.cube.js"></script>
<script type="text/javascript" src="modevlib/qb/Qb.analytic.js"></script>
<script type="text/javascript" src="modevlib/gui/Filter.js"></script>
<script type="text/javascript" src="modevlib/gui/ComponentFilter.js"></script>
<script type="text/javascript" src="modevlib/gui/PartitionFilter.js"></script>
<script type="text/javascript" src="modevlib/qb/aCompiler.js"></script>
<script type="text/javascript" src="modevlib/collections/aArray.js"></script>
<script type="text/javascript" src="modevlib/util/aParse.js"></script>
<script type="text/javascript" src="modevlib/collections/aRelation.js"></script>
<script type="text/javascript" src="modevlib/math/aMath.js"></script>
<script type="text/javascript" src="modevlib/MozillaPrograms.js"></script>
<script type="text/javascript" src="modevlib/util/CNV.js"></script>
<script type="text/javascript" src="modevlib/charts/aColor.js"></script>
<script type="text/javascript" src="modevlib/util/aTemplate.js"></script>
<script type="text/javascript" src="lib/jquery.js"></script>
<script type="text/javascript" src="modevlib/util/aDate.js"></script>
<script type="text/javascript" src="modevlib/collections/aQueue.js"></script>
<script type="text/javascript" src="modevlib/collections/aSet.js"></script>
<script type="text/javascript" src="modevlib/debug/aException.js"></script>
<script type="text/javascript" src="lib/jquery-ui/js/jquery-ui-1.10.2.custom.js"></script>
<script type="text/javascript" src="lib/jquery.numberformatter.js"></script>
<script type="text/javascript" src="lib/jstree/jquery.jstree.js"></script>
<script type="text/javascript" src="modevlib/qb/Qb.domain.js"></script>
<script type="text/javascript" src="modevlib/util/aDuration.js"></script>
<link type="text/css" rel="stylesheet" href="lib/jquery-ui/css/start/jquery-ui-1.10.2.custom.css">
<script type="text/javascript" src="modevlib/aFormat.js"></script>
<script type="text/javascript" src="modevlib/gui/TeamFilter.js"></script>
<script type="text/javascript" src="lib/jquery.ba-bbq/jquery.ba-bbq.js"></script>
<script type="text/javascript" src="modevlib/debug/aLog.js"></script>
<script type="text/javascript" src="modevlib/threads/thread.js"></script>
<script type="text/javascript" src="modevlib/gui/ProgramFilter.js"></script>
<script type="text/javascript" src="modevlib/util/aTimer.js"></script>
<script type="text/javascript" src="modevlib/rest/Rest.js"></script>
<script type="text/javascript" src="modevlib/aLibrary.js"></script>
<script type="text/javascript" src="modevlib/rest/ElasticSearch.js"></script>
<script type="text/javascript" src="modevlib/Bugzilla.js"></script>
<script type="text/javascript" src="modevlib/math/Stats.js"></script>
<script type="text/javascript" src="modevlib/qb/MVEL.js"></script>
<link type="text/css" rel="stylesheet" href="lib/jquery-linedtextarea/jquery-linedtextarea.css">
<script type="text/javascript" src="modevlib/qb/Qb.js"></script>
<script type="text/javascript" src="lib/jquery-linedtextarea/jquery-linedtextarea.js"></script>
<script type="text/javascript" src="modevlib/qb/ESQuery.js"></script>
<script type="text/javascript" src="modevlib/Dimension.js"></script>
<script type="text/javascript" src="modevlib/Dimension-Bugzilla.js"></script>
<script type="text/javascript" src="modevlib/Dimension-B2G.js"></script>
<script type="text/javascript" src="modevlib/Dimension-Features.js"></script>
<script type="text/javascript" src="modevlib/gui/ProductFilter.js"></script>
<script type="text/javascript" src="modevlib/charts/aColor.js"></script>
<script type="text/javascript" src="modevlib/gui/GUI.js"></script>
<script type="text/javascript" src="js/heat.js"></script>
<link type="text/css" rel="stylesheet" href="css/menu.css">
<script type="text/javascript" src="js/main_lib.js"></script>
<style id="vakata-stylesheet" type="text/css"></style>
<style id="jstree-stylesheet" type="text/css"></style>
<link rel="stylesheet" type="text/css" media="all" href="lib/jstree/themes/default/style.css">
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-49796218-5', 'mozilla.org');
ga('send', 'pageview');
</script>
</HEAD>
<BODY style="display: none;">
<div style="overflow:hidden;">
<div id="sidebar">
<div id="description" style="width:300px;">
Counts bugs that are targeted for a specific milestone<br><br>
Each component is colored on a continuous scale (<div style="vertical-align:middle;height:15px; width:150px; background: -moz-linear-gradient(left, #009F00,#699B00, #CA7900,#954000, #A50303);position: relative;display:inline-block;"><div style="top:-3px;left:1px;color:white;position: absolute;font-size: 15px">New</div><div style="top:-3px;right:1px;color:white;position: absolute;font-size: 15px">Old</div></div>)
according to the time since the most stale one has changed. Green is new, while red is 7days or older.
If the component has unassigned members, then it is marked with a <div style="display:inline-block;bottom:0;width: 0;height: 0; border-style: solid; border-width: 0 0 15px 15px; border-color: transparent transparent #000000 transparent;"></div>
along with the count.
</div>
<hr>
<div id="last-updated" style="text-align: center;width:300px;"></div>
<hr>
<div id="filters" style="width:300px;" class="menu">
</div>
</div>
<div class="sidebar_name">
<div>Filters</div>
</div>
<div class="content" style="position:inherit;">
<div id="totals"><h3 style="display:inline-block;">FxOS Targeted</h3></div>
<div style="position:absolute;top:5px;right:10px;">
Age: <div style="vertical-align:middle;height:15px; width:150px; background: -moz-linear-gradient(left, #009F00,#699B00, #CA7900,#954000, #A50303);position: relative;display:inline-block;"><div style="top:-3px;left:1px;color:white;position: absolute;font-size: 15px">New</div><div style="top:-3px;right:1px;color:white;position: absolute;font-size: 15px">7days+</div></div><br>
Unassigned Bugs:<div style="display:inline-block;bottom:0;width: 0;height: 0; border-style: solid; border-width: 0 0 15px 15px; border-color: transparent transparent #000000 transparent;"></div><br>
Blockers w.o. Target:<div style="display:inline-block;bottom:0;width: 0;height: 0; border-style: solid; border-width: 0 15px 15px 0; border-color: transparent #000000 transparent transparent;"></div>
</div>
<div id="blockers"></div>
</div>
<div class="footer">
Source at <a href="https://github.com/mozilla/charts/blob/master/fxos/targeted.html">https://github.com/mozilla/charts/blob/master/fxos/targeted.html</a>
</div>
</div>
<script type="application/javascript">
importScript('js/main_lib.js', function () {
heatCommon();
var thread;
function createChart() {
if (thread !== undefined)
thread.kill(true);
thread = Thread.run(__createChart());
}
refresher(createChart);
var __createChart = function*() {
yield (ESQuery.loadColumns({"from": "bugs"}));
var milestoneName = GUI.state.milestone.getSelectedParts().select("name").join(" and ");
var a = Log.action("Get Bug Details", true);
try{
//PULL THE RAW DATA IT'S FASTER THAN PULLING AGGREGATES DIRECTLY FOR OBSERVED BUG QUANTITIES
var allDetails = yield(ESQuery.run({
"from": "bugs",
"select": [
"bug_id",
"modified_ts",
"keywords",
"assigned_to",
"component",
"product",
"cf_blocking_b2g",
"cf_blocking_loop",
"target_milestone"
],
"esfilter": {"and": [
Mozilla.BugStatus.Open.esfilter,
Mozilla.CurrentRecords.esfilter,
GUI.state.team.makeFilter(),
GUI.state.responsibility.makeFilter(),
{"or":[
GUI.state.milestone.makeFilter(),
Mozilla.B2G.Blockers.esfilter
]}
]}
}));
}catch(e){
yield(null); //EXIT EARLY
}//try
Log.actionDone(a);
//MARKUP WITH isTargeted
var milestoneFilter ={"and":GUI.state.milestone.getSelectedParts().map(function(p){
return p.Targeted.esfilter;
})};
var milestoneFunc = CNV.esFilter2function(milestoneFilter);
allDetails.list.forall(function(v){
v.isTargeted = milestoneFunc(v);
});
allDetails.columns.append({"name":"isTargeted"});
var components = yield(Q({
"from":allDetails,
"select": [
{"name": "show", "value": "bug_id", "aggregate": "exists"},
{"name": "count", "value": "isTargeted ? bug_id : null", "aggregate": "count"},
{"name": "bugs", "value": "isTargeted ? bug_id : null", "aggregate": "array"},
{"name": "age", "value": "isTargeted ? Date.now().subtract(Date.newInstance(modified_ts)).divideBy(Duration.DAY) : null", "aggregate": "maximum"},
{"name": "unassignedCount", "value": 'isTargeted && assigned_to=="nobody@mozilla.org" ? 1 : 0', "aggregate": "sum"},
{"name": "unassignedBugs", "value": 'isTargeted && assigned_to=="nobody@mozilla.org" ? bug_id : null', "aggregate": "array"},
{"name": "lostCount", "value": '!isTargeted ? 1 : 0', "aggregate": "sum"},
{"name": "lostBugs", "value": '!isTargeted ? bug_id : null', "aggregate": "array"}
],
"edges": [
{"name":"component", "value":'component=="general" ? component+" ("+product+")" : component'},
{"name": "project", "domain": Mozilla.B2G.Targeted.getDomain()}
]
}));
$("#blockers").html("");
components.cube.forall(function (component, i) {
var total = aMath.SUM(component.select("count"))+aMath.SUM(component.select("lostCount"));
if (total > 0) {
component.forall(function (project, j) {
project.component = components.edges[0].domain.partitions[i].name;
project.project = components.edges[1].domain.partitions[j].name;
project.total = total;
project.additionalClass = "";
});
var blockerHTML = showComponent(component, showTargeted);
$("#blockers").append(blockerHTML);
}//endif
});
var projectDomain=Mozilla.B2G.Targeted.getDomain();
projectDomain.name="project";
projectDomain.end=function(p){return p.name;};
var totals = yield(Q({
"from": allDetails,
"select": [
{"name": "show", "value": 'bug_id', "aggregate": "exists"},
{"name": "additionalClass", "value": '"project-summary"', "aggregate": "one"},
{"name": "count", "value": "isTargeted ? bug_id : null", "aggregate": "count"},
{"name": "bugs", "value": "isTargeted ? bug_id : null", "aggregate": "array"},
{"name": "age", "value": "isTargeted ? Date.now().subtract(Date.newInstance(modified_ts)).divideBy(Duration.DAY) : null", "aggregate": "maximum"},
{"name": "unassignedCount", "value": 'isTargeted && assigned_to=="nobody@mozilla.org" ? 1 : 0', "aggregate": "sum"},
{"name": "unassignedBugs", "value": 'isTargeted && assigned_to=="nobody@mozilla.org" ? bug_id : null', "aggregate": "array"},
{"name": "lostCount", "value": '!isTargeted ? 1 : 0', "aggregate": "sum"},
{"name": "lostBugs", "value": '!isTargeted ? bug_id : null', "aggregate": "array"}
],
"edges": [
{"name": "project", "domain": projectDomain}
]
}));
var lostBugs = allDetails.list.filter(function(v){return v.isTargeted==false;}).select("bug_id");
var grandTotal = {
"project": "Total",
"age": aMath.MAX(totals.cube.select("age")),
"count": aMath.SUM(totals.cube.select("count")),
"bugs": allDetails.list.filter(function(v){return v.isTargeted;}).select("bug_id"),
"unassignedCount": aMath.SUM(totals.cube.select("unassignedCount")),
"unassignedBugs": allDetails.list.filter(Mozilla.B2G.Unassigned.esfilter).select("bug_id"),
"lostCount": lostBugs.length,
"lostBugs": lostBugs,
"additionalClass": "project-summary"
};
var blockerHTML = showSummary(milestoneName+" Targeted", GUI.state.team.getSelectedParts(), totals, grandTotal, undefined, showTargeted);
$("#totals").html(blockerHTML);
addProjectClickers(components);
showLastUpdated();
};
$(document).ready(function () {
GUI.setup(
createChart,
[
{"id": "team", "name": "Teams", "type": PartitionFilter.newInstance({
"id": "Teams",
"name": "All Teams",
"dimension": Mozilla.B2G.Team,
"onlyOne": false,
"expandAll": true
})},
{"id": "milestone", "name": "Milestone", "default":"Milestone.2.1_S6", "type": PartitionFilter.newInstance({
"id": "milestone",
"name": "All Milestones",
"dimension": Mozilla.Milestone,
"treeDepth":0,
"onlyOne": false,
"expandAll": true
})},
{"id": "responsibility", "name": "Responsibility", "default": "FxOS_Team", "type": PartitionFilter.newInstance({
"id": "Responsibility",
"name": "All Bugs",
"dimension": Mozilla.B2G.Responsibility,
"onlyOne": true,
"expandAll": true
})}
],
[],
null,
false //SHOW DEFAULT FILTERS?
);
});
});
</script>
</BODY>
</HTML>