Skip to content

feat(review): let a repository analyze without commenting - #89

Closed
Svilen-Stefanov wants to merge 1 commit into
mainfrom
feat/optional-review-comment
Closed

feat(review): let a repository analyze without commenting#89
Svilen-Stefanov wants to merge 1 commit into
mainfrom
feat/optional-review-comment

Conversation

@Svilen-Stefanov

Copy link
Copy Markdown
Contributor

Adds post_comment, defaulting to true so nothing changes for anyone who ignores it.

post_comment: false runs 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 /codeboarding comment 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_comment is checked in guard.sh rather than read straight into a step condition. A typo like post_comment: no would 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:

      - uses: CodeBoarding/CodeBoarding-action@v1
        id: codeboarding
        with:
          post_comment: false
      - if: steps.codeboarding.outputs.n_changed != '0'
        uses: marocchino/sticky-pull-request-comment@v2
        with:
          header: codeboarding-review
          number: ${{ github.event.pull_request.number }}
          path: ${{ steps.codeboarding.outputs.diagram_md }}

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_comment finds every sticky-pull-request-comment step in action.yml and fails if any loses the gate — so a fourth posting step added later cannot skip it.
  • test_review_guard_rejects_an_unusable_post_comment_value fails if an unrecognised value silently defaults to posting.

🤖 Generated with Claude Code

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

codeboarding-review Bot commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

CodeBoarding review

Status: 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;
Loading

download artifacts · run 32238591254

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 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".

Comment thread action.yml

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

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge 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 👍 / 👎.

Comment thread README.md
The action's outputs are unaffected, so a workflow can decide for itself what to say and when:

```yaml
- uses: CodeBoarding/CodeBoarding-action@v1

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge 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 👍 / 👎.

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.

1 participant