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
ci: retry the Actions API, and stop a dead listing reading as "no build"
Review finding on #9694: absorbing API failures fixed the 90-minute wait and
broke the two paths that do not get a second poll.
`wait-minutes: 0` decides on one answer. `visual-regression.yml` takes that
path on every /visual-tests, and create-release-branch.yml's dispatched gate
takes it on every release cut — so one 5xx reported a build that is very
likely fine as missing, and reds a required check on a brand-new release PR.
`gh` has no retry of its own; three attempts five seconds apart cover it.
The same absorption also gave `none` back a second meaning one level up: an
empty listing produced TOTAL=0 and no candidate loop, so "no run exists for
this SHA" and "every listing call failed" arrived at the same message — the
one telling the operator to label a fully-built commit `force-build`. The
comment above it asserted that could not happen.
Two flags, not one, because the scenario that reaches this is rate-limit
exhaustion, and this loop is what spends the budget: it starts partway
through a wait, when a listing has already succeeded. `LISTED` alone would
still print the force-build message. `LISTED_NOW` says whether the last poll
answered, `LISTED` whether any poll ever did, and between them the timeout
names which of the three happened.
The jobs call keeps one flag: its failure lands on `pending`, whose message
asks rather than asserts and never points at `force-build`.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
# Same blip tolerance as the listing above, but an unreachable API
@@ -218,6 +254,18 @@ runs:
218
254
if [ -n "$RUN_JSON" ]; then break; fi
219
255
220
256
if [ "$WAIT_MINUTES" -eq 0 ]; then
257
+
# The consequential half of the same ambiguity: this path has no
258
+
# second poll to correct itself, and it is the one
259
+
# visual-regression.yml takes on every /visual-tests, and
260
+
# in-world-tests.yml on every dispatch — which is how
261
+
# create-release-branch.yml gates a release cut. Reporting an
262
+
# unanswered API as a missing build sends the operator after a
263
+
# build that is very likely fine. One poll, so LISTED and
264
+
# LISTED_NOW are the same bit here.
265
+
if [ "$LISTED" = "0" ]; then
266
+
echo "::error::Could not list build-unitycloud.yml runs for ${HEAD_SHA:0:7} — the GitHub Actions API did not answer. Nothing was learned about the build, so this says nothing about whether one exists: re-run this job."
267
+
exit 1
268
+
fi
221
269
echo "::error::No Unity Cloud Build of ${HEAD_SHA:0:7} with all of [${BUILD_LEGS}] green. Is the build still in progress, or did it fail?"
222
270
exit 1
223
271
fi
@@ -236,19 +284,43 @@ runs:
236
284
fi
237
285
if [ "$SECONDS" -ge "$DEADLINE" ]; then
238
286
echo "::error::Gave up after ${WAIT_MINUTES}m waiting for a build of ${HEAD_SHA:0:7} with [${BUILD_LEGS}] green."
239
-
# With the case above carved out, `none` is only reachable when no
287
+
# With the cases above carved out, `none` means the candidate loop
288
+
# never reached a verdict, which happens two ways: no
240
289
# pull_request or push run of build-unitycloud.yml exists for the
241
-
# SHA at all — a run that started and built nothing is `nomatrix`.
242
-
# Labelling and pushing are both trigger types of that workflow, so
243
-
# either queues the run this commit never got.
290
+
# SHA at all — a run that started and built nothing is `nomatrix`
291
+
# — or the last poll's listing went unanswered, leaving the same
292
+
# empty set with nothing learned. Only the first is a build
293
+
# problem: labelling and pushing are both trigger types of that
294
+
# workflow, so either queues the run this commit never got,
295
+
# whereas a `force-build` label does nothing whatsoever for an API
296
+
# that is not replying.
244
297
if [ "$STATE" = none ]; then
245
-
echo "::error::No build was ever queued for this commit. Label the PR \`force-build\`, or push a change under Explorer/, then re-run this job."
298
+
if [ "$LISTED_NOW" = "0" ]; then
299
+
# The wait ended blind, so nothing here establishes that no
300
+
# build exists. LISTED then separates an outage that lasted
301
+
# the whole wait from one that began during it, because the
302
+
# remedies differ: a spent rate-limit budget refills on its
303
+
# own hour boundary and needs no page checked.
304
+
if [ "$LISTED" = "0" ]; then
305
+
echo "::error::The GitHub Actions API never answered a single run listing in ${WAIT_MINUTES}m, so no build was ever looked at. Check https://www.githubstatus.com, then re-run this job."
306
+
else
307
+
echo "::error::The GitHub Actions API stopped answering run listings partway through the wait, so whether a build exists is unknown — most likely this token's hourly request budget is spent. Re-run this job after the hour rolls over."
308
+
fi
309
+
else
310
+
echo "::error::No build was ever queued for this commit. Label the PR \`force-build\`, or push a change under Explorer/, then re-run this job."
311
+
fi
246
312
else
247
313
echo "::error::Re-run this job once the build is green."
0 commit comments