Repository navigation
Conversation
… backoff The update path force-reset the PR branch to the default branch HEAD before committing the bumped files. That left the PR with zero commits for a moment and GitHub auto-closed it, while the script still reported UPDATED. Existing PRs are now brought up to date by merging the default branch into the PR branch; on a merge conflict the branch is recreated and a fresh PR opened. The script also verifies the PR is still open before reporting success. Repos that fail (typically during a GitHub outage, as writes via the Contents API are the first to go) are now retried in passes with exponential backoff: up to 10 passes, starting at 2 s and doubling up to 5 min, configurable via NOTIFY_RETRY_* env vars. Only failed repos are retried and files already bumped on the branch are not rewritten, so partial progress is kept. Other fixes along the way: - gh errors are no longer discarded; the last stderr line is printed next to each FAIL so logs show the actual API response - a failed `gh pr create` was reported as CREATED because stderr was captured into the URL variable - NOTIFY_REPOS env var / `repos` workflow_dispatch input to process an explicit list of repos, e.g. to re-run only the ones that failed Adds a gh CLI mock and BATS tests covering the create/update/retry paths. Claude-Session: https://claude.ai/code/session_015HbhiukLQv71hkruK31fyT
The action-refs BATS suite rewrites every ref to @main in its teardown; those changes slipped into the previous commit. No functional change. Claude-Session: https://claude.ai/code/session_015HbhiukLQv71hkruK31fyT
NOTIFY_RETRY_MAX_ATTEMPTS, NOTIFY_RETRY_BASE_DELAY and NOTIFY_RETRY_MAX_DELAY are read from repository variables so they can be changed without a merge. Script defaults apply when the variables are not set. Claude-Session: https://claude.ai/code/session_015HbhiukLQv71hkruK31fyT
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes two problems in the consumer-repo notification script observed during the 2.6.0 rollout.
1. Updating an existing bump PR auto-closed it. The update path force-reset the PR branch to the default branch HEAD before committing the bumped files. For a moment the PR had zero commits and GitHub auto-closed it, while the script still reported
UPDATED. In the last two runs 12 of 13 "updated" PRs ended up closed with a stale title, and the next run then opened duplicate PRs.POST /repos/{repo}/merges), so the PR never loses its commits.OPENbefore reportingUPDATED.2. No resilience to GitHub outages. During a GitHub incident (degraded Git operations) 22 repos failed in a row because Contents API writes were rejected, and the run had no way to recover.
NOTIFY_RETRY_MAX_ATTEMPTS,NOTIFY_RETRY_BASE_DELAY,NOTIFY_RETRY_MAX_DELAY(already set to the defaults), so it can be changed without a merge.Also
FAILso logs show the actual API response.gh pr createwas reported asCREATEDbecause stderr was captured into the URL variable.NOTIFY_REPOSenv var andreposinput onworkflow_dispatchto process an explicit list of repos, e.g. to re-run only the ones that failed.Test plan
ghCLI mock: backoff schedule, create path, leftover-branch reuse, merge-based update without force-reset, conflict → recreate, closed PR →FAIL, no rewrite of already-bumped files, retry until success, give up after max attempts, only failed repos retried, self repo skipped, dry run. Fullbats -r .passes (140 tests).actionlinton the workflow.--dry-runagainst two real consumer repos (one create, one update) produced the expected plan.workflow_dispatchwith thereposinput for the repos that failed in the 2.6.0 run.🤖 Generated with Claude Code
https://claude.ai/code/session_015HbhiukLQv71hkruK31fyT