Skip to content

feat(review): notify requester when review skipped for no new commits#2457

Merged
atoomic merged 1 commit into
Anantys-oss:mainfrom
Koan-Bot:koan.atoomic/review-skip-no-changes-notice
Jul 23, 2026
Merged

feat(review): notify requester when review skipped for no new commits#2457
atoomic merged 1 commit into
Anantys-oss:mainfrom
Koan-Bot:koan.atoomic/review-skip-no-changes-notice

Conversation

@Koan-Bot

@Koan-Bot Koan-Bot commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

What

When a /review finds no new commits since the last review, post a short blue > [!NOTE] comment instead of skipping silently.

Why

The incremental-review SHA check exists so unchanged PRs aren't re-reviewed. But on a user-initiated /review (or @mention), the bot only reacted with a thumbs-up and then went quiet — the requester couldn't tell whether the review ran, failed, or was intentionally skipped. They asked; they deserve an answer.

How

  • New _post_no_changes_notice() in review_runner.py posts a build_alert("NOTE", …) blue callout (with the reviewed HEAD short-SHA) via the issues-comments API. Best-effort — a failed post only logs, so the skip still succeeds.
  • Wired into the existing "same SHAs, not re-requested" skip branch, right before the success-with-skip return. Bot-comment triage on that path is unchanged.
  • Spec updated contract-first (specs/skills/review.md → Outputs / side effects).

Testing

  • New test asserts exactly one [!NOTE] skip notice is posted on the no-new-commits path; existing "skips silently" test still confirms the analysis is not run.
  • make lint clean; full test_review_runner.py suite: 486 passed.

Quality Report

Changes: 3 files changed, 74 insertions(+)

Code scan: 1 issue(s) found

  • koan/app/review_runner.py:2200 — debug print statement

Tests: failed (4 failed, 403
tests)

Branch hygiene: clean

Generated by Skuggi

The incremental-review SHA check previously skipped silently when a PR had no new commits since the last review — the user saw only the thumbs-up ack and was left guessing. Post a short blue > [!NOTE] callout explaining the review was skipped because the code is unchanged.
@github-actions
github-actions Bot requested a review from Father-Koan July 21, 2026 05:47
@Father-Koan

Copy link
Copy Markdown
Contributor

PR Review — feat(review): notify requester when review skipped for no new commits

Small, well-scoped feature that closes a real UX gap — merge-ready with one non-blocking nit.

Strengths:

  • Correct best-effort design: a failed notice POST only logs to stderr and returns False, so the skip still succeeds — the review is never held hostage to the comment call.
  • Output is run through sanitize_github_comment(), and build_alert("NOTE", …) is the right primitive for a blue callout; no injection surface.
  • Spec was updated contract-first, and the edit is purely additive (5 inserted bullets, no rewrites) — spec_change_guard.py passes it without an architectural declaration, so the discipline is satisfied.
  • New test asserts observable behavior (exactly one [!NOTE] POST via run_gh call args), mocks the gh boundary correctly, and mirrors the existing passing skip test.

Notes on the automated quality report:

  • "debug print statement at line 2200" is a false positive — that line is inside the _append_error_section_to_review docstring. The new print(..., file=sys.stderr) is legitimate best-effort logging, identical in style to _post_review_comment.

  • "4 failed tests (403 collected)" could not be reproduced here (test execution needs approval unavailable in this read-only pass). It conflicts with the PR's own "486 passed" for test_review_runner.py, suggesting a different/partial collection or pre-existing flakiness. The two directly-affected tests are sound.

  • Verify full CI is green before merge to reconcile the test-count discrepancy.

  • Consider deduping/upserting the notice instead of a fresh POST (suggestion below) to match the rest of the module.


🟢 Suggestions

1. No-changes notice is an un-deduped fresh POST — inconsistent with the module's upsert discipline
koan/app/review_runner.py:3335-3338

_post_no_changes_notice() always POSTs a brand-new issue comment. Every other comment this module leaves is deduped: the review summary is upserted (find_bot_comment + PATCH), and the bot-triage path uses fingerprinting. This one is not.

Why it matters: each time run_review hits the no-new-commits skip branch on an unchanged PR — repeated /review slash commands, or any future automated re-trigger with matching SHAs and no re-request — a fresh identical > [!NOTE] "No code changes" comment is appended. On a PR that gets poked more than once while stale, these accumulate as visible clutter. (An @mention is reaction-deduped upstream, so a single mention posts once; the risk is repeated explicit triggers.)

Suggested fix: before posting, look for a prior notice (a dedicated marker in the body via find_bot_comment) and upsert-or-skip, mirroring how the review summary is handled — so at most one live "skipped, unchanged" notice exists per PR. Non-blocking; the best-effort/error-swallowing behavior is otherwise correct.

_post_no_changes_notice(
    owner, repo, pr_number,
    head_sha=(current_shas[-1] if current_shas else ""),
)

Checklist

  • Durable-spec change declared or additive-only
  • No injection in GitHub comment body (sanitized)
  • Error paths handled (best-effort, no swallowed crash)
  • Tests verify observable behavior, mock external boundaries
  • Comment side effects deduped/upserted consistently — suggestion #1

Automated review by Kōan (Claude) HEAD=a9f222e 5 min 56s

@Father-Koan Father-Koan left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Tip

No blocking issues found — ready to merge.

@atoomic
atoomic marked this pull request as ready for review July 21, 2026 12:40
@atoomic
atoomic merged commit f20e3da into Anantys-oss:main Jul 23, 2026
9 checks passed
@Koan-Bot
Koan-Bot deleted the koan.atoomic/review-skip-no-changes-notice branch July 24, 2026 04:42
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.

3 participants