Guard release workflow jobs from upstream failures#2146
Conversation
- Skip build, publish, and release steps when earlier jobs fail or get cancelled - Keep finalize limited to stable releases only
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
| build: | ||
| name: Build ${{ matrix.label }} | ||
| needs: preflight | ||
| if: ${{ !failure() && !cancelled() }} |
There was a problem hiding this comment.
🔴 Critical workflows/release.yml:174
The if: ${{ !failure() && !cancelled() }} condition on build, publish_cli, and release allows these jobs to run when preflight is skipped — which happens on scheduled runs with no changes. When preflight is skipped, its outputs are empty, so build runs with empty version and ref values, cascading to broken releases. GitHub Actions' default success() would prevent this, but !failure() && !cancelled() is weaker and permits skipped upstream jobs. Consider adding && needs.preflight.result == 'success' to each job's if condition.
🚀 Reply "fix it for me" or copy this AI Prompt for your agent:
In file .github/workflows/release.yml around line 174:
The `if: ${{ !failure() && !cancelled() }}` condition on `build`, `publish_cli`, and `release` allows these jobs to run when `preflight` is **skipped** — which happens on scheduled runs with no changes. When `preflight` is skipped, its outputs are empty, so `build` runs with empty `version` and `ref` values, cascading to broken releases. GitHub Actions' default `success()` would prevent this, but `!failure() && !cancelled()` is weaker and permits skipped upstream jobs. Consider adding `&& needs.preflight.result == 'success'` to each job's `if` condition.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is ON. A cloud agent has been kicked off to fix the reported issue. You can view the agent here.
Reviewed by Cursor Bugbot for commit 510350a. Configure here.
| build: | ||
| name: Build ${{ matrix.label }} | ||
| needs: preflight | ||
| if: ${{ !failure() && !cancelled() }} |
There was a problem hiding this comment.
Guards allow jobs to run when preflight is skipped
High Severity
The if: ${{ !failure() && !cancelled() }} condition on build, publish_cli, and release replaces the default implicit success() check, which required all needed jobs to have succeeded. The failure() status function only returns true when a needed job has failed — it returns false when a needed job was skipped. On scheduled runs with no changes, preflight is skipped (not failed), so !failure() && !cancelled() evaluates to true and these jobs will incorrectly attempt to run with empty needs.preflight.outputs.* values. This would spin up build runners unnecessarily every 3 hours and produce confusing failures. Adding && needs.preflight.result == 'success' to each condition would preserve the intended guard while also filtering out the skipped case.
Additional Locations (2)
Reviewed by Cursor Bugbot for commit 510350a. Configure here.
There was a problem hiding this comment.
Bugbot Autofix determined this is a false positive.
All three jobs (build, publish_cli, release) already include needs.preflight.result == 'success' in their conditions, which correctly prevents execution when preflight is skipped.
You can send follow-ups to the cloud agent here.
ApprovabilityVerdict: Needs human review 1 blocking correctness issue found. Unresolved review comments identify a bug: the new guard conditions allow jobs to run when upstream jobs are skipped (not just failed), which could cause broken releases on scheduled runs. The suggested fix is to add You can customize Macroscope's approvability policy. Learn more. |


Summary
Testing
.github/workflows/release.ymldiff to confirm the newifconditions were applied tobuild,publish_cli,release, andfinalize.Note
Low Risk
Workflow-only change that tightens job gating to prevent publish/release steps from running after upstream failures or cancellations. Low risk, with the main potential impact being inadvertently skipping jobs if conditions are mis-specified.
Overview
Adds explicit
if: ${{ !failure() && !cancelled() }}guards to the release workflow’s downstream jobs (build,publish_cli, andrelease) so publish steps don’t run when an earlier job has already failed or the run was cancelled.Updates the
finalizegate to keep the stable-channel-only behavior while also requiring the overall workflow to be neither failed nor cancelled, reducing chances of partial/inconsistent release side effects.Reviewed by Cursor Bugbot for commit 510350a. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Guard release workflow jobs from upstream failures and cancellations
Adds
if: ${{ !failure() && !cancelled() }}conditions to thebuild,publish_cli, andreleasejobs in release.yml, and extends the existing condition on thefinalizejob with the same guards. Without these conditions, GitHub Actions can run downstream jobs even when upstream jobs fail or the workflow is cancelled.📊 Macroscope summarized 510350a. 1 file reviewed, 1 issue evaluated, 0 issues filtered, 1 comment posted
🗂️ Filtered Issues