fix: don't let a late failure erase a review that already posted - #66
Merged
Merged
Conversation
The failure and quota comments reuse the review comment's sticky header, so posting either one REPLACES the architecture diff rather than adding to it. Any step that fails after the review has been published therefore deletes the thing the user came for, and the PR ends up showing "Architecture review · failed" for a review that succeeded. Seen on CodeBoarding-webview#22: diagram, body, artifact upload and the sticky comment all succeeded, then an enrichment step failed and overwrote the result. Gives the review comment an `id` and gates both failure paths on `steps.review_comment.outcome != 'success'`. A step failing after publication cannot un-publish the review, so it must not erase it either. Every genuine failure path is unaffected: when the review never posts the outcome is `skipped` (or empty, if the job died earlier), both of which are != 'success', so the failure and quota comments still appear as before. Sync mode is untouched — those steps are already gated on `mode == 'review'`. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Contributor
Architecture review · no architectural changesgraph LR
n_Analysis_Engine_Adapter["Analysis Engine Adapter"]
n_Visual_Rendering_Engine["Visual Rendering Engine"]
n_Structural_Diff_Engine["Structural Diff Engine"]
n_Telemetry_Feedback_Handler["Telemetry #38; Feedback Handler"]
n_Interaction_Orchestrator["Interaction Orchestrator"]
n_Analysis_Engine_Adapter -- "Orchestrates documentation generation" --> n_Visual_Rendering_Engine
n_Visual_Rendering_Engine -- "Queries for architectural changes" --> n_Structural_Diff_Engine
n_Structural_Diff_Engine -- "Provides change-set data" --> n_Visual_Rendering_Engine
n_Telemetry_Feedback_Handler -- "Captures user intent from UI" --> n_Interaction_Orchestrator
n_Interaction_Orchestrator -- "Consumes issue counts for UI" --> n_Visual_Rendering_Engine
classDef added fill:#1f883d,stroke:#0b5d23,color:#ffffff;
classDef modified fill:#bf8700,stroke:#7d4e00,color:#ffffff;
classDef deleted fill:#cf222e,stroke:#82071e,color:#ffffff,stroke-dasharray:5 3;
Colors indicate component changes compared to target branch Download the PR analysis artifacts from this workflow artifact. Explore this PR’s architecture in your browser or VS Code. codeboarding-action · run 30688190355 |
ivanmilevtues
approved these changes
Aug 1, 2026
|
|
||
| - name: Post quota-exhausted comment | ||
| if: failure() && steps.guard.outputs.skip != 'true' && steps.guard.outputs.mode == 'review' && steps.quota.outputs.exhausted == 'true' | ||
| if: failure() && steps.guard.outputs.skip != 'true' && steps.guard.outputs.mode == 'review' && steps.quota.outputs.exhausted == 'true' && steps.review_comment.outcome != 'success' |
| # add-on, an artifact upload) cannot un-publish it, and must not erase it either. | ||
| - name: Post failure comment | ||
| if: failure() && steps.guard.outputs.skip != 'true' && steps.guard.outputs.mode == 'review' && steps.quota.outputs.exhausted != 'true' | ||
| if: failure() && steps.guard.outputs.skip != 'true' && steps.guard.outputs.mode == 'review' && steps.quota.outputs.exhausted != 'true' && steps.review_comment.outcome != 'success' |
Member
There was a problem hiding this comment.
proly should be refactored with a single if failure branch and then have different things for the comments
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The bug
The failure and quota comments reuse the review comment's sticky header, so posting
either one replaces the architecture diff instead of adding to it. Any step that fails
after the review has been published therefore deletes the thing the user came for, and
the PR is left showing "Architecture review · failed" for a review that actually worked.
Seen on CodeBoarding-webview#22
(run) — every
step that matters succeeded:
…and the failure comment then overwrote it. The trigger there was an add-on step on an
unmerged branch, but the defect is on
mainand any late failure hits it — a flakyupload-artifact, a transient API error while posting.The fix
Give the review comment an
id, and gate both failure paths on it:A step failing after publication cannot un-publish the review, so it must not erase it.
Genuine failures still report
!= 'success'rather than== 'failure'on purpose — it fails open:review_comment.outcomeskipped/ emptyfailureskippedsuccessmode == 'review'Notes
action.ymlonly;action.ymlis byte-identical betweenv1andmain, so thisapplies cleanly to the shipping code.
actionlintreports nothing foraction.yml. It does flagcreate-github-app-tokeninputs in this repo's own workflows, but that is pre-existing, untouched by this PR, and
does not reproduce under the version CI pins (
v1.7.7; local was1.7.12).AGENT.md, merging alone ships nothing — this needs a release to re-point@v1before consumers pick it up.
🤖 Generated with Claude Code