Skip to content

[fix](ci) Preserve early review failure notifications and causes - #69469

Merged
hello-stephen merged 1 commit into
apache:masterfrom
shuke987:codex/review-early-failure-notification
Nov 2, 2026
Merged

hello-stephen merged 1 commit into
apache:masterfrom
shuke987:codex/review-early-failure-notification

Conversation

@shuke987

Copy link
Copy Markdown
Contributor

What problem does this PR solve?

Related PR: #69386

Problem Summary:

When the pending-status API call fails before repository checkout, the failure notification runs outside a Git checkout. Without an explicit repository, gh pr comment fails with fatal: not a git repository; both the notification and terminal failure step also misidentify the skipped context preparation step as the cause. This occurred in run 38864234303.

Pass --repo explicitly and report failed/cancelled pending-status and checkout steps by name. Distinguish actual context failure/cancellation from skipped or unstarted context in both reporting paths, preserving the existing auth/usage-limit recovery messages and failing exit status.

Release note

None

Check List (For Author)

  • Test:
    • Unit Test: seven new tests execute the actual workflow shell and env bindings through the diagnostic helper with a fake gh, including a non-Git working directory, early failure/cancellation, skipped context, preserved auth/review reasons, and notification failure.
    • Regression test: new tests fail against the old workflow and pass after the fix. Full script suite: 266 tests, 247 passed and 19 Linux process-supervision tests skipped on macOS; includes real gh against a local HTTP server with fake credentials.
    • Manual test: git diff --check; actionlint passes with only its pre-existing unsupported concurrency.queue diagnostic filtered. Hosted Actions failure-path validation remains pending.
  • Behavior changed:
    • Yes. Early failure notifications no longer depend on a checkout to select the repository, and skipped context is no longer reported as a context preparation failure.
  • Does this need documentation?
    • No.

Check List (For Reviewer who merge this PR)

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

### What problem does this PR solve?

Related PR: apache#69386

Problem Summary:

When the pending-status API call fails before repository checkout, the failure notification runs outside a Git checkout. Without an explicit repository, `gh pr comment` fails with `fatal: not a git repository`; both the notification and terminal failure step also misidentify the skipped context preparation step as the cause. This occurred in [run 38864234303](https://github.com/apache/doris/actions/runs/38864234303/job/116853272967).

Pass `--repo` explicitly and report failed/cancelled pending-status and checkout steps by name. Distinguish actual context failure/cancellation from skipped or unstarted context in both reporting paths, preserving the existing auth/usage-limit recovery messages and failing exit status.

### Release note

None

### Check List (For Author)

- Test:
  - [x] Unit Test: seven new tests execute the actual workflow shell and env bindings through the diagnostic helper with a fake gh, including a non-Git working directory, early failure/cancellation, skipped context, preserved auth/review reasons, and notification failure.
  - [x] Regression test: new tests fail against the old workflow and pass after the fix. Full script suite: 266 tests, 247 passed and 19 Linux process-supervision tests skipped on macOS; includes real gh against a local HTTP server with fake credentials.
  - [x] Manual test: `git diff --check`; actionlint passes with only its pre-existing unsupported `concurrency.queue` diagnostic filtered. Hosted Actions failure-path validation remains pending.
- Behavior changed:
  - [x] Yes. Early failure notifications no longer depend on a checkout to select the repository, and skipped context is no longer reported as a context preparation failure.
- Does this need documentation?
  - [x] No.

### 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

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?

shuke987 added a commit to shuke987/doris that referenced this pull request Oct 22, 2026
### What problem does this PR solve?

Related PR: apache#68872, apache#69386, apache#69469

Problem Summary: Merge current master while preserving the serialized aggregate as the only final code-review status writer. Keep diagnostics for existing paths and add trusted helper installation and failure artifacts to the new manual-pass job. Retain the pending step name so early-failure reporting remains compatible.

### Release note

None

### Check List (For Author)

- Test: 276 script tests OK, 19 platform skips. Durable workflow tests cover authorization, failed reads/writes, PR/head scope, closed heads and single final writer. actionlint with only the existing queue diagnostic filtered; diff check.
- Behavior changed: Manual-pass API failures now retain diagnostics; intended manual acceptance semantics remain unchanged.
- Does this need documentation: No additional user-facing behavior beyond the existing manual-pass guide.
@shuke987

Copy link
Copy Markdown
Contributor Author

/review

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Reviewed both changed files at a5d111bab9544dfedd385a20c2419665a3bdcaea and their upstream/downstream workflow paths. No actionable defects were verified; there are no new inline findings or existing blocking comments to carry forward.

Critical checkpoint conclusions:

  • Goal and evidence: the notification now supplies an explicit repository before checkout is available, and both reporters identify pending-status/checkout failures or cancellation. The seven new tests exercise the actual shell and env bindings; inspected statically, not executed here. Repository selection matches the GitHub CLI contract.
  • Scope and clarity: changes are limited to two step IDs, corresponding outcome bindings, failure classification, repository selection, and focused tests.
  • Concurrency: no new parallel execution or shared mutable state; existing per-PR serialization is unchanged.
  • Lifecycle: the diagnostics helper is installed outside the PR checkout before input resolution and pending-status; required PR outputs exist before the newly handled failures. No new lifetime issue found.
  • Configuration: no configuration item added.
  • Compatibility: no function, storage, wire-format, or rolling-upgrade change.
  • Thrift/protobuf: no generated definitions changed.
  • Parallel paths: both the PR notification and terminal failure step use the same new early-step/context classification; terminal exit remains nonzero even when commenting fails.
  • Conditional checks: failure/cancelled are distinguished from intentionally skipped pending-status and skipped/unstarted context. The context fallback explains its purpose. Outcome values match the Actions context contract.
  • Test coverage: new cases cover pre-checkout pending failure, checkout failure with pending success/skipped, early cancellation, skipped/unstarted context, actual context failure/cancellation, preserved auth/review reasons, and notification failure. Existing credential recovery tests cover the preserved auth-marker branches.
  • Test results: no expected-result artifacts changed; assertions and fake-gh exit handling are consistent with the intended behavior. Tests were not run under this review's static-only contract.
  • Observability: named initiating steps and the workflow-run link improve diagnosis; existing API diagnostics remain available.
  • Transactions and persistence: no database transaction, EditLog, replay, or failover behavior affected.
  • Writes and atomicity: the existing failure-comment operation gains explicit repository selection; database writes and crash consistency are unaffected.
  • FE/BE variables: no cross-process variables or send paths changed.
  • Performance: bounded shell comparisons and small isolated tests add no meaningful runtime overhead.
  • Other issues and core invariants: no additional verified bug found after checking skipped, failed, cancelled, successful, superseded, auth/usage, and notification-failure paths. Database visibility/version/delete-bitmap and BE memory-tracking invariants are outside this CI-only change.

User focus: no additional focus was supplied. Coverage limits: this was a static review; no builds, tests, or hosted Actions failure/cancellation runs were executed. Both changed files and related reporting paths were covered, with no unresolved static candidate or uncovered source scope.

Review converged after 2 round(s).

@shuke987

shuke987 commented Nov 2, 2026

Copy link
Copy Markdown
Contributor Author

skip buildall

hello-stephen pushed a commit that referenced this pull request Nov 2, 2026
…69510)

Related PR: #69469

Problem Summary: A single transient GitHub response currently aborts the
review pipeline. [Input resolution for
#69322](https://github.com/apache/doris/actions/runs/39794013905/job/119876748768)
stopped on a GET 503 despite `Retry-After: 2`; [aggregate resolution for
#69438](https://github.com/apache/doris/actions/runs/39760934956/job/119764632659)
stopped on a paginated GET 504 after emitting partial output.

The shared helper now retries recognized body-free REST GETs on
502/503/504, for at most three attempts. Each attempt has a 30-second
limit; attempts and waits share a 90-second budget or the caller's
shorter timeout. It respects Retry-After, records every failed attempt,
discards failed pagination output, and returns only a successful
attempt's complete output. Exhaustion still fails. Writes, GraphQL,
unknown argument forms, other HTTP errors, transport/timeouts and JSON
parsing errors are not retried.

Input resolution can also fail before publishing its PR-number output.
Failure notices now fall back to the authorized trigger's numeric PR
identity, explicitly select the repository, and name the
input-resolution failure in both the notice and terminal error. This
fallback does not permit status publication for an unresolved head/base.

This change can merge independently. It includes the same explicit
`--repo` argument as #69469; a local combination with #69469 and #69504
merged cleanly and passed the macOS suite.
@hello-stephen
hello-stephen merged commit 44dfa15 into apache:master Nov 2, 2026
39 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.

2 participants