Repository navigation
Description
Description
The rollback job in release.yml fails silently due to two compounding bugs:
-
retryhelper always returns exit 0. In.github/actions/setup-env/action.yml(lines 157–216), the patternif "$@"; then return 0; fi; rc=$?captures$?of thefistatement (always 0), not the command's exit code. Every workflow step that relies onretryto propagate failures is affected. -
Force-push rollback blocked by repository rulesets. The rollback step uses
gh api PATCH refs/heads/release/... -F force=true, which is rejected with HTTP 422 ("Cannot force-push to this branch — Changes must be made through a pull request"). Combined with bug 1 andcontinue-on-error: true, the failure is completely invisible — the job reports success while the finalize commit remains on the branch.
Steps to Reproduce
- Trigger the release workflow (final) on a protected
release/*branch. - Let the finalize job commit changes via API (commit-action succeeds because it creates commits, not force-pushes).
- Let a subsequent finalize step fail (in this case, "Check if publish tag already exists at finalize SHA" found a stale
0.3.2tag from a prior attempt pointing to059bde7, not the new finalize SHA10e2ff3). - Observe the rollback job: all 3
retryattempts return HTTP 422, butretryreportsexit 0each time and the script prints "Release branch rolled back to ...". - The auto-created failure issue (Release 0.3.2 failed -- automatic rollback #499) reports "Branch rollback: success" despite the branch still having the finalize commit.
Expected Behavior
retryshould return the last non-zero exit code when all attempts fail, and report the correct exit code in retry messages.- The rollback mechanism should successfully undo finalization changes on protected branches, or clearly report that rollback failed.
Actual Behavior
retryreturns 0 after exhausting all attempts.- Rollback is silently blocked by rulesets; the finalize commit
10e2ff3remains onorigin/release/0.3.2.
Environment
- OS: ubuntu-22.04 (GitHub Actions runner)
- Shell: bash
- Files:
.github/actions/setup-env/action.yml(retry helper),.github/workflows/release.yml(rollback job) - Branch protection: Repository rulesets on
release/*branches prevent force-push
Additional Context
Discovered via release run #24088003035. See #499 for the auto-created incident report.
retry bug detail: the function uses:
if "$@"; then
return 0
fi
rc=$?$? after if ... fi is always 0 (exit status of fi). Fix: "$@" && return 0; rc=$?.
Possible Solution
retry fix: replace if "$@"; then return 0; fi; rc=$? with "$@" && return 0; rc=$?.
Rollback fix — options to evaluate:
- Create a revert commit via the API instead of force-pushing (compatible with branch protection).
- Grant the release GitHub App a ruleset bypass for force-push.
- Move the tag-existence check before the finalize commit (fail earlier, nothing to rollback).
TO-DO (manual cleanup for the current release)
- Revert commit
10e2ff3be1e1e123f720e68a8fe2536d8ee0e58efromrelease/0.3.2(the orphaned finalize commit left by the failed rollback) - Delete stale tag
0.3.2if it still exists on the remote (it pointed to059bde7from a prior attempt) — appears already cleaned up, verify - Re-run the release workflow after fixes are applied
Changelog Category
Fixed
Acceptance Criteria
- TDD compliance (see .cursor/rules/tdd.mdc)
Activity
test: add BATS tests for retry exit-code propagation
fix(ci): propagate non-zero exit code from retry helper
fix(ci): replace force-push rollback with revert commit
revert: undo finalize release 0.3.2
docs: update changelog for retry and rollback fixes
refactor(ci): extract retry helper to shared script
fix(ci): use COMMIT_APP token for rollback Git API
docs: update CHANGELOG
fix(ci): remove unused RELEASE_APP token from rollback job
fix: release rollback and retry exit codes (#501)
chore: release 0.3.2 (#486)