[fix](ci) Add error handling and PR notification for OpenCode review failures#61334
[fix](ci) Add error handling and PR notification for OpenCode review failures#61334zclllyybb merged 1 commit intoapache:masterfrom
Conversation
|
Thank you for your contribution to Apache Doris. Please clearly describe your PR:
|
|
/review |
|
run buildall |
There was a problem hiding this comment.
Code Review Summary
This PR adds error handling and PR notification for OpenCode review failures in the CI workflow. The intent is sound — previously failures were silent, and now the PR gets notified. However, there is one functional bug and one cosmetic issue.
Critical Checkpoints
- Goal: Add error handling to the OpenCode review CI step so failures are surfaced as PR comments. The intent is achieved but has a bug that undermines it in the most important scenario (opencode failure).
- Modification scope: Small, focused, single-file CI change. Appropriate scope.
- Concurrency: N/A — no concurrency concerns in a CI workflow.
- Lifecycle / static init: N/A.
- Configuration items: N/A.
- Incompatible changes: N/A.
- Parallel code paths: N/A.
- Special conditional checks: The
failure_reasondetection logic has an edge case; see inline comment. - Test coverage: CI workflows are not unit-tested; manual testing is expected.
- Observability: The PR comment on failure is the observability mechanism here. It will be partially broken due to the bug below.
- Performance: N/A.
Issues Found
-
Bug (High):
set -e(GitHub Actions default shell) causes immediate script exit when theopencode | teepipeline fails, soPIPESTATUSandfailure_reasonlogic never executes. The PR comment will have an empty error message in the most common failure case. See inline comment for details and suggested fix. -
Minor (Cosmetic): The heredoc in the "Comment PR on review failure" step uses leading spaces that will appear in the PR comment body, making it look oddly indented.
a11d00c to
5fc0863
Compare
|
/review |
There was a problem hiding this comment.
Code Review Summary
This PR adds error handling and PR notification for OpenCode review failures in the CI workflow, and adds a new "Review Holistically" principle plus an example to the "Reuse First" principle in the code-review skill.
Critical Checkpoint Conclusions
- Goal: Add resilient error handling so that when the OpenCode review process fails, the failure is captured, reported to the PR, and the workflow correctly fails. The SKILL.md changes add review guidance. The goal is largely accomplished, with issues noted below.
- Modification size/focus: The change is small and focused on two related concerns (CI resilience + review skill docs). Appropriate scope.
- Concurrency: Not applicable - this is a sequential CI workflow.
- Lifecycle management: Not applicable.
- Configuration items: No new config items.
- Incompatible changes: No incompatible changes.
- Parallel code paths: No other workflows need this same change.
- Special conditional checks: The
rgpattern and the conditional logic have a correctness issue (see inline comment) where a successful run (exit 0) with an incidentalError:in the log would be falsely treated as a failure. - Test coverage: CI workflow changes are not typically unit-tested; manual testing of failure scenarios is recommended.
- Observability: The failure reason is posted to the PR and also echoed in the workflow logs - good.
- Transaction/persistence: Not applicable.
- Data writes: Not applicable.
- FE-BE variables: Not applicable.
- Performance: Not applicable for CI workflow.
- Other issues: (1) The heredoc in the PR comment step preserves leading whitespace, resulting in poorly formatted comments. (2) The
rgpattern can cause false positives when exit status is 0 but log contains matching text.
Issues Found
- [Bug] False-positive failure detection: When
opencodeexits with status 0 (success), but the log happens to contain a line matching^Error:orSSE read timed out(e.g., from the review content itself discussing errors), thefailure_reasonvariable will be non-empty, causing the step toexit 1and falsely report failure. - [Cosmetic] Heredoc indentation: The
cat <<EOFheredoc preserves leading whitespace, so the PR comment will have each line indented with extra spaces.
- Capture both exit status and error messages (Error:/SSE timeout) from OpenCode output - Post failure comment to PR with error details and workflow run link when review fails - Use continue-on-error with explicit failure handling to ensure workflow reports failures correctly - Update code review skill to emphasize holistic analysis of upstream/downstream call
5fc0863 to
a834310
Compare
|
/review |
Code Review SummaryPR: fix Add error handling and PR notification for OpenCode review failures This PR adds error handling to the OpenCode automated review workflow and a new "Review Holistically" principle to the code-review skill. The changes are small, focused, and accomplish their stated goals. Critical Checkpoint Conclusions
Verdict: No blocking issues found. The implementation is clean and accomplishes its goal. |
|
run buildall |
|
PR approved by at least one committer and no changes requested. |
|
PR approved by anyone and no changes requested. |
before it may silently fail. now try it best to return the status if failed.