Conversation
…ations are found
- Automatically assigns pull requests back to their creators after AI analysis determines violations of contributing guidelines
- Uses GitHub API endpoint POST /repos/{owner}/{repo}/issues/{issue_number}/assignees
- Only triggers when response.comment_needed is true (clear violations found)
- Includes proper error handling that doesn't break webhook if assignment fails
- Follows existing logging patterns for consistency
- Preserves existing webhook processing and AI review workflow
Co-Authored-By: Sahil Lavingia <sahil@gumroad.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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:
|
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.
Add GitHub API functionality to assign PRs back to creators when violations are found
Summary
This PR implements automatic PR assignment functionality that assigns pull requests back to their creators when the AI analysis determines that the PR violates contributing guidelines. When Jacquez detects clear violations during the initial review process, it will now:
The assignment uses the GitHub API endpoint
POST /repos/{owner}/{repo}/issues/{issue_number}/assigneesand only triggers whenresponse.comment_neededis true (meaning the AI found clear guideline violations).Review & Testing Checklist for Human
Recommended test plan: Create a test PR that intentionally violates contributing guidelines in a repository where Jacquez is installed, then verify both the comment and assignment occur correctly.
Diagram
%%{ init : { "theme" : "default" }}%% graph TD webhook["app/api/webhook/<br/>route.ts"]:::major-edit handlePR["handlePullRequestOpened()<br/>function"]:::major-edit ai["generateFriendlyResponse()<br/>(AI analysis)"]:::context github["GitHub API<br/>POST /issues/assignees"]:::major-edit webhook --> handlePR handlePR --> ai ai --> |"comment_needed = true"| github 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
Link to Devin run: https://app.devin.ai/sessions/735a181caabd478a9ef93d22fc28f4bd
Requested by: Sahil Lavingia (@slavingia)