Skip to content

Retry the site redeploy request when GitHub returns a server error - #190

Open
marcosqlbi wants to merge 1 commit into
mainfrom
fix/site-redeploy-retry
Open

marcosqlbi wants to merge 1 commit into
mainfrom
fix/site-redeploy-retry

Conversation

@marcosqlbi

Copy link
Copy Markdown
Collaborator

When 1.7.6 was released, the redeploy job asked for a deployment from main and GitHub answered HTTP 502: Server Error. The job failed after one attempt, nothing deployed, and the site kept offering 1.7.5 until Publish site was run by hand (run 277).

The 502 had still created a run, 276, with no jobs. It stays queued, and GitHub refuses both cancel and force-cancel on it. It did not block run 277.

What changes

The step that runs gh workflow run publish-site.yml now tries up to five times when the error is an HTTP 5xx, waiting 15, 30, 45, and 60 seconds between attempts, with a warning on each retry. Any other error fails at once, because asking again would get the same answer. After five server errors the job fails with a message saying to run Publish site on main with the tag by hand.

A retry after a 5xx can start a second deployment if the first request did go through. That is harmless, because the pages concurrency group runs deployments one at a time, and both deploy main for the same tag.

Testing

The step's script was extracted from the YAML and run under bash -e -o pipefail, the shell GitHub uses, with a fake gh:

  • Success on the first call: exits 0 after one call.
  • 502, 502, then success: exits 0 after three calls.
  • 422: exits 1 after one call, with no retry.
  • 502 five times: exits 1 after five calls, with the error annotation.

The real path only runs on the next release.

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant