shuke987 opened a new pull request, #68981:
URL: https://github.com/apache/doris/pull/68981

   ### What problem does this PR solve?
   
   Issue Number: N/A
   
   Problem Summary:
   
   When a PR receives another commit, its existing AI review can keep consuming 
model capacity until Codex notices the stale head. It then fails final 
submission verification with `No final review submission was declared`. This 
also happens while the outer runner waits five minutes to resume after a 
capacity error.
   
   Poll the authoritative PR head every 60 seconds during execution and 
capacity backoff, and check at attempt boundaries. A confirmed different SHA 
stops the old attempt through the existing 
SIGINT/grace-period/descendant-reaping path. API errors, timeouts, and 
malformed responses only warn; they do not establish supersession. Existing 
strict resume and submission checks remain in place.
   
   Record `review.superseded`, both SHAs, and a final diagnostic. The workflow 
validates the distinct helper exit code/result, treats supersession as a 
handled outcome, skips verdict/status publication and obsolete status 
aggregation, and retains Litefuse, session, and auth finalization. A successful 
workflow in this case does **not** mean a passed review. Litefuse verification 
also permits a review stopped before its first model/tool request. New commits 
still require the existing `/review` trigger; this does not add automatic 
reviews on pushes.
   
   ### Release note
   
   None
   
   ### Check List (For Author)
   
   - Test
     - [x] Unit Test
     - [x] Manual test (local process integration and workflow shell checks 
below)
   - Behavior changed:
     - [x] Yes. Superseded review processes stop promptly and have an explicit 
handled outcome.
   - Does this need documentation?
     - [x] No. Internal CI behavior; triggering a review is unchanged.
   
   Validation:
   
   - `python3 -m unittest discover -s .github/scripts -p 'test_*.py'` in the 
isolated snapshot containing the runner, submission, and Litefuse test modules: 
**138 cases**, all covered across macOS Python 3.12 and native Linux Python 
3.13. macOS passes 135 and skips 3 Linux-only cases; Linux passes 137 and skips 
the Bash/jq case, which passes on macOS.
   - Linux runs with network disabled and a read-only source mount. Real 
processes cover graceful and forced interruption, detached descendants, 
repeated cancellation during cleanup, preservation of unrelated processes, 
capacity resume, and head-change termination. GitHub and Codex endpoints are 
local fakes; no production review was triggered.
   - New negative cases cover transient API failures, malformed heads, 
exhausted budgets, stale heads before start/at exit/during 
verification/backoff, cleanup failure propagation, and mismatched workflow 
result metadata. The Bash test executes the actual workflow result-handling 
block with jq.
   - `actionlint -shellcheck= .github/workflows/code-review-runner.yml` and 
`git diff --check`: pass.
   - A live new-commit scenario against the deployed workflow remains to be 
validated after rollout. No production binary or credentials change is needed.
   
   <details>
   <summary>Self-review checkpoints</summary>
   
   | Checkpoint | Conclusion |
   | --- | --- |
   | Goal | Stops work on a confirmed obsolete head; unit and Linux process 
tests cover execution and backoff. |
   | Scope | Six CI files; no Doris product source, runtime version, model, or 
trigger changes. |
   | Concurrency | Polling runs synchronously on the runner's main thread; the 
existing stderr copier does not share polling state. No new locks or polling 
thread. |
   | Lifecycle | gh finishes before child reaping; exceptions unwind through 
existing SIGINT, bounded wait, kill, reaper, and copier cleanup. Cleanup errors 
remain errors. |
   | Configuration | Fixed 60-second interval and 10-second API timeout, 
bounded by the existing shared budget; no new user setting. |
   | Compatibility | Existing CLI remains compatible. Helper and workflow 
consume the same pinned workflow revision. The added result state has an 
explicit workflow branch. |
   | Thrift/protobuf | Not applicable. |
   | Parallel paths | Initial attempts, model fallback, same-session resumes, 
capacity waits, and verification races were checked. |
   | Conditions | Only a valid, different head SHA signals supersession. 
Base/open-state and duplicate-submission checks remain strict before resume. |
   | Coverage | Unit, workflow shell, telemetry metadata, and real Linux 
descendant tests cover normal and negative paths. Live production validation is 
still outstanding. |
   | Test results | Both final suites pass with complementary platform skips; 
workflow syntax and whitespace checks pass. |
   | Observability | Explicit result, final message, JSONL event, workflow 
summary, and Litefuse metadata preserve the old/new SHA distinction. |
   | Transactions/persistence | No product transaction changes; result writing 
reuses the existing atomic JSON writer. |
   | Data writes | Superseded runs skip source status and aggregation; existing 
session/auth finalizers are retained. No new review/comment write is 
introduced. |
   | FE/BE propagation | Not applicable. |
   | Performance | One bounded head lookup per minute during long 
execution/backoff, plus boundary checks; avoids continuing obsolete model work. 
|
   | Remaining limits | Detection depends on a successful API lookup and is 
periodic. It cannot retract a GitHub write already completed before the head 
change was observed. |
   
   </details>
   
   ### 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