Skip to content

Post docs-review summary as PR comment when no inline findings - #144

Merged
theletterf merged 1 commit into
mainfrom
fix/docs-review-body-only-add-comment
May 8, 2026
Merged

theletterf merged 1 commit into
mainfrom
fix/docs-review-body-only-add-comment

Conversation

@theletterf

Copy link
Copy Markdown
Member

Summary

  • Switch the docs-review no-findings path from submit_pull_request_review (body-only) to add_comment so the summary actually lands on the PR.
  • Tracked upstream at github/gh-aw#30964.

Why

The PR-menu /docs-review command fires an issue_comment event. gh-aw's submit_pull_request_review handler (submit_pr_review.cjs:130-138 → safe_output_helpers.cjs:102-110) only treats pull_request* events as PR context, so a body-only review on an issue_comment trigger silently drops with No review context available. create_pull_request_review_comment handles the same trigger correctly via payload.issue.pull_request — so before #137, the docs-skills flow always emitted at least one inline comment that set the review context as a side effect.

The autonomous Vale-only flow introduced in #137 now produces zero inline comments on clean PRs, which exposes the latent asymmetry. Result: a successful workflow with empty PR output (e.g. https://github.com/elastic/docs-content/actions/runs/25541964378).

Fix

add_comment correctly handles issue_comment payloads (add_comment.cjs uses supportsPR: true, which resolveTarget accepts via the isIssueContext branch). Routing summary-only outputs there guarantees they post. submit_pull_request_review is preserved for runs with at least one inline finding — that path was never broken.

Test plan

  • Trigger /docs-review on a clean docs PR (no Vale findings) — expect a single PR comment with the summary, no warnings.
  • Trigger /docs-review on a PR with at least one inline-worthy finding — expect inline review comments + a consolidated COMMENT review (unchanged behavior).
  • Confirm safe_outputs job no longer emits the No review context available annotation on either run.

🤖 Generated with Claude Code

When the docs-review workflow is triggered by an issue_comment event
(which is how the PR-menu /docs-review slash command fires), gh-aw's
submit_pull_request_review handler cannot resolve the PR — its
resolveTarget path treats only pull_request* events as PR context, so
body-only reviews silently drop with "No review context available".
The handler for create_pull_request_review_comment, by contrast, reads
context.payload.issue.pull_request and works fine on the same trigger.

Before #137 the agent always emitted at least one inline comment via
the docs skills, which set the review context as a side effect. The
autonomous Vale-only flow now produces zero inline comments on clean
PRs, exposing the latent gh-aw asymmetry. Tracked upstream at
github/gh-aw#30964.

Switch the no-findings path to add_comment, which correctly handles
issue_comment payloads, so the summary always posts. submit_pull_request_review
remains the path when there are inline review comments to attach.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
@theletterf
theletterf requested a review from a team as a code owner May 8, 2026 07:56
@theletterf
theletterf requested a review from Mpdreamz May 8, 2026 07:56
@theletterf theletterf self-assigned this May 8, 2026
@theletterf theletterf added the fix label May 8, 2026
@theletterf
theletterf merged commit d00d99a into main May 8, 2026
3 of 4 checks passed
@theletterf
theletterf deleted the fix/docs-review-body-only-add-comment branch May 8, 2026 07:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant