Skip to content

chore(ci): use !cancelled() instead of always() for final job#461

Merged
jdx merged 1 commit intomainfrom
ci/cancelled-fix
May 3, 2026
Merged

chore(ci): use !cancelled() instead of always() for final job#461
jdx merged 1 commit intomainfrom
ci/cancelled-fix

Conversation

@jdx
Copy link
Copy Markdown
Owner

@jdx jdx commented May 3, 2026

Summary

  • Combined with the workflow's cancel-in-progress group, if: always() overrides cancellation and runs the final aggregator even on superseded commits.
  • !cancelled() still runs on upstream success or failure but skips when the workflow is cancelled — saves a runner and avoids confusing error annotations on already-superseded shas.
  • Caught by Cursor Bugbot on a sibling repo (chore(ci): add final aggregator job for branch protection endevco/pitchfork#413). Same final-aggregator pattern + cancel-in-progress: true here, so the same fix applies.

Test plan

  • CI passes on this PR

🤖 Generated with Claude Code


Note

Low Risk
Low risk CI-only change that only affects when the final aggregator job runs; no product code is modified.

Overview
Updates the CI workflow so the final aggregator job runs for upstream success/failure but does not run when the workflow is cancelled, replacing if: always() with if: ${{ !cancelled() }} to avoid consuming runners and reporting failures on superseded commits.

Reviewed by Cursor Bugbot for commit a2f7240. Bugbot is set up for automated code reviews on this repo. Configure here.

Combined with the workflow's `cancel-in-progress` group, `if: always()`
overrides cancellation and runs the aggregator even on superseded
commits. `!cancelled()` still runs on upstream success or failure but
skips when the workflow is cancelled.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
@gemini-code-assist
Copy link
Copy Markdown
Contributor

Note

Gemini is unable to generate a review for this pull request due to the file types involved not being currently supported.

@greptile-apps
Copy link
Copy Markdown

greptile-apps Bot commented May 3, 2026

Greptile Summary

Switches the final aggregator job's condition from always() to !cancelled() so that when a newer commit cancels an in-progress workflow run, the aggregator is skipped rather than consuming an extra runner and emitting misleading failure annotations on the superseded SHA. The fix is correct and well-motivated given the cancel-in-progress: true concurrency setting already present in the workflow.

Confidence Score: 5/5

Safe to merge — single-line CI config change with no functional regressions.

The change is minimal, semantically correct, and well-explained. No logic, security, or correctness issues identified.

No files require special attention.

Important Files Changed

Filename Overview
.github/workflows/ci.yml Replaces always() with !cancelled() on the final aggregator job so it skips on workflow cancellation (triggered by cancel-in-progress: true) while still running on upstream success or failure.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[New commit pushed] --> B{cancel-in-progress}
    B -- "cancels previous run" --> C[Upstream jobs cancelled]
    B -- "current run proceeds" --> D[ci-bats / ci-other / msrv]

    C --> E{"final job condition"}
    D --> E

    E -- "always() — OLD" --> F[final runs anyway\nwastes runner + noisy annotations]
    E -- "!cancelled() — NEW" --> G{Is workflow cancelled?}
    G -- "yes" --> H[final is skipped ✓]
    G -- "no" --> I[final runs and checks results ✓]
Loading

Reviews (1): Last reviewed commit: "chore(ci): use !cancelled() instead of a..." | Re-trigger Greptile

@jdx jdx enabled auto-merge (squash) May 3, 2026 15:28
@jdx jdx merged commit 1ecacc7 into main May 3, 2026
18 checks passed
@jdx jdx deleted the ci/cancelled-fix branch May 3, 2026 15:29
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.

1 participant