Skip to content

ci: the ci-duration report retries a server error on its job listing - #8744

Merged
cixzhang merged 2 commits into
meta:mainfrom
vjeux:uikit/c09-ci-duration-retry
Oct 27, 2026
Merged

cixzhang merged 2 commits into
meta:mainfrom
vjeux:uikit/c09-ci-duration-retry

Conversation

@vjeux

@vjeux vjeux commented Oct 27, 2026

Copy link
Copy Markdown
Contributor

User impact

A pull request's ci-duration check can go red for a reason no change caused: #8689's run 40555065036 failed it with Unhandled error: HttpError: Server Error. The job only reports durations (continue-on-error), but its red still reads as the pull request's.

Problem and solution fit

  • Why it fails: its one request lists every job of the run with its steps (52 jobs, 525 steps, 132 KB), and GitHub answered it 502 Server Error after 10.4 s, its gateway limit. The same request takes about 2 s at rest.
  • Why that fails the job: actions/github-script retries nothing by default, so one server error ends the step.
  • Why it matters: every affected pull request carries a red check that someone has to investigate.

The step now sets retries: 3: the action retries a server error with backoff, and the client errors it exempts (400, 401, 403, 404, 422) stay final, so a real permission or missing-run error still fails at once.

Expected behavior and authority

The report "lists each job's run time once every pull-request job has finished" (#8427, .github/scripts/ci-duration-guard.test.mjs). One transient server error should not stop it.

Smallest restoration

One with: input on one step, and a guard case. The script is unchanged; smaller pages were measured and left out (30 jobs: 1.7 s, all 52: 2.1 s).

Evidence

  • Reproduction before the change: the exact actions/github-script@v9 bundle (3a2844b7e9) ran the step's own script and inputs from main's ci.yml against a local API whose first listing answers 502: exit 1, ::error::Unhandled error: HttpError: Server Error, one request, no summary, as in CI.
  • Result after the change: the same run with this branch's ci.yml: exit 0, two requests (the 502, then the run's real 52-job listing), and the duration table written.
  • Representative unchanged path: the script, permissions, needs and continue-on-error are untouched; the guard's other 23 cases pass.
  • Regression test or other mutation-sensitive proof: the guard now requires retries of at least 1 with no server error among the exempt codes; it fails on main.

No repository test executes a step's retry: it lives in the action, not the inline script, so the forced 502 above is the behavioral proof.

Scope

  • One defect is restored.
  • Separable contradictory or unsettled tagalongs were removed or split.
  • No new public API, visual representation, default, or interaction model is hidden under the bug-fix label.
  • Public text and artifacts contain no internal Meta context.

Testing

  • pnpm exec vitest run .github/scripts/ci-duration-guard.test.mjs: 24 passed; the new case fails on main.
  • pnpm exec vitest run --project node .github/scripts: 74 files, 1385 tests.
  • CI=true pnpm lint; pnpm check:changesets.
  • The forced-502 runs of github-script 3a2844b7e9 on main's and this branch's step, above.

vjeux added 2 commits October 27, 2026 13:19
…sting

The report's one request lists every job of the run with its steps, and
GitHub answered it 502 Server Error after 10.4 s on run 40555065036;
github-script, at its default of no retries, failed the job on that one
response. The guard now requires the step to set `retries`, with no server
error among the codes the action exempts. Fails on main, where the step
sets none.
Its one request lists every job of the run with its steps; on run
40555065036 GitHub answered it 502 Server Error after 10.4 s (its gateway
limit), and github-script's default of no retries failed the report on
that one response, a red no pull request's change had caused. The step
now sets `retries: 3`: the action retries a server error with backoff,
and the client errors it exempts (400, 401, 403, 404, 422) stay final.
@vercel

vercel Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
astryx Ready Ready Preview Oct 27, 2026 8:32pm UTC

Request Review

@astracat-bot

astracat-bot Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

Review status Updated
🟢 Reviewed (for maintainers only) Oct 27, 2026, 8:51 PM UTC

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Oct 27, 2026

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Recommended for approval: retries: 3 on the ci-duration step lets one transient server error on its job listing be retried instead of turning the check red, and the new guard case fails without it. One optional nit: the "exempt client errors stay final" comments slightly overstate, since the retry plugin can still re-send a 403 or 404 back to back before the step fails (see the inline note).

[Automated review]

Comment thread .github/workflows/ci.yml
with:
# The listing is one request for every job of the run with its
# steps, and GitHub can answer it 502 at its gateway limit: retry a
# server error. The action's exempt client errors stay final.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit (optional): "stay final" may overstate. @octokit/plugin-retry's limiter re-runs any failed request while the request's retries count remains, and the exempt list only skips the backoff, so with retries: 3 a 403 or 404 here can go out four times, back to back, before the step fails. The outcome is still an immediate failure, so wording such as "exempt client errors still fail, without backoff" would be exact; the comment in ci-duration-guard.test.mjs says the same.

@cixzhang
cixzhang merged commit 6b96fc3 into meta:main Oct 27, 2026
61 checks passed
@vjeux
vjeux deleted the uikit/c09-ci-duration-retry branch October 27, 2026 21:51

This branch was successfully deployed

1 active deployment
Preview — 99ec07f1 Deployed Oct 27, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants