feat(review): let a repository analyze without commenting - #89
feat(review): let a repository analyze without commenting#89Svilen-Stefanov wants to merge 1 commit into
Conversation
Reviewing on every push makes the comment the noisy part: most pushes change no components, and each one rewrites the sticky comment with the same content. post_comment: false runs the analysis and uploads the artifact while writing nothing to the pull request, so the webview stays current without a bot posting on it. All three posting steps are gated, the progress placeholder included: a run that will never post its result must not leave "analyzing…" behind. The reaction on a /codeboarding comment stays, because with posting off it is the only sign the command was picked up. The value is validated in the guard rather than read straight into a step condition, so a typo stops the run with a reason instead of quietly posting when the author asked for silence. Outputs are untouched, so a workflow that wants its own rule — comment only when n_changed is not zero, say — can turn posting off and use diagram_md itself. The README shows that. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
CodeBoarding reviewStatus: 0 changed components See the full change in CodeBoarding. graph LR
n_Visual_Rendering_Engine["Visual Rendering Engine"]
n_Structural_Diff_Engine["Structural Diff Engine"]
n_Interaction_Orchestrator["Interaction Orchestrator"]
n_Visual_Rendering_Engine -- "Returns rendering metadata and diagram artifacts" --> n_Interaction_Orchestrator
n_Structural_Diff_Engine -- "Provides annotated diff model for visualization" --> n_Visual_Rendering_Engine
n_Interaction_Orchestrator -- "Triggers structural comparison via CLI" --> n_Structural_Diff_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;
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6cb8fda749
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
|
|
||
| - name: Post review failure | ||
| if: failure() && steps.guard.outputs.skip != 'true' && steps.guard.outputs.mode == 'review' && steps.review_comment.outcome != 'success' | ||
| if: failure() && steps.guard.outputs.skip != 'true' && steps.guard.outputs.mode == 'review' && steps.guard.outputs.post_comment != 'false' && steps.review_comment.outcome != 'success' |
There was a problem hiding this comment.
Require an affirmative value before posting failures
When post_comment: false is set but event resolution fails before guard.sh emits post_comment—for example, a transient failure while fetching the PR for an issue_comment event—the output is empty, so steps.guard.outputs.post_comment != 'false' evaluates true and this failure handler posts a comment despite the explicit opt-out. Requiring the output to equal true, or emitting the validated value before later fallible work, keeps failures closed to posting.
Useful? React with 👍 / 👎.
| The action's outputs are unaffected, so a workflow can decide for itself what to say and when: | ||
|
|
||
| ```yaml | ||
| - uses: CodeBoarding/CodeBoarding-action@v1 |
There was a problem hiding this comment.
Point the example at the major containing this input
The surrounding setup and all other v2 examples use @v2, but this new example selects @v1; because the old major does not receive the breaking v2 action, it does not recognize post_comment and retains its normal commenting behavior. A user copying this exact silence recipe therefore gets an unexpected PR comment, so the example should use @v2.
AGENTS.md reference: AGENTS.md:L55-L58
Useful? React with 👍 / 👎.
Adds
post_comment, defaulting totrueso nothing changes for anyone who ignores it.post_comment: falseruns the analysis and uploads the artifact, but writes nothing to the pull request. The webview still gets everything it reads, so a PR's analysis stays current without a bot commenting on it.This matters more now that reviews can run on every push (#87): most pushes change no components, so the sticky comment gets rewritten with identical content each time.
What is gated
All three posting steps, including the progress placeholder — a run that will never post its result must not leave "⏳ analyzing…" sitting on the PR. The 👀 reaction on a
/codeboardingcomment stays, because with posting off it is the only sign the command was picked up.Analysis, artifact upload, caching and outputs are untouched.
Why the guard validates it
post_commentis checked inguard.shrather than read straight into a step condition. A typo likepost_comment: nowould otherwise fall through to posting — the one behaviour the author explicitly asked against. It now fails the run with a reason.It composes
Outputs are unaffected, so a workflow can apply its own rule:
Comment only when the architecture actually changed. That is deliberately left to the workflow rather than built in as a third mode, since "what counts as worth commenting on" is a repository's call and the outputs already express it.
Verification
85 tests. Two new ones, both mutation-checked:
test_every_comment_step_honours_post_commentfinds everysticky-pull-request-commentstep inaction.ymland fails if any loses the gate — so a fourth posting step added later cannot skip it.test_review_guard_rejects_an_unusable_post_comment_valuefails if an unrecognised value silently defaults to posting.🤖 Generated with Claude Code