hello-stephen opened a new pull request, #65813:
URL: https://github.com/apache/doris/pull/65813

   ### 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
       - [x] 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 #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.
       - [x] 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?
       - [x] No.
       - [ ] Yes.
   
   ### Check List (For Reviewer who merge this PR)
   
   - [ ] Confirm the release note
   - [ ] Confirm test cases
   - [ ] Confirm document
   - [ ] Add branch pick label
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to