Skip to content

fix: release rollback and retry exit codes - #501

Merged
c-vigo merged 9 commits into
release/0.3.2from
bugfix/500-fix-retry-and-rollback
Apr 7, 2026
Merged

c-vigo merged 9 commits into
release/0.3.2from
bugfix/500-fix-retry-and-rollback

Conversation

@c-vigo

@c-vigo c-vigo commented Apr 7, 2026

Copy link
Copy Markdown
Contributor

Description

Fixes #500: the CI retry helper 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 on release/*. Includes BATS coverage for retry exit-code behavior. The branch also contains revert: undo finalize release 0.3.2 so the release line can be corrected before re-finalizing.

Type of Change

  • fix -- Bug fix
  • feat -- New feature
  • docs -- Documentation only
  • chore -- Maintenance task (deps, config, etc.)
  • refactor -- Code restructuring (no behavior change)
  • test -- Adding or updating tests
  • ci -- CI/CD pipeline changes
  • build -- Build system or dependency changes
  • revert -- Reverts a previous commit
  • style -- Code style (formatting, whitespace)

Modifiers

  • Breaking change (!) -- This change breaks backward compatibility

Changes Made

  • .github/actions/setup-env/action.yml — retry propagates 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 protected release/* branches.
  • .github/workflows/sync-main-to-dev.yml — Inline retry helper matches setup-env: run "$@" && return 0 so the command’s exit code is observed (same pattern as the fixed retry in setup-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 shell retry matching CI behavior for tests.
  • tests/bats/retry.bats — BATS tests asserting exit-code propagation from retry.

Commits (vs origin/release/0.3.2): 57789cc test: BATS for retry exit codes; fcad7ef fix(ci): propagate retry exit code; 4c7a4a4 fix(ci): revert-commit rollback; e033833 revert: undo finalize release 0.3.2; e307f57 docs: changelog for retry and rollback fixes.

Changelog Entry

## Unreleased

### Fixed

- **Release rollback and CI `retry` exit codes** ([#500](https://github.com/vig-os/devcontainer/issues/500))
  - `retry` shell helper now propagates the command's non-zero exit code when all attempts fail
  - Release rollback creates a fast-forward revert commit via the Git API instead of force-pushing, compatible with branch protection on `release/*`

(Same Fixed block appears under ## Unreleased in assets/workspace/.devcontainer/CHANGELOG.md.)

Testing

  • Tests pass locally (just test)
  • Manual testing performed (describe below)

Manual Testing Details

N/A — workflow and shell-helper behavior; rely on CI and BATS. Re-run just test locally before merge if the full suite was not green in your environment.

Checklist

  • My code follows the project's style guidelines
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have updated the documentation accordingly (edit docs/templates/, then run just docs)
  • I have updated CHANGELOG.md in the [Unreleased] section (and pasted the entry above)
  • My changes generate no new warnings or errors
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published

Additional Notes

  • Base branch: release/0.3.2 (hotfix PR), not dev. Remote release/0.3.2 may 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.
  • Changelog convention: On release/*, some teams fold fixes into ## [0.3.2] - TBD instead of ## Unreleased. Confirm with release owners whether to move the #500 bullets under the version section before merge.

Refs: #500

c-vigo added 5 commits April 7, 2026 21:09
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
Reverts 10e2ff3 ("chore: finalize release 0.3.2"), the orphaned finalize commit left on release/0.3.2 by the broken rollback (#499). The release workflow will re-finalize when re-run.

Refs: #500
@c-vigo c-vigo self-assigned this Apr 7, 2026
@c-vigo
c-vigo requested a review from Copilot April 7, 2026 21:03

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 retry helper implementations to return the failed command’s final non-zero exit status after exhausting retries.
  • Update release.yml rollback to create a “revert” commit via the Git Data API and advance the branch ref (no force-push).
  • Add BATS regression coverage for retry exit-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.

Comment thread .github/workflows/release.yml Resolved
Comment thread tests/bats/fixtures/retry_helper.bash Resolved

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread .github/workflows/release.yml Resolved
@c-vigo
c-vigo enabled auto-merge April 7, 2026 21:29
@c-vigo
c-vigo merged commit 50a60aa into release/0.3.2 Apr 7, 2026
11 checks passed
@c-vigo
c-vigo deleted the bugfix/500-fix-retry-and-rollback branch April 7, 2026 21:32
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.

2 participants