Skip to content

feat(github): Say when a PR comment asks the requester a question - #4357

Merged
BYK merged 5 commits into
mainfrom
junior/pr-action-question-ask
Nov 26, 2026
Merged

BYK merged 5 commits into
mainfrom
junior/pr-action-question-ask

Conversation

@sentry-junior

@sentry-junior sentry-junior Bot commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

When Junior asks the requester a question in a PR comment (github_commentOnPullRequest with asks_requester, from #4305), the Inbox item shows the general "GitHub asks you to review #N." The requester can't tell from the item that a question waits on them.

Changes

  • pull-request-review-again.ts: the review-asked mark gets an optional reason (handled or question), and GitHubReviewAskReason adds question. An unset reason still means handled, so the feedback tool's marks keep working.
  • comment-on-pull-request.ts: before it asks for the review on GitHub, the tool writes the mark with reason: "question", the same way the feedback tool marks a review-again ask. GitHub records no new review request for a reviewer that it already asks, so a requester who replied after GitHub's last ask would still count as acting last. When GitHub already asks the requester, the tool removes the request and adds it again, so GitHub records a new ask and sends its review_requested webhook. If the request fails after that removal with a rate limit or server error, the tool tries it once more.
  • pull-request-action.ts:
    • askReason returns the mark's reason, and the item text for question is "A comment asks you a question."
    • A comment-only review keeps the review item open, so a question can come while the item already shows "review". A fresh question mark therefore counts as a change for a review or draft action: it updates the open item once. The mark is dropped only when a review item shows it, so a sync that closes the item keeps it for the review request that follows.
  • pull-request-action-text.ts: the item and close text moves here from pull-request-action.ts, which keeps that file under the file-length limit.

No new table: the mark is the existing 1-hour state key, and it only has to outlive GitHub's review_requested webhook.

The item has no link to the comment. Its URL is the PR, which the dashboard shows as one card. The text can't name the bot because the no-hardcoded-bot-name rule forbids it: each install configures the bot name.

Design

design/github.md gets a rule next to the hand-back rule from #4305: "When Junior asks the requester a question in a PR comment, it asks for their review on GitHub, and the Inbox says that Junior asked them a question."

via @BYK.

--

View Session [Sentry]

@sentry-junior
sentry-junior Bot added this pull request to stack #4307 November 25, 2026 19:37
@vercel

vercel Bot commented Nov 25, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
junior-docs Ready Ready Preview Nov 25, 2026 11:56pm UTC

Request Review

@sentry-junior
sentry-junior Bot marked this pull request as ready for review November 25, 2026 22:06
@sentry-junior
sentry-junior Bot requested a review from BYK November 25, 2026 22:06
@github-actions github-actions Bot added the risk: high PR risk score: high label Nov 25, 2026

@cursor cursor 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.

Cursor Bugbot has reviewed your changes using default effort and found 2 potential issues.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit be4b909. Configure here.

sentry-junior Bot and others added 4 commits November 25, 2026 23:56
A PR comment with asks_requester asks the requester for a review, and
the Inbox showed the general review text. The comment tool now marks
the review ask with the question reason, and the item says that a
comment asks them a question.

A comment-only review keeps the review item open, so a new question
counts as a change and updates the open item. The mark is dropped once
the item shows it.

Co-Authored-By: BYK <[email protected]>
When Junior asks the requester a question in a PR comment, the Inbox
item says so instead of the general review text.

Co-Authored-By: BYK <[email protected]>
When GitHub already asks the requester for a review, asking again sends no
review request webhook, so the open item kept its general text. The tool
now writes the question mark before it posts the comment, and the
comment's own webhook syncs the item while that mark waits. A comment that
GitHub does not post drops the mark.

The item and close text moves to pull-request-action-text.ts, which keeps
pull-request-action.ts under the file-length limit.

Co-Authored-By: BYK <[email protected]>
GitHub records no new review request for a reviewer that it already
asks. So after the requester replied to their change request, a question
from Junior left the item closed: their reply still came after GitHub's
last ask. The tool now removes and adds such a request, so GitHub records
a new ask and sends its review request webhook every time.

That webhook shows the question on an open item too, so the sync on
Junior's own comment, and the mark before the comment, are gone.

Co-Authored-By: BYK <[email protected]>
Removing the requester's review request starts a sync that can close
the item, and that sync dropped the question mark, so the review request
that followed showed the general text. The mark now drops only when a
review item shows it.

A failed review request after that removal left the requester unasked,
though GitHub asked them before. A rate limit or server error now gets
one more try.

Co-Authored-By: BYK <[email protected]>
@BYK
BYK force-pushed the junior/pr-action-question-ask branch from a355733 to 43c403b Compare November 25, 2026 23:56
@BYK
BYK merged commit 93cff61 into main Nov 26, 2026
78 of 80 checks passed
@BYK
BYK deleted the junior/pr-action-question-ask branch November 26, 2026 00:11

This branch was successfully deployed

1 active deployment
Preview – junior-docs — 43c403b6 Deployed Nov 25, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk: high PR risk score: high

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant