Skip to content

Fix docs-review smart-gate bugs and reduce PR comment spam#1536

Open
justinegeffen wants to merge 3 commits into
masterfrom
justine-smart-gate-fixes
Open

Fix docs-review smart-gate bugs and reduce PR comment spam#1536
justinegeffen wants to merge 3 commits into
masterfrom
justine-smart-gate-fixes

Conversation

@justinegeffen

Copy link
Copy Markdown
Contributor

Summary

Three independent fixes on the /editorial-review path in docs-review.yml. All affect the issue_comment trigger, which is the primary way the workflow runs.

1. Smart-gate base_ref resolution

github.base_ref and github.head_ref are empty on issue_comment events. The previous diff origin/\${{ github.base_ref }}...HEAD expanded to `origin/...HEAD`, and the smart-gate's checkout step (without a ref:) pulled the default branch instead of the PR head. Net effect: lines_changed was effectively 0 on every comment trigger and the <10 lines changed skip always fired — so the LLM review was being blocked for the wrong reason.

Fix: resolve both refs via `gh pr view --json baseRefName,headRefName` (matching what the classify job already does) and check out the PR head before diffing.

2. Smart-gate static_issues counter

`grep -c ":" /tmp/static-results.txt` counted every colon in markdownlint output, not lint issues. Markdownlint prints `path:line:col` (3 colons per issue line) plus success lines that also have colons in paths, so the >5 issues = skip gate tripped (or not) based on noise. Replace with `grep -cE 'MD[0-9]{3}'` to count lines that actually carry a rule code.

3. PR comment spam reduction

A single `/editorial-review` previously produced up to four PR comments:

  1. "Editorial review started!" acknowledgement
  2. Sticky comment from claude-code-action showing progress
  3. Consolidated review with inline suggestions
  4. Summary status-table comment

The sticky comment duplicates the workflow-run UI linked from #1. The summary table duplicates the inline review in #3. Removed #2 (`use_sticky_comment: false`) and #4 (deleted the `summary` job entirely). End state: 1 ack + 1 review per run.

Coordination with PR #1535

PR #1535 extracts Vale to its own workflow and removes `vale-lint` from this file. The summary job referenced `vale-lint` directly; this PR independently deletes the summary job. Merging either order is fine — there's no semantic conflict, only a textual one git can auto-resolve. Recommend merging #1535 first.

Test plan

  • Comment `/editorial-review` on a PR with >10 lines of .md changes. Confirm smart-gate logs show non-zero lines_changed and the LLM review runs.
  • Comment `/editorial-review` on a PR with <10 lines of changes. Confirm smart-gate posts the changes too small skip message.
  • Comment `/editorial-review` on a PR with markdownlint issues. Confirm smart-gate's static_issues count matches the actual issue count from `markdownlint-cli2` locally.
  • Confirm only two PR comments appear per run (the ack and the review).

🤖 Generated with Claude Code

Three independent fixes that all affect the /editorial-review path:

1. Smart-gate base_ref resolution
   github.base_ref and github.head_ref are empty on issue_comment events,
   so the previous diff `origin/${{ github.base_ref }}...HEAD` expanded to
   `origin/...HEAD` and the smart-gate's checkout step pulled the default
   branch rather than the PR head. Net effect: lines_changed was 0 on the
   comment trigger and the <10-lines skip always fired. Resolve both refs
   via `gh pr view --json baseRefName,headRefName` (matching what the
   `classify` job already does) and check out the PR head before diffing.

2. Smart-gate static_issues counter
   `grep -c ":" /tmp/static-results.txt` counted every colon in
   markdownlint output, not actual lint issues. Markdownlint output has
   multiple colons per issue line and also prints success lines. The "fix
   formatting first" gate was tripping (or not) for the wrong reasons.
   Count lines matching `MD[0-9]{3}` instead.

3. PR comment spam reduction
   A single /editorial-review previously produced up to four PR comments:
   the "started" acknowledgement, a sticky comment with Claude's progress,
   the consolidated review with inline suggestions, and a summary table.
   The sticky comment duplicates information already visible on the
   workflow run UI, and the summary table duplicates information already
   on the consolidated review. Drop both. End result: 1 acknowledgement +
   1 review per /editorial-review.

Vale extraction (PR #1535) removes the vale-lint job from this workflow;
the summary job that referenced it is also removed here so this PR is
mergeable independently.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@netlify

netlify Bot commented Jun 8, 2026

Copy link
Copy Markdown

Deploy Preview for seqera-docs ready!

Name Link
🔨 Latest commit 1526f26
🔍 Latest deploy log https://app.netlify.com/projects/seqera-docs/deploys/6a292fc3373a870008996514
😎 Deploy Preview https://deploy-preview-1536--seqera-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Signed-off-by: Justine Geffen <justinegeffen@users.noreply.github.com>
Signed-off-by: Justine Geffen <justinegeffen@users.noreply.github.com>
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