Repository navigation
Add rerun-action-download-failures composite action - #15
Conversation
The runner downloads every action a job uses in "Set up job" and gives up after one attempt on a 404 from codeload.github.com, so a transient codeload error fails a PR's jobs and its gate before any step runs. This action, called from a thin workflow_run caller, re-runs the failed jobs once when every one of them carries that download error. It skips fork PRs, runs already re-run, superseded runs, and runs with any other failure. Moved from RediSearch/RediSearch#12184 so RediSearchEnterprise, which has the same PR flow and gate, can use it too. CI now also compiles the Python scripts that live next to composite actions. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Its unquoted ': ' made YAML read it as a mapping. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
|
@lerman25 could you review this? It's the shared part of RediSearch/RediSearch#12184, which automatically re-runs PR jobs that failed downloading an action in "Set up job". RSE can use it next. |
GuyAv46
left a comment
There was a problem hiding this comment.
So it’s only for PR flow? As it should not work for MQ
The superseded-run check only skipped when it found a newer run, so a list that missed this run (not in the first page, pull_requests missing) let the re-run through and could cancel a newer run. Skip unless this run is the newest for the PR, sorting by run_number rather than relying on the API's order. Also say in the description why merge-queue runs are skipped, and where gh gets its token. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
|
@GuyAv46 Right, PR runs only. It skips anything not triggered by 🤖 Addressed by Claude Code |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit e5b79a4. Configure here.
A failed rerun-failed-jobs request re-checked only the attempt before retrying, so a newer PR run started during the backoff could still be cancelled by re-running the old one. Check both the attempt and the latest run before every request. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>

What
A new
rerun-action-download-failurescomposite action. When a PR run fails, it re-runs the run's failed jobs at most once, and only if every one of them failed downloading an action in "Set up job".Before any step runs, the runner downloads every action a job references. actions/runner treats a 404 from
codeload.github.comas permanent and gives up after one attempt ("An action could not be found at the URI …" / "Failed to download archive … after 1 attempts"). So a transient codeload error fails the job and the PR's gate until someone clicks "Re-run failed jobs". No step-level retry can help, because no step has started.This moves the logic out of RediSearch/RediSearch#12184 so RediSearchEnterprise, which has the same
Pull Requestworkflow,pr-validationgate and concurrency group, can use it too. Each repo keeps a thinon: workflow_runcaller, because aworkflow_runtrigger only fires for workflows in its own repository.When it re-runs, and when it doesn't
It re-runs only when all of these hold:
gate-job(defaultpr-validation), carries the runner's download-failure annotation. The gate is excluded because it fails whenever anything it needs fails, and it is re-run along with them.Otherwise it exits successfully without re-running, for example when:
pull_request.It fails the step only when it is used outside a
workflow_runjob, or when the API keeps failing:Using it
The job-level
if:only avoids starting a runner. The action checks every condition itself. It reads the run from the caller's event, so it needs no inputs beyond an optionalgate-jobandgithub-token, and no checkout.Other changes
README.md: a row for the action.ci.yml:compileallnow also covers.github/actions, so Python scripts kept next to a composite action are checked too.Testing
workflow_id, returns the PR's runs.gh, for every skip condition and the API-error paths:After merge
This needs a
v1.x.yrelease, withv1moved to it, before RediSearch/RediSearch#12184 can switch from its temporary commit pin to@v1.🤖 Generated with Claude Code
Note
Medium Risk
The action uses
actions: writeto trigger job re-runs and must avoid re-running superseded PR runs; misclassification could re-run the wrong workflow attempt, though guards and skip-on-any-other-failure limit blast radius.Overview
Adds a reusable
rerun-action-download-failurescomposite action (plusrerun.py) for thinworkflow_runcallers: when a first-attemptpull_requestrun fails and every non-gate failed job’s check annotations match transient codeload “Set up job” download errors, it callsrerun-failed-jobsonce. It exits 0 without re-running for fork PRs, non-download failures, attempt ≥2, or runs that are no longer the PR’s latest (to avoid concurrency canceling a newer run), and re-checks “latest + attempt 1” immediately before POST and between rerun retries.README documents the action;
ci.ymlextendscompileallto.github/actionsso action-local Python is syntax-checked likescripts/.Reviewed by Cursor Bugbot for commit 2aa378b. Bugbot is set up for automated code reviews on this repo. Configure here.