Repository navigation
Conversation
There was a problem hiding this comment.
Note
Copilot was unable to complete this review at the selected tier due to model policy or plan restrictions.
🟡 Changes recommended
A test reliability issue remains because the Jest mock for node:timers/promises is declared after the relevant require calls in src/__tests__/internal/api-client.test.js, risking use of the real timer implementation and causing slow or flaky tests until the mock is moved earlier.
1 open issue
What changed in this PR
Adds bounded retry/backoff to artifact metadata discovery to mitigate eventual-consistency gaps when Pages upload and deployment run in the same job.
Changes:
- Retry artifact listing only for the “no match found” case (bounded attempts with backoff) while preserving existing failures for duplicates and service errors.
- Expand unit and integration tests to cover immediate visibility, delayed visibility, exhausted retries, duplicates, and service errors.
- Regenerate the bundled distribution output and update the coverage badge.
| File | Description |
|---|---|
| src/internal/api-client.js | Introduces a bounded retry/backoff wrapper for listing artifacts and uses it in getArtifactMetadata to tolerate brief post-upload visibility delays. |
| src/__tests__/internal/deployment.test.js | Updates deployment integration tests to simulate a missing-then-visible artifact and validate the new retry behavior during deployment flow. |
| src/__tests__/internal/api-client.test.js | Adds focused unit tests covering retry behavior when no artifact matches and ensuring duplicates and service errors retain existing failure paths. |
| dist/index.js | Regenerates the compiled/bundled distribution to include the updated artifact discovery retry logic. |
| coverage_badge.svg | Updates the coverage badge to reflect the latest test run after adding retry-related test cases. |
Review effort: Balanced
96efc9a to
eb6bb52
Compare
|
Data point on the retry budget, from a minimal public reproducer: https://github.com/windrover/artifact-visibility-probe Same shape as the production layout ( One caveat about the tail: in our production repo the same layout once needed ~46 s (finalize |
|
The fact that this is an issue and we have to implement such workarounds is exactly why I don't trust GitHub anymore. This should be fixed at infrastructure level, i.e. upload endpoint should not return true until the artifact is fully visible, or download should query origin if this issue is related to some kind of caching. Can someone at GitHub have this merged? Or better yet, solve this at infrastructure level? It is unacceptable that such issues sit in the pipeline for months. |
) * Move the workflows' GitHub actions to their Node 24 majors Every deploy and CI run warned that its actions target the deprecated Node 20 runtime. Bump checkout and setup-node to v7, configure-pages to v6, upload-pages-artifact to v5, deploy-pages to v5 (all three attempts) and upload-artifact to v7, in deploy.yml, ci.yml and cast-stats-check.yml. upload-pages-artifact v4+ leaves dotfiles out of the artifact; the build emits none. weekly-refresh.yml is SHA-pinned and gates pushes to main, so it is left for a separate change. Co-Authored-By: Rocky, Ed's AI pair programmer (Claude Opus 5.5) <[email protected]> * Note when to remove the deploy-pages retry Issues are disabled on this repo, so CLAUDE.md is where the retry from #79 records its exit condition: actions/deploy-pages#455 merged and released, and no more "Deploy retry" warnings. Co-Authored-By: Rocky, Ed's AI pair programmer (Claude Opus 5.5) <[email protected]> --------- Co-authored-by: Rocky, Ed's AI pair programmer (Claude Opus 5.5) <[email protected]>
- deploy-pages@v4 resolves the github-pages artifact by name once, right after upload. Since 2026-11-24 the artifact service often lists it seconds later, failing the daily deploy (actions/deploy-pages#451). - Retry only the deploy step after 5s, 20s and 60s; re-uploading would produce duplicate artifacts. Remove once actions/deploy-pages#455 ships.
…369) The `pages` job on `master` failed on both attempts of [run 45320732077](https://github.com/jmoo/drawbar/actions/runs/45320732077). The site built and `upload-pages-artifact` finalized the `github-pages` artifact; `deploy-pages`, the next step, looked it up 0.4 s later, found none, and failed: ``` Artifact github-pages.zip successfully finalized. Artifact ID 15071224386 Fetching artifact metadata for "github-pages" in this workflow run Found 0 artifact(s) Error: No artifacts named "github-pages" were found for this workflow run. ``` Nothing in the repository changed between the last deploy that passed and this one: same workflow file, same action commits. This is actions/deploy-pages#451. Reports there measure the artifact missing from the list for anything from under a second to about 46 s after the upload, and note that the action reads a different listing from the REST API, so polling the API before deploying proves nothing. ## The change - The first `deploy-pages` step may fail without failing the job. - When it fails, the job sleeps 60 s and deploys once more. That step is not allowed to fail, so a deploy that fails twice still turns the job red. - The environment URL comes from whichever step deployed. An immediate retry was reported to read the same stale list, hence the wait. One retry after a wait longer than the longest reported lag keeps this to two extra steps. The retry costs nothing when the first deploy works. Splitting upload and deploy into two jobs was the alternative. It only adds the few seconds a job takes to start, which the reported lag exceeds. ## Checks - `actionlint` passes on the workflow; `nix fmt` changes nothing. - The `pages` job runs only on `master`, so the retry itself is unverified until this merges. The retry can go once a `deploy-pages` release retries the lookup itself (actions/deploy-pages#455 is open). Release-note: none 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Fable 5.2 <[email protected]>
actions/deploy-pages looks up the uploaded artifact by name in the artifact service, whose listing can lag behind the upload, failing with 'No artifacts named "github-pages" were found'. Re-running the job does not help either, as it uploads a second artifact and then fails with 'Multiple artifacts named "github-pages"'. So retry only the deployment step, with growing delays. See also: - actions/deploy-pages#451 - actions/deploy-pages#455 - https://www.jvt.me/posts/2026/11/25/github-pages-artifacts-bug/ Co-Authored-By: Claude Opus 5.5 <[email protected]>
GitHub 工件服务在 upload 完成后有秒级到分钟级的索引延迟, deploy-pages 只查一次列表,查早了就报 No artifacts named github-pages (actions/deploy-pages#451,2026-11 起明显恶化,v5 同样中招)。 - 部署失败后按 5s/20s/60s 重试 deploy-pages,共 4 次机会 - 只重试部署、不重试上传:同一 run 再传一次会变成 Multiple artifacts named "github-pages",那条 run 就彻底救不回来 - 用 continue-on-error + 末尾兜底步骤决定 job 红绿,避免误报成功 - 上游修复 actions/deploy-pages#455 发布后可精简掉这些重试
* Retry the Pages deploy when the artifact is not found yet actions/deploy-pages can look for the artifact before it is visible and fail with "No artifacts named github-pages were found" (actions/deploy-pages#451). Re-running the job then fails on duplicate artifacts. The deploy step now retries up to three times after 5, 20 and 60 seconds, and the page URL output falls back across the attempts. Remove the retries once actions/deploy-pages#455 is released. Co-Authored-By: Claude Sonnet 5.5 <[email protected]> * Retry the Pages deploy only after a fast failure A missing artifact fails within a second. A deploy that ran for 30 seconds or more, such as a Pages status timeout, is not a lookup miss, and retrying it could hold the deploy concurrency slot for four attempts. Each retry now waits behind a gate that fails the job when the previous attempt ran that long. Co-Authored-By: Claude Sonnet 5.5 <[email protected]> * Allow two minutes before a failed Pages deploy stops retrying The gate infers the cause from elapsed time, because deploy-pages sets no output on failure. A 30 second cutoff could treat a fast lookup miss as slow after a runner pause. Two minutes sits far above a lookup miss and far below the 10 minute deploy timeout. Co-Authored-By: Claude Sonnet 5.5 <[email protected]> --------- Co-authored-by: Claude Sonnet 5.5 <[email protected]>

A successfully finalized Pages upload can briefly be absent from the artifact service listing. When upload and deployment run in the same job,
getArtifactMetadatafails immediately even though the artifact becomes visible shortly afterward.Retry the metadata lookup only when no artifact matches the requested name: five attempts with 1, 2, 4 and 8 second delays. Available artifacts return immediately. Duplicate matches and artifact service errors keep their existing failure behavior. Deployment creation is not retried, and no new inputs are introduced.
Closes #451.
Validation:
npm run allpasses on Node.js 24.22.1: formatting, ESLint, ncc build, all 37 tests and coverage badge generation.Observed consumer failure: https://github.com/escemi-tech/escemi-website/actions/runs/43214954672/attempts/1. The unchanged consumer succeeded when its failed deployment job was rerun.