Skip to content

fix: do not fail autofix workflow when upstream jobs are cancelled#2760

Merged
CommanderStorm merged 2 commits intomainfrom
copilot/fix-autofix-workflow-cancellation
Mar 6, 2026
Merged

fix: do not fail autofix workflow when upstream jobs are cancelled#2760
CommanderStorm merged 2 commits intomainfrom
copilot/fix-autofix-workflow-cancellation

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 6, 2026

With concurrency.cancel-in-progress: true, in-progress jobs end with status cancelled when a newer run supersedes them. The done job's CI Result step was treating cancelled the same as failure, causing spurious workflow failures.

Proposed Change(s)

  • Remove || contains(needs.*.result, 'cancelled') from the CI Result step condition in the done job — cancellations are intentional and should not be treated as failures
- if: ${{ contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') }}
+ if: ${{ contains(needs.*.result, 'failure') }}

Checklist

  • Documentation
    • I have updated the documentation
    • No need to update the documentation
Original prompt

Create a pull request in TUM-Dev/NavigaTUM to prevent the autofix.ci workflow from failing when upstream jobs are cancelled (typically due to concurrency.cancel-in-progress: true).

Context:

  • Workflow file: .github/workflows/autofix.yml
  • Current behavior: The final done job fails the entire workflow if any needs.*.result is failure OR cancelled.
  • Desired change (Option A): Only fail when any needed job is failure; do NOT fail just because a job is cancelled.

Implementation details:

  • In .github/workflows/autofix.yml, modify the done job step named CI Result condition.
  • Change:
    • if: ${{ contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') }}
    • to: if: ${{ contains(needs.*.result, 'failure') }}
  • Keep the job name Finished autofix and the step name CI Result unchanged (merge protection may rely on it).

Acceptance criteria:

  • Workflow no longer fails when prior jobs are cancelled.
  • Workflow still fails when any prior job fails.

Reference failing job:

  • Run: 22767038275
  • Job: 66037494316

Please include a concise PR description explaining that cancellations are expected with concurrency and should not be treated as failures.

This pull request was created from Copilot chat.


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Co-authored-by: CommanderStorm <26258709+CommanderStorm@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix autofix.ci workflow to handle cancelled jobs correctly fix: do not fail autofix workflow when upstream jobs are cancelled Mar 6, 2026
@CommanderStorm CommanderStorm marked this pull request as ready for review March 6, 2026 15:26
Copilot AI review requested due to automatic review settings March 6, 2026 15:26
@CommanderStorm CommanderStorm enabled auto-merge (squash) March 6, 2026 15:26
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adjusts the autofix.ci GitHub Actions workflow so that expected job cancellations (from concurrency.cancel-in-progress: true) do not incorrectly mark the workflow as failed, while still failing on genuine job failures.

Changes:

  • Update the done job’s CI Result step condition to fail only when any upstream job result is failure (not cancelled).

@CommanderStorm CommanderStorm merged commit 43d7f2a into main Mar 6, 2026
34 checks passed
@CommanderStorm CommanderStorm deleted the copilot/fix-autofix-workflow-cancellation branch March 6, 2026 16:35
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.

3 participants