forked from cms-sw/topic-collector
-
Notifications
You must be signed in to change notification settings - Fork 0
/
buildrequests.html
189 lines (179 loc) · 7.24 KB
/
buildrequests.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
<body>
<div class="navbar navbar-inverse navbar-fixed-top">
<div class="navbar-inner">
<div class="container-fluid">
<a class="brand" href="http://cms-sw.github.com/cmssw/faq.html">CMS Topic Collector</a>
<ul class="nav">
<li><a href=".">Pull requests</a></li>
<li><a href="externals">Externals</a></li>
<li class="active"><a href="buildrequests">Build requests</a></li>
</ul>
<ul class="nav pull-right">
<li>
<form id="formbox" class="navbar-search pull-left" target="_blank" action="https://github.com/cms-sw/cmssw/search">
<input name="q" type="text" class="search-query" placeholder="Search"/>
</form>
<li>
<li class="dropdown">
<a id="userInfo" class="dropdown-toggle" data-toggle="dropdown" href="#"></a>
<ul class="dropdown-menu" role="menu" aria-labelledby="dLabel">
<li id="userCern"></li>
<li id="userGithub"></li>
<li class="divider"></li>
<li><a href="https://login.cern.ch/adfs/ls/?wa=wsignout1.0">Logout</a></li>
</ul>
</li>
<li><a href="http://cms-sw.github.com/cmssw/faq.html">Help</a></li>
</ul>
</div>
</div>
</div>
<div class="row-fluid">
<div class="container-fluid">
<div id="myAlert" class="span12" style='padding: 15px;'></div>
</div>
</div>
<div class="row-fluid">
<div class="container-fluid">
<div id="stateTabs" class="span12"></div>
</div>
</div>
<div class="row-fluid">
<div class="container-fluid">
<table id="buildrequests" class="table table-striped table-bordered">
<thead>
<tr><th>Id</th><th>Release</th><th>Package</th><th>Repository</th><th>Architecture</th><th>PKGTOOLS</th><th>CMSDIST</th><th>Machine</th></tr>
</thead>
<tbody>
</tbody>
</table>
</div>
</div>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js" ></script>
<script src="js/bootstrap.min.js"></script>
<script src="js/mustache.min.js"></script>
<script>
function mainLoop() {
var currentState = window.location.hash.slice(1, window.location.hash.length);
$("#stateTabs li.active").removeClass("active");
$.get("../buildrequests?state=" + currentState).done(function(d,a,b) {
$("#myAlert").html("");
var table = "";
var tableRow = "<tr><td>{{id}}</td><td>{{release}}</td>" +
"<td><a href='https://github.com/{{CMSDIST_USER_REPO}}/cmsdist/blob/{{CMSDIST_BRANCH}}/{{payload.package}}.spec'>{{payload.package}}</a></td>" +
"<td><a href='http://cmsrep.cern.ch/cmssw/{{payload.repository}}{{^payload.syncBack}}.{{payload.tmpRepository}}{{/payload.syncBack}}/'>{{payload.repository}}" +
"{{^payload.syncBack}}.{{payload.tmpRepository}}{{/payload.syncBack}}</a></td>" +
"<td><a href='http://cmsrep.cern.ch/cmssw/{{payload.repository}}/RPMS/{{architecture}}/'>{{architecture}}</a></td>" +
"<td><a href='https://github.com/{{PKGTOOLS_USER_REPO}}/pkgtools/tree/{{PKGTOOLS_BRANCH}}'>{{payload.PKGTOOLS}}</a></td>" +
"<td><a href='https://github.com/{{CMSDIST_USER_REPO}}/cmsdist/tree/{{CMSDIST_BRANCH}}'>{{payload.CMSDIST}}</a></td>" +
"<td>{{#url}}<a href='{{url}}'>{{/url}}{{#machine}}{{machine}} (pid:{{pid}}){{/machine}}{{#url}}</a>{{/url}}</td>";
for (var i = 0; i < d.length; ++i)
{
var pkgtools = d[i]["payload"]["PKGTOOLS"];
d[i]["PKGTOOLS_USER_REPO"] = function() {
return function() {
if (pkgtools.indexOf(":") === -1)
return "cms-sw";
return pkgtools.split(":")[0];
}
}
d[i]["PKGTOOLS_BRANCH"] = function() {
return function(val) {
if (pkgtools.indexOf(":") === -1)
return pkgtools;
return pkgtools.split(":")[1];
}
}
var cmsdist = d[i]["payload"]["CMSDIST"];
d[i]["CMSDIST_USER_REPO"] = function() {
return function() {
if (cmsdist.indexOf(":") === -1)
return "cms-sw";
return cmsdist.split(":")[0];
}
}
d[i]["CMSDIST_BRANCH"] = function() {
return function() {
if (cmsdist.indexOf(":") === -1)
return cmsdist;
return cmsdist.split(":")[1];
}
}
table += Mustache.render(tableRow, d[i]);
}
$("#buildrequests tbody").html(table);
$("#stateTabs li.active").removeClass("active");
$("#li_" + currentState).addClass("active");
}).error(function(d,a,b){
$("#buildrequests tbody").html("");
$("#stateTabs li.active").removeClass("active");
$("#li_" + currentState).addClass("active");
$("#myAlert").html('<div class="alert alert-error"><strong>Unable to find build requests.</strong></div></div>');
});
}
$(document).ready(function() {
$(window).bind('hashchange', mainLoop);
var userInfoPromise = $.get("api/auth").done(function(d,a,b) {
$("#formbox").attr("action", "https://github.com/" + d["repository"] + "/search");
$("#userInfo").html("Welcome " + d["firstname"] + "<b class='caret'></b>");
$("#userCern").html("<a href='#'>CERN: " + d["user"] + "</a>");
$("#userGithub").html("<a href='#'>github: " + d["githubUser"] + "</a>");
var userCategories = d["categories"];
var userCanSign = {}
var mapEgroups = {
"cms-git-core": "Core",
"cms-git-analysis": "Analysis",
"cms-git-alca": "Calibration and Alignment",
"cms-git-daq": "DAQ",
"cms-git-dqm": "DQM",
"cms-git-db": "Database",
"cms-git-docs": "Docs",
"cms-git-fastsim": "Fast Simulation",
"cms-git-simulation": "Full Simulation",
"cms-git-generators": "Generators",
"cms-git-geometry": "Geometry",
"cms-git-hlt": "HLT",
"cms-git-l1": "L1",
"cms-git-operations": "Operations",
"cms-git-reconstruction": "Reconstruction",
"cms-git-visualization": "Visualization"
}
userInfo = d;
var realCategories = [];
for (var i = 0; i < userCategories.length; ++i) {
if (userCategories[i] == "cms-git-admins")
userInfo["isAdmin"] = true;
var realName = mapEgroups[userCategories[i]];
if (!realName)
continue;
userCanSign[realName] = true;
realCategories[realCategories.length] = realName;
}
userInfo["canSign"] = userCanSign;
var categoriesSummaryTmpl = "<a>Signs for: <ul>{{#categories}}<li>{{.}}</li>{{/categories}}</ul></a>";
$("#userCategories").html(Mustache.render(categoriesSummaryTmpl, {"categories": realCategories}));
});
var currentState = "Running";
var d = ["Pending", "Running", "Failed", "Cancelled", "Completed"];
// Create the tabs
var tabs = '<div class="navbar"><div class="navbar-inner"><ul class="nav">';
var currentState = "Running";
if (window.location.hash)
currentState = window.location.hash.slice(1, window.location.hash.length);
var stateTemplate = "<li id='li_{{state}}' {{#active}}class='active'{{/active}}><a href='buildrequests#{{state}}'>{{state}}</a></li>";
for (var i = 0; i != d.length; ++i)
{
var r = d[i];
var view = {
active: currentState == r,
state: r
}
tabs += Mustache.render(stateTemplate, view);
}
tabs += "</ul></div></div>";
$("#stateTabs").html(tabs);
window.location.hash = "#" + currentState;
mainLoop();
});
</script>
</body>