You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if!json="$(wget-qO- "$JOB_URL/lastSuccessfulBuild/artifact/pastFailedJobs.json")"; then
43
+
echo>&2'failed to get pastFailedJobs.json'
44
+
json='{}'
45
+
fi
46
+
jq<<<"$json" '.'
47
+
''').trim()
35
48
}
36
49
37
50
dir('meta') {
38
-
defqueueJSON=''
51
+
defqueueJson=''
39
52
stage('Queue') {
40
-
// TODO this job should export a JSON file that includes the number of attempts so far per failing buildId, and then this list should inject those values, initialize missing to 0, and sort by attempts so that failing builds always live at the bottom of the queue
41
-
queueJSON=sh(returnStdout: true, script: '''
42
-
jq -L.scripts '
43
-
include "meta";
44
-
[
45
-
.[]
46
-
|select(
47
-
needs_build
48
-
and (
49
-
.build.archas $arch
50
-
|ifenv.BASHBREW_ARCH== "gha" then
51
-
[ "amd64", "i386", "windows-amd64" ]
52
-
else [ env.BASHBREW_ARCH ] end
53
-
|index($arch)
53
+
withEnv([
54
+
'pastFailedJobsJson='+pastFailedJobsJson,
55
+
]) {
56
+
// using pastFailedJobsJson, sort the needs_build queue so that failing builds always live at the bottom of the queue
57
+
queueJson=sh(returnStdout: true, script: '''
58
+
jq -L.scripts '
59
+
include "meta";
60
+
(env.pastFailedJobsJson|fromjson) as $pastFailedJobs
0 commit comments