Skip to content

Conversation

@SahiRB1104
Copy link

Summary

This PR fixes an issue where a build created as retry would not change
to cancelled when a cancel action was triggered on the original build.

Details

Retry builds inherit the previous build state, but were not part of the
state transition that sets a build to cancelled. This caused retry
builds to remain active even after cancellation.

This PR updates the cancel logic so that:

  • both running and retried builds are included
  • state is consistently set to cancelled
  • state transition follows existing expected workflow

Testing

A regression test is added:

  • test_cancel_build.py
    Covers:
  • cancelling a running retry build
  • cancelling a triggered retry build

Issue reference

Fixes #12615

@SahiRB1104 SahiRB1104 requested a review from a team as a code owner December 7, 2025 10:06
@SahiRB1104 SahiRB1104 requested a review from stsewd December 7, 2025 10:06
@SahiRB1104
Copy link
Author

I ran the new test_cancel_build tests locally.
Some unrelated tests fail on my Windows setup (path normalization / external dependencies), but the new tests pass. Please let me know if I should adjust anything.

@SahiRB1104
Copy link
Author

This fixes an issue where old running builds weren’t always cancelled correctly when triggering a new build.

  1. add update_state flag to cancel_build
  2. always update DB + notification when user cancels
  3. skip DB updates for automatic cancels (update_state=False)
  4. update affected tests in test_trigger_build and test_core_utils
  5. add dedicated tests for cancel_build behaviour

All CI checks passed.

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.

Build: Build marked as retry isn't canceled correctly

1 participant