Repository navigation
Retry the GitHub Pages deploy when the artifact is not found yet - #5060
Conversation
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]>
| - name: Deploy artifact (retry 1) | ||
| id: deployment-retry-1 | ||
| if: steps.deployment.outcome == 'failure' | ||
| uses: actions/[email protected] | ||
| continue-on-error: true |
There was a problem hiding this comment.
Severity: P3 (Low)
Add a deterministic runner test for the retry path. Parsing the YAML doesn't verify that a tolerated failure actually starts the next attempt, that a successful retry exposes its page_url, or that exhausting retries fails the caller. A stub deploy step can exercise both recovery and exhaustion without waiting for the artifact race.
Generated by Libra. React with 👍 or 👎 to give feedback on this comment.
There was a problem hiding this comment.
Not adding one here. The behaviour that matters is how the runner treats continue-on-error, outcome and step if conditions, and the repo has no workflow-runner test harness to stub deploy-pages against. I tested the gate's time check on its own. The first real deploy after merge exercises the rest.
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]>
Docs preview (local build)Handbook preview: https://docs-v3-preview.elastic.dev/elastic/docs-builder/pull/5060/ |
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]>
| STARTED: ${{ steps.deploy-start.outputs.t }} | ||
| run: | | ||
| elapsed=$(( $(date +%s) - STARTED )) | ||
| if [ "$elapsed" -ge 120 ]; then |
There was a problem hiding this comment.
Severity: P3 (Low)
The 120-second cutoff lets both the prerelease workflow and the publish action retry failures that happen after Pages has already found the artifact and started deploying. For example, a deployment that fails during status polling after 60 seconds now triggers another deployment; if all attempts fail the same way, the prerelease job holds its concurrency slot for over five minutes instead of failing after one. If artifact lookup needs a two-minute window, retry the lookup itself rather than widening the retry window for the entire deploy.
Generated by Libra. React with 👍 or 👎 to give feedback on this comment.
There was a problem hiding this comment.
This is the trade-off the cutoff has to make, and the previous review comment pulled the other way (30 seconds was too tight). The cutoff is the only signal available: deploy-pages has no output for the cause, so a step cannot retry just the lookup. Worst case, a deploy that fails at 119 seconds on every attempt holds the slot for about nine minutes (four attempts plus 85 seconds of waits). A status timeout (10 minutes) still stops after one attempt. I would rather bound that cost than risk skipping the retry for the failure this PR targets. Once actions/deploy-pages#455 ships, the retries and the gate go away. Leaving the cutoff at two minutes.
The Pages deploy in the
publishaction and inprerelease.ymlnow retries whenactions/deploy-pagescannot find the artifact it just uploaded.Affects: Deploys & previews
Prompt summary: Docs-builder hits the same GitHub Pages artifact bug as other repos. The author asks to apply the same retry fix to the docs-builder actions, and to check
elastic/docs-actionsandelastic/docs-internal-workflowsfor the same problem.Why
actions/deploy-pagescan look for the artifact before the lookup API lists it. The deploy then fails withNo artifacts named "github-pages" were found, although the upload succeeded. Re-running the job fails too, because the second upload leaves two artifacts. actions/deploy-pages#451 reports delays from under a second to about 46 seconds. The upstream fix, #455, is still open.What
Deploy retries
The artifact is uploaded once. The deploy step runs with
continue-on-error. Up to three retries follow, after waits of 5, 20 and 60 seconds. Each retry runs only if the previous attempt failed. The last retry fails the job if it also fails. A comment marks the steps for removal once #455 ships.Only fast failures retry
A missing artifact fails within a second, and
deploy-pagessets no output that names the cause. Each retry waits behind a gate step that times the previous attempt. A failure after two minutes or more, such as a Pages status timeout, fails the job at once. A slow failure therefore cannot hold the deploy concurrency slot for four attempts.Page URL output
When a retry succeeds, the first deploy step has no
page_url. Thepage_urloutput of thepublishaction and the environment URL inprerelease.ymlfall back across all four attempts.Out of scope:
elastic/docs-actionsandelastic/docs-internal-workflowsdo not use the Pages actions, so they need no change.Verify
ruby -ryaml -e 'ARGV.each { |f| YAML.load_file(f) }' actions/publish/action.yml .github/workflows/prerelease.ymlThe retry path itself is untested, because the failure is intermittent. The first real run of the
publishaction orprerelease.ymlafter merge exercises the steps. A failed first attempt shows as a tolerated failure followed by a retry.🤖 Generated with Claude Code