feat(daemon,forge): the review-reaction producers
Sequencing steps 6 and 7 of pr-review-remediation.md: the consumer landed in052e350b, and these are the two sources that feed it. Webhook (decision 2, low latency): the GitHub receiver decodes pull_request_review and pull_request_review_comment events behind the existing HMAC verification and publishes the same typed reaction the poller produces, keyed source-independently so PublishUnique collapses the two sources. Only submitted/created carry a verdict to remediate; edited and dismissed are acknowledged. Reaction deliveries are rate-limited per source (decision 6's 'add when the receiver gains a second event family'), and the reaction path carries no dispatch predicate -- eligibility is the consumer's owned-PR lookup. Poll (both forges, the no-webhook backstop): one shared scan over all pr_open tasks, each with the forge client its own identity owns (reconcilePRs's shape), listing reviews and comments since per-task persisted high-water marks and skipping the owning identity's bot user (decision 5's own-comment exclusion, which the poll is positioned to make identity-correct). The cursors are two, not one: review IDs and comment IDs are independent forge sequences, and a combined high-water mark would silently skip reviews once a larger comment ID landed. watch_comment_id -- dead since the comment-watch design it was created for never shipped -- carries the comment cursor; review_cursor is a new presence-gated migrator column, and SetReviewCursors is its guarded RPC (pr_open only, so cursors never move under a run that owns the task). forge.ReviewComment gains ReviewID so a comment is collectable into its review's unit (decision 5) on both forges, and forge.Review gains Body so poll-delivered reviews carry their summary. Note: the store/proto/facade half of this work landed early ina65eae24under a release session's message -- a shared-checkout collision, kept rather than rewritten; that commit carries the review_cursor migration and the SetReviewCursors contract, this one carries the producers.
This commit is contained in:
1 parent
59614cc63f
commit
8faa0f6a30
15 files changed
+699
-41
No files matched your search
@@ -207,6 +207,7 @@ func (c *GitHubClient) ListReviews(ctx context.Context, owner, repo string, numb
|
||||
ID: r.GetID(),
|
||||
Author: r.GetUser().GetLogin(),
|
||||
State: normalizeReviewState(r.GetState()),
|
||||
Body: r.GetBody(),
|
||||
SubmittedAt: r.GetSubmittedAt().Time,
|
||||
})
|
||||
}
|
||||
@@ -237,6 +238,7 @@ func (c *GitHubClient) ListReviewComments(ctx context.Context, owner, repo strin
|
||||
}
|
||||
out = append(out, ReviewComment{
|
||||
ID: cm.GetID(),
|
||||
ReviewID: cm.GetPullRequestReviewID(),
|
||||
Author: cm.GetUser().GetLogin(),
|
||||
Body: cm.GetBody(),
|
||||
Path: cm.GetPath(),
|
||||
|
||||
Reference in new issue
Block a user