Skip to content

[fix](ci) cancel superseded buildall revisions#65813

Draft
hello-stephen wants to merge 1 commit into
apache:masterfrom
hello-stephen:fix/cancel-superseded-buildall
Draft

[fix](ci) cancel superseded buildall revisions#65813
hello-stephen wants to merge 1 commit into
apache:masterfrom
hello-stephen:fix/cancel-superseded-buildall

Conversation

@hello-stephen

Copy link
Copy Markdown
Contributor

What problem does this PR solve?

Issue Number: N/A

Related PR: N/A

Problem Summary:

The run buildall comment workflow currently cancels queued/running builds one pipeline at a time immediately before each direct trigger. This does not cover downstream pipelines started by Compile, such as P0, External, Cloud P0, Vault P0, NonConcurrent, and coverage checks.

As a result, after a PR receives a new revision and another run buildall comment, downstream builds for the previous revision can continue consuming TeamCity agents while the new revision is already queued or running. A live occurrence on PR #65644 left P0, External, Cloud P0, and NonConcurrent running on revision 2302709bb4 after revision a9a716d174 had started.

This change adds one cancellation step to the existing comment-trigger workflow after the pipeline security check and before any new build is triggered. The step:

  • lists queued and running TeamCity builds for the PR branch;
  • limits cancellation to the existing formal buildall pipeline IDs, including the downstream FE coverage check;
  • compares the immutable TeamCity revision with the PR head resolved from the comment event;
  • cancels only builds bound to an older revision;
  • preserves same-revision builds, other PRs, debug/tmp configurations, and builds without a valid revision binding;
  • fails the workflow when TeamCity cannot be queried or an obsolete build cannot be canceled, preventing additional duplicate cost.

The existing per-pipeline cancellation remains in place for standalone comments such as run feut and run p0.

Release note

None

Check List (For Author)

  • Test

    • Regression test
    • Unit Test
    • Manual test (add detailed scripts or steps below)
      • bash -n regression-test/pipeline/common/teamcity-utils.sh
      • go run github.com/rhysd/actionlint/cmd/actionlint@latest .github/workflows/comment-to-trigger-teamcity.yml
      • Stubbed TeamCity queued/running responses: verified three obsolete builds were canceled while same-revision, other-PR, debug, and missing-revision builds were preserved; dry-run produced no writes.
      • Real TeamCity dry-run for PR [feature](plugin) Add information_schema.plugins for kernel plugin metadata #65644 completed successfully after the obsolete builds were removed.
    • No need to test or manual test. Explain why:
      • This is a refactor/code format and no logic has been changed.
      • Previous test can cover this change.
      • No code files have been changed.
      • Other reason
  • Behavior changed:

    • No.
    • Yes. A new run buildall cancels queued/running formal pipelines for older revisions of the same PR before triggering the new revision.
  • Does this need documentation?

    • No.
    • Yes.

Check List (For Reviewer who merge this PR)

  • Confirm the release note
  • Confirm test cases
  • Confirm document
  • Add branch pick label

@hello-stephen

Copy link
Copy Markdown
Contributor Author

Thank you for your contribution to Apache Doris.
Don't know what should be done next? See How to process your PR.

Please clearly describe your PR:

  1. What problem was fixed (it's best to include specific error reporting information). How it was fixed.
  2. Which behaviors were modified. What was the previous behavior, what is it now, why was it modified, and what possible impacts might there be.
  3. What features were added. Why was this function added?
  4. Which code was refactored and why was this part of the code refactored?
  5. Which functions were optimized and what is the difference before and after the optimization?

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