Add GitHub check runs for Jacquez reviews#61
Merged
Conversation
- Create check run when PR review starts - Set check to failure if any guideline violations found - Set check to success if no violations found - Post summary comment with bulleted violations on failure - Include rerun instructions mentioning @jacquez - Maintain existing review functionality - Add createCheckRun and updateCheckRun utility functions - Add handlePullRequestCodeReviewWithViolations to track violations Co-Authored-By: Sahil Lavingia <sahil@gumroad.com>
Contributor
Author
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
- Replace pull_request.opened handler with push event handler - Add fetchPushFiles function using GitHub Compare API - Add findAssociatedPRs function to find PRs for commenting - Add handlePushCodeReviewWithViolations for push event code review - Modify createCheckRun to work with commit URLs instead of PR URLs - Analyze commit messages and code changes on every push - Post violation comments to associated open PRs - Maintain existing check run status and violation tracking Co-Authored-By: Sahil Lavingia <sahil@gumroad.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Switch Jacquez webhook from pull_request events to push events
Summary
This PR switches the Jacquez GitHub bot from triggering on
pull_request.openedevents topushevents, enabling continuous integration reviews on every commit rather than just when PRs are opened.Key Changes:
handlePullRequestOpenedwith newhandlePushfunctionfetchPushFiles()using GitHub Compare API instead of PR Files APIfindAssociatedPRs()to find open PRs for posting violation commentshandlePushCodeReviewWithViolations()adapted for push eventscreateCheckRun()to work with commit URLs instead of PR URLsThe system maintains the same two-phase review (commit message + code review) and violation tracking, but now runs continuously on all pushes to monitored repositories.
Review & Testing Checklist for Human
Recommended Test Plan:
Diagram
%%{ init : { "theme" : "default" }}%% graph TD Push[Push Event] --> HandlePush[handlePush function<br/>app/api/webhook/route.ts]:::major-edit HandlePush --> CreateCheck[createCheckRun<br/>utils/prCodeReview.ts]:::minor-edit HandlePush --> FetchFiles[fetchPushFiles<br/>utils/prCodeReview.ts]:::major-edit HandlePush --> FindPRs[findAssociatedPRs<br/>utils/prCodeReview.ts]:::major-edit FetchFiles --> CompareAPI[GitHub Compare API<br/>/repos/.../compare/before...after]:::context FindPRs --> CommitPRAPI[GitHub Commit PRs API<br/>/repos/.../commits/.../pulls]:::context HandlePush --> CodeReview[handlePushCodeReviewWithViolations<br/>utils/prCodeReview.ts]:::major-edit CodeReview --> PostComments[Post violation comments<br/>to associated PRs]:::context CreateCheck --> UpdateCheck[updateCheckRun<br/>success/failure status]:::context subgraph Legend L1[Major Edit]:::major-edit L2[Minor Edit]:::minor-edit L3[Context/No Edit]:::context end classDef major-edit fill:#90EE90 classDef minor-edit fill:#87CEEB classDef context fill:#FFFFFFNotes
pull_request.openedeventsCritical Success Factors: