Honor GitHub PR approvals as CR signoffs#463
Conversation
Treat a GitHub PR review with state APPROVED as a CR signoff, so reviewers who approve natively on GitHub no longer need a `CR :emoji:` comment. Gated behind the useGithubApprovalForCr config flag (default on); skipped when the review body already produces a CR signature.
Cover Signature.parseReview's APPROVED-to-CR mapping, dedup against a CR body tag, and that CHANGES_REQUESTED is ignored. Add a node --test script.
Note that a GitHub Approve review counts as a CR signoff, the required webhook event, and the useGithubApprovalForCr opt-out.
03b2349 to
3ce8112
Compare
|
QA: logic + webhook wiring verified. Live GitHub E2E not run (DB/infra blockers below). Done
Not done, and why The two manual boxes — approve on GitHub fills the CR bubble, dismiss drops it after refresh — weren't verified end-to-end. Test machine has no MySQL/Docker for the app's DB, and real webhook delivery needs a GitHub OAuth app, a public tunnel, and a PR approvable by a non-author (can't approve your own). Not reproducible headlessly. Net: the parsing logic and the webhook/refresh wiring feeding it are verified; only GitHub's live review-event delivery and the resulting UI bubble are unverified. Recommend a manual approve+dismiss pass on a tracked/staging repo before relying on it, with the Pull request reviews webhook event enabled. |
|
Seems reasonable, let's make sure this logs to the db the same as a regular CR. This is all because github predates GH approvals by many years. We were first! |
|
Confirmed same write path, both triggers:
|
|
@danielbeardsley would you mind giving this a quick check since you're most familiar? |
|
CR 👍 Nice! |
Summary
state: APPROVED) as a CR signoff, so reviewers who approve on GitHub no longer need to add aCR :emoji:comment.useGithubApprovalForCr(default on); skipped when the review body already produces a CR signature.Problem
Pulldasher had no concept of a GitHub PR approval. CR signoff required manually adding a
CR :emoji:comment on every PR, even when the reviewer had already approved natively on GitHub.Solution
models/signature.js:parseReviewmaps anAPPROVEDreview to a CR signature, deduped against an existingCRbody tag. Works for both thepull_request_reviewwebhook and full PR refresh.Deployment notes
useGithubApprovalForCr: falseto keep legacy emoji-only behavior.Test plan
npm test(APPROVED-to-CR mapping, dedup, CHANGES_REQUESTED ignored)npm run lint