-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.html
304 lines (273 loc) · 10.2 KB
/
index.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
295
296
297
298
299
300
301
302
303
304
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>R SVN build status</title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<link rel="stylesheet" href="https://cran.r-project.org/web/CRAN_web.css">
<style>
.loader {
border: 0.2em solid #f3f3f3; /* Light grey */
border-top: 0.2em solid #3498db; /* Blue */
border-radius: 50%;
width: 0.6em;
height: 0.6em;
animation: spin 1.5s linear infinite;
margin: 0.1em;
}
@keyframes spin {
0% { transform: rotate(0deg); }
100% { transform: rotate(360deg); }
}
td {
padding: 2px;
}
</style>
<!--
<script type="text/javascript" charset="utf8" src="https://cdn.datatables.net/1.10.20/js/jquery.dataTables.js"></script>
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/1.10.20/css/jquery.dataTables.css">
-->
<script type="module">
/* These link to the mjs files below */
//import { Octokit } from "https://esm.sh/@octokit/rest@18.5.6?bundle&target=es2015";
//import { createAppAuth } from 'https://esm.sh/@octokit/auth-app@6.0.0?bundle&target=es2015';
/* Devel */
//import { Octokit } from "https://esm.sh/v131/@octokit/rest@18.5.6/es2015/rest.bundle.mjs";
//import { createAppAuth } from 'https://esm.sh/v131/@octokit/auth-app@6.0.0/es2015/auth-app.bundle.mjs';
/* Production */
import { Octokit } from "https://contributor.r-project.org/svn-dashboard/js/rest.bundle.mjs";
import { createAppAuth } from 'https://contributor.r-project.org/svn-dashboard/js/auth-app.bundle.mjs';
// GitHub App key: https://github.com/organizations/r-devel/settings/apps/svn-dashboard-front-end-auth
var appkey = "LS0tLS1CRUdJTiBQUklWQVRFIEtFWS0tLS0tCk1JSUV2UUlCQURBTkJna3Foa2lHOXcwQkFRRUZBQVNDQktjd2dnU2pBZ0VBQW9JQkFRRFh1RnBlOTFoQlFocGoKZTFUYloweHlMNHh2cWl4Q0lRaXZsaXJ1YjRqSFZkdHNhTnVsYThWL0ZCRzM5dHpCeUhtemUwNWN6Qmdpakl3RAoxZG85UjVnL1lqS0R6OENtT2xSNTMrdGNiWXVLWlY4Q3Vub2JBMTdLNUo0QkdLUyswcExwRUJ4M2tyWER4RUtKCnBDKzgrTU5ZWkFaV0dlaHl1emtXQllkQlhRR09OM0x5MVZFaUk1S3hLa29raUwvRkxrTTJrOHg2WlVrWVRRUXUKeDkrcHcxdTJmRFZtV3g3YmxqaFNuSDRRYUR2Zk8xcjMxcytZckhtd3lqL2ZxS0REc0FuZHZTQVhBQlNHd0k1Uwo0QVdhWk0xR0x6MlY0QmRWTUtRenMra0tESlhwUkU1TTdzaU9CK1djNHdjend0Vncxa2xCazBkUjJ5aXZyNXp1Cm1kcENrVVVqQWdNQkFBRUNnZ0VBUStIWVZsQUJicSt0ZkNhZ1FsYV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uODFEM2lmNnpFdVh2K0kKQ2tvYmM0NDFybzVXZitKTDVXSlNBYk4xbHhUUXpFc1hBdUpDV0xseG96ZUt2bDIxcmlkR0VLNDVBb0dBTkh6MQpWRDJxTzFETEthTXV2eXJ2Rk5jNDRiWi9iTHFWSGVMYVBLblVzbkNONnpIcHl4YkVKSFpFVC9PL2pOMVRhenZlCkZyaEREMnl5aUhhQlMxSDh3T3pNQXNIRzFFUzN4clo0VTNSeXQ2dElrNmNmY2pyc3QwcHZkQi9oRzBJUnlsc3kKV1k4Ny85cDFGelVrK3YvVzdwdVgvVC8zMWpnNmJhSXA2djVPaklrQ2dZRUFoa042R2k3Q3pvTGM5dWxSUjZkcQpJbUZxQ0M5aHl6TU1JaHZwbWRtRVZwSlJkMDVhYTljZnFnRldFaU1rZkFXdEt3SFNIaWMyUXFCbUdQbzBtbWhOCjlzeDNmVjlKbG54c3hOcHNjR2syeityRkU1dDV5VVlhOW5BN1F5QXIwQVl4YStSalNCdCtYaEwvdWxSNDYzQm4KekovOGQ0dktyTjVVRmNJL3Jta0lzakU9Ci0tLS0tRU5EIFBSSVZBVEUgS0VZLS0tLS0K";
const appOctokit = new Octokit({
authStrategy: createAppAuth,
auth: {
appId: 382614,
privateKey: atob(appkey),
installationId: 41222863
}
});
appOctokit.auth({type: "installation"}).then(function(x){
window.octokit = new Octokit({
auth: x.token
});
init_page();
}).catch(function(err){
console.log("Failed to authenticate with key: " + err);
})
function sort_jobs(jobs){
var out = {};
jobs.forEach(function(x){
//todo: what about duplicate runs?
//for backward compatibility: mingw32 used to be called just '32'
var key = x.name || "";
out[key.replace('mingw', '')] = x;
});
return out;
}
function sort_artifacts(artifacts){
var out = {};
artifacts.forEach(function(x){
out[x.name] = x;
});
return out;
}
function nightly_link(run_id, artifact_id){
return 'https://nightly.link/r-devel/r-svn/suites/' + run_id + '/artifacts/' + artifact_id;
}
function fill_run(run, tr){
const commit = run.head_commit;
const id = commit.id;
const author = commit.author.name;
const rawmsg = commit.message.split('\n\ngit-svn-id');
const message = rawmsg[0].substr(0, 60);
const revision = rawmsg.length > 1 ? rawmsg[1].match(/trunk@([0-9]*)/)[1] : "";
const date = new Date(commit.timestamp);
const link = $('<a href="https://github.com/r-devel/r-svn/commit/'+id+'"></a>').append($('<i></i>').text(message));
tr.add_cell(date.toISOString().slice(0, 10));
tr.add_cell(revision);
tr.add_cell(link);
tr.add_cell(author);
}
function set_text(result){
switch(result){
case 'success':
return 'OK';
case 'failure':
return 'FAIL';
case 'in_progress':
return '<div class="loader"></div>';
}
return result;
}
function set_color(result){
switch(result){
case 'success':
return 'black';
case 'failure':
return 'red';
}
return 'gray';
}
function fill_jobs(x, y, tr, run_id){
const jobs = sort_jobs(x);
const artifacts = sort_artifacts(y);
const matrix = [
'Linux (gcc, debian:stable)',
'Linux (gcc, debian:testing)',
'Linux (clang, debian:stable)',
'Linux (clang, debian:testing)',
'MacOS (macOS-13)',
'MacOS (macOS-14)',
'Windows (check)',
'Windows (installer)'
];
if(run_id < 4158994618){
matrix[5] = 'Windows (ucrt64)';
matrix[6] = 'Windows Installer';
}
matrix.forEach(function(name){
if(name === 'MacOS (macOS-13)' && jobs['MacOS']){
name = 'MacOS'
}
if(jobs && jobs[name] && jobs[name].status){
const job = jobs[name];
const result = job.conclusion || job.status;
const a = $("<a />").
append(set_text(result)).
attr('href', job.html_url).
attr('target', '_blank').
css('color', set_color(result));
if(result != 'in_progress' && result != 'queued'){
a.click(function(e){
e.preventDefault();
var text = "Loading build log for " + name + '...'
var win = window.open("", '_blank');
win.document.write(text);
octokit.actions.downloadJobLogsForWorkflowRun({
owner : "r-devel",
repo: "r-svn",
job_id: job.id
}).then(function(x){
win.location.href = x.url;
}, function(err){
win.document.write("ERROR:" + err);
});
});
}
var td = tr.add_cell(a);
if((name === 'Windows Installer' || name === 'Windows (installer)') && artifacts['installer']){
const img = $('<img width=16 src="download-icon.png"></img>').css("padding-left", '10px');
$("<a>").append(img).attr("href", nightly_link(run_id, artifacts['installer'].id)).appendTo(td);
}
} else {
tr.add_cell(null);
}
});
//t.columns.adjust().draw();
}
function td(x){
var el = $("<td />");
if(x) el.append(x);
return el;
}
function add_row(parent){
var tr = $("<tr/>");
tr.add_cell = function(x){return td(x).appendTo(tr);}
tr.appendTo(parent);
return tr;
}
function load_more_results(page){
return octokit.actions.listWorkflowRunsForRepo({
owner: "r-devel",
repo: "r-svn",
// branch: "main",
event: "push",
page: page,
per_page: 30
}).then(({ data, headers, status }) => {
var tbody = $('tbody');
var allpromises = data.workflow_runs.map(function(run){
if(run.head_commit.message.indexOf('git-svn-id') < 0)
return;
if(run.head_branch != 'main' && run.head_branch != 'master')
return; //remove when we have enough 'main' runs to forget about 'master'
var tr = add_row($('tbody'));
fill_run(run, tr);
const p1 = octokit.actions.listJobsForWorkflowRun({
owner: "r-devel",
repo: "r-svn",
filter: "latest",
run_id: run.id
});
const p2 = octokit.actions.listWorkflowRunArtifacts({
owner: "r-devel",
repo: "r-svn",
run_id: run.id
});
Promise.allSettled([p1,p2]).then(promises => {
const jobs = promises[0].value.data;
const artifacts = promises[1].value.data;
fill_jobs(jobs.jobs, artifacts.artifacts, tr, run.id);
const github_link = $("<a />").
append('<img width=16 src="GitHub-Mark-32px.png"></img>').
attr('href', run.html_url).
css('padding', '0px 5px').
attr('target', '_blank');
tr.add_cell(github_link);
});
});
$('body,html').animate({ scrollTop: $('body').height() }, 800);
return Promise.allSettled(allpromises);
});
}
function init_page(){
var pagenum = 0;
function load_one_page(){
load_more_results(++pagenum).then(function(){
$(".morelink").toggle();
});
};
$("a.morelink").click(function(e){
e.preventDefault();
$(".morelink").toggle();
load_one_page();
});
load_one_page();
};
</script>
</head>
<body>
<h1>R SVN build status</h1>
<p>This is an <b>unofficial tool</b> for tracking development of the <a href="https://www.r-project.org/">R project</a>, and testing patches via our <a href="https://github.com/r-devel/r-svn#readme">GitHub SVN mirror</a>.</p>
<table border="1" cellpadding="0" cellspacing="0" summary="CRAN package check results summary" class="display" width="100%">
<thead>
<tr>
<th colspan="4">Commit</th>
<th colspan="2">GCC</th>
<th colspan="2">Clang</th>
<th colspan="2">MacOS</th>
<th colspan="3">Windows (mingw-w64)</th>
</tr>
<tr>
<th> Date </th>
<th> Revision </th>
<th> Message </th>
<th> Author </th>
<th> stable </th>
<th> testing </th>
<th> stable </th>
<th> testing </th>
<th> intel </th>
<th> arm64 </th>
<th> check </th>
<th> installer </th>
<th> CI </th>
</tr>
</thead>
<tbody>
</tbody>
</table>
<p align="center"><a class="morelink" style="display: none;" href="#">show more (older) revisisons</a><span class="morelink">Please wait...</span></p>
</body>
</html>