Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement back off for jobs that are continually failing #91

Merged
merged 2 commits into from
Nov 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion .test/jq.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,11 @@ for t in "$dir/"*"/test.jq"; do
td="$(dirname "$t")"
echo -n 'test: '
basename "$td"
args=( --tab -L "$dir/.." -f "$t" )
args=( --tab -L "$dir/.." )
if [ -s "$td/in.jq" ]; then
jq "${args[@]}" -n -f "$td/in.jq" > "$td/in.json"
fi
args+=( -f "$t" )
if [ -s "$td/in.json" ]; then
args+=( "$td/in.json" )
else
Expand Down
47 changes: 47 additions & 0 deletions .test/meta-queue/in.jq
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
[
# add new test cases here
# each item will be used for each architecture generated
# [ ".build.resloved", "count", "skips" ]
[ null, 1, 0 ], # buildable, tried once
[ null, 23, 0 ], # buildable, tried many but less than skip threshold
[ null, 24, 0 ], # buildable, tried many, just on skip threshold
[ null, 25, 23 ], # buildable, final skip
[ null, 25, 24 ], # buildable, no longer skipped
[ {}, 3, 0 ], # build "complete" (not queued or skipped)
empty # trailing comma
]
| map(
("amd64", "arm32v7") as $arch
| ([ $arch, .[] | tostring ] | join("-")) as $buildId
| {
# give our inputs cuter names
resolved: .[0],
count: .[1],
skips: .[2],
}
| [
{
count,
skips,
},
{
$buildId,
build: {
$arch,
resolved,
},
"source": {
"arches": {
($arch): {
"tags": ["fake:\($buildId)"]
},
},
},
},
empty # trailing comma
]
| map({ ($buildId): . })
)
| transpose
| map(add)
| { pastJobs: .[0], builds: .[1] }
246 changes: 246 additions & 0 deletions .test/meta-queue/in.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,246 @@
{
"pastJobs": {
"amd64-null-1-0": {
"count": 1,
"skips": 0
},
"arm32v7-null-1-0": {
"count": 1,
"skips": 0
},
"amd64-null-23-0": {
"count": 23,
"skips": 0
},
"arm32v7-null-23-0": {
"count": 23,
"skips": 0
},
"amd64-null-24-0": {
"count": 24,
"skips": 0
},
"arm32v7-null-24-0": {
"count": 24,
"skips": 0
},
"amd64-null-25-23": {
"count": 25,
"skips": 23
},
"arm32v7-null-25-23": {
"count": 25,
"skips": 23
},
"amd64-null-25-24": {
"count": 25,
"skips": 24
},
"arm32v7-null-25-24": {
"count": 25,
"skips": 24
},
"amd64-{}-3-0": {
"count": 3,
"skips": 0
},
"arm32v7-{}-3-0": {
"count": 3,
"skips": 0
}
},
"builds": {
"amd64-null-1-0": {
"buildId": "amd64-null-1-0",
"build": {
"arch": "amd64",
"resolved": null
},
"source": {
"arches": {
"amd64": {
"tags": [
"fake:amd64-null-1-0"
]
}
}
}
},
"arm32v7-null-1-0": {
"buildId": "arm32v7-null-1-0",
"build": {
"arch": "arm32v7",
"resolved": null
},
"source": {
"arches": {
"arm32v7": {
"tags": [
"fake:arm32v7-null-1-0"
]
}
}
}
},
"amd64-null-23-0": {
"buildId": "amd64-null-23-0",
"build": {
"arch": "amd64",
"resolved": null
},
"source": {
"arches": {
"amd64": {
"tags": [
"fake:amd64-null-23-0"
]
}
}
}
},
"arm32v7-null-23-0": {
"buildId": "arm32v7-null-23-0",
"build": {
"arch": "arm32v7",
"resolved": null
},
"source": {
"arches": {
"arm32v7": {
"tags": [
"fake:arm32v7-null-23-0"
]
}
}
}
},
"amd64-null-24-0": {
"buildId": "amd64-null-24-0",
"build": {
"arch": "amd64",
"resolved": null
},
"source": {
"arches": {
"amd64": {
"tags": [
"fake:amd64-null-24-0"
]
}
}
}
},
"arm32v7-null-24-0": {
"buildId": "arm32v7-null-24-0",
"build": {
"arch": "arm32v7",
"resolved": null
},
"source": {
"arches": {
"arm32v7": {
"tags": [
"fake:arm32v7-null-24-0"
]
}
}
}
},
"amd64-null-25-23": {
"buildId": "amd64-null-25-23",
"build": {
"arch": "amd64",
"resolved": null
},
"source": {
"arches": {
"amd64": {
"tags": [
"fake:amd64-null-25-23"
]
}
}
}
},
"arm32v7-null-25-23": {
"buildId": "arm32v7-null-25-23",
"build": {
"arch": "arm32v7",
"resolved": null
},
"source": {
"arches": {
"arm32v7": {
"tags": [
"fake:arm32v7-null-25-23"
]
}
}
}
},
"amd64-null-25-24": {
"buildId": "amd64-null-25-24",
"build": {
"arch": "amd64",
"resolved": null
},
"source": {
"arches": {
"amd64": {
"tags": [
"fake:amd64-null-25-24"
]
}
}
}
},
"arm32v7-null-25-24": {
"buildId": "arm32v7-null-25-24",
"build": {
"arch": "arm32v7",
"resolved": null
},
"source": {
"arches": {
"arm32v7": {
"tags": [
"fake:arm32v7-null-25-24"
]
}
}
}
},
"amd64-{}-3-0": {
"buildId": "amd64-{}-3-0",
"build": {
"arch": "amd64",
"resolved": {}
},
"source": {
"arches": {
"amd64": {
"tags": [
"fake:amd64-{}-3-0"
]
}
}
}
},
"arm32v7-{}-3-0": {
"buildId": "arm32v7-{}-3-0",
"build": {
"arch": "arm32v7",
"resolved": {}
},
"source": {
"arches": {
"arm32v7": {
"tags": [
"fake:arm32v7-{}-3-0"
]
}
}
}
}
}
}
81 changes: 81 additions & 0 deletions .test/meta-queue/out.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
[
{
"buildId": "arm32v7-null-1-0",
"build": {
"arch": "arm32v7",
"resolved": null
},
"source": {
"arches": {
"arm32v7": {
"tags": [
"fake:arm32v7-null-1-0"
]
}
}
},
"identifier": "fake:arm32v7-null-1-0"
},
{
"buildId": "arm32v7-null-23-0",
"build": {
"arch": "arm32v7",
"resolved": null
},
"source": {
"arches": {
"arm32v7": {
"tags": [
"fake:arm32v7-null-23-0"
]
}
}
},
"identifier": "fake:arm32v7-null-23-0"
},
{
"buildId": "arm32v7-null-25-24",
"build": {
"arch": "arm32v7",
"resolved": null
},
"source": {
"arches": {
"arm32v7": {
"tags": [
"fake:arm32v7-null-25-24"
]
}
}
},
"identifier": "fake:arm32v7-null-25-24"
}
]
{
"arm32v7-null-1-0": {
"count": 2,
"skips": 0,
"identifier": "fake:arm32v7-null-1-0"
},
"arm32v7-null-23-0": {
"count": 24,
"skips": 0,
"identifier": "fake:arm32v7-null-23-0"
},
"arm32v7-null-24-0": {
"count": 24,
"skips": 1,
"identifier": "fake:arm32v7-null-24-0"
},
"arm32v7-null-25-23": {
"count": 25,
"skips": 24,
"identifier": "fake:arm32v7-null-25-23"
},
"arm32v7-null-25-24": {
"count": 26,
"skips": 0,
"identifier": "fake:arm32v7-null-25-24"
}
}
2
Loading