Repository navigation
fix: release rollback and retry exit codes - #501
Merged
Merged
Conversation
The `if "$@"; then return 0; fi; rc=$?` pattern always set rc=0 because bash's `if` compound command exits 0 when the condition fails and there is no `else` clause. Replace with `"$@" && return 0`. Refs: #500
Branch protection rulesets reject force-push on release/* branches, causing silent rollback failures. Create a revert commit via the Git Data API (fast-forward update) instead. Refs: #500
There was a problem hiding this comment.
Pull request overview
Fixes CI reliability around retries and release rollback on protected branches by ensuring the retry helper propagates failures correctly and by changing rollback to use a fast-forward commit update instead of force-push.
Changes:
- Fix
retryhelper implementations to return the failed command’s final non-zero exit status after exhausting retries. - Update
release.ymlrollback to create a “revert” commit via the Git Data API and advance the branch ref (no force-push). - Add BATS regression coverage for
retryexit-code propagation and mirror changelog/README version state.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
.github/actions/setup-env/action.yml |
Fixes retry() to capture/return the failing command’s exit code. |
.github/workflows/sync-main-to-dev.yml |
Aligns the inlined retry() helper behavior with the fixed pattern. |
.github/workflows/release.yml |
Replaces force-push rollback with Git API commit+ref update flow. |
tests/bats/fixtures/retry_helper.bash |
Adds a test fixture copy of retry() for BATS coverage. |
tests/bats/retry.bats |
Adds regression tests for retry exit codes and messaging. |
CHANGELOG.md |
Adds Unreleased “Fixed” entry for #500 and reverts 0.3.2 heading to TBD. |
assets/workspace/.devcontainer/CHANGELOG.md |
Mirrors the same Unreleased/TBD changes for the workspace template. |
README.md |
Rolls “Latest Version” back to 0.3.1 to match the revert state. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Description
Fixes #500: the CI
retryhelper now returns the failed command’s non-zero exit status after exhausting retries (so jobs fail correctly). Release workflow rollback no longer force-pushes; it creates a revert commit via the Git API so it works with branch protection onrelease/*. Includes BATS coverage forretryexit-code behavior. The branch also containsrevert: undo finalize release 0.3.2so the release line can be corrected before re-finalizing.Type of Change
fix-- Bug fixfeat-- New featuredocs-- Documentation onlychore-- Maintenance task (deps, config, etc.)refactor-- Code restructuring (no behavior change)test-- Adding or updating testsci-- CI/CD pipeline changesbuild-- Build system or dependency changesrevert-- Reverts a previous commitstyle-- Code style (formatting, whitespace)Modifiers
!) -- This change breaks backward compatibilityChanges Made
.github/actions/setup-env/action.yml—retrypropagates the last non-zero exit code when all attempts fail..github/workflows/release.yml— Rollback uses a GitHub API revert commit instead of force-push; aligns with protectedrelease/*branches..github/workflows/sync-main-to-dev.yml— Inlineretryhelper matchessetup-env: run"$@" && return 0so the command’s exit code is observed (same pattern as the fixedretryinsetup-env).CHANGELOG.md—## Unreleased/ Fixed entry for #500.assets/workspace/.devcontainer/CHANGELOG.md— Same entry mirrored for the workspace template changelog.README.md— “Latest Version” rolled back to 0.3.1 with the revert of finalize 0.3.2 (will move forward again when the release is re-finalized).tests/bats/fixtures/retry_helper.bash— Fixture shellretrymatching CI behavior for tests.tests/bats/retry.bats— BATS tests asserting exit-code propagation fromretry.Commits (vs
origin/release/0.3.2):57789cctest: BATS for retry exit codes;fcad7effix(ci): propagate retry exit code;4c7a4a4fix(ci): revert-commit rollback;e033833revert: undo finalize release 0.3.2;e307f57docs: changelog for retry and rollback fixes.Changelog Entry
(Same Fixed block appears under
## Unreleasedinassets/workspace/.devcontainer/CHANGELOG.md.)Testing
just test)Manual Testing Details
N/A — workflow and shell-helper behavior; rely on CI and BATS. Re-run
just testlocally before merge if the full suite was not green in your environment.Checklist
docs/templates/, then runjust docs)CHANGELOG.mdin the[Unreleased]section (and pasted the entry above)Additional Notes
release/0.3.2(hotfix PR), notdev. Remoterelease/0.3.2may already show a dated## [0.3.2](…)heading; this branch includes a revert of finalize so the corrected changelog and workflows can land before a new finalize.release/*, some teams fold fixes into## [0.3.2] - TBDinstead of## Unreleased. Confirm with release owners whether to move the #500 bullets under the version section before merge.Refs: #500