- 
                Notifications
    You must be signed in to change notification settings 
- Fork 315
Add patch-based test selection API endpoint #5366
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds a new API endpoint /patch/<base_rev>/<patch_hash>/schedules that enables test selection analysis for arbitrary patches. The implementation extracts common test selection logic into a reusable analyze_patch function and introduces functionality to parse patch files and generate minimal commit objects for analysis.
Key changes:
- Refactored schedule_teststo use a new sharedanalyze_patchfunction
- Added schedule_tests_from_patchfunction to handle patch-based test selection
- Implemented new REST endpoint supporting both GET and POST methods for patch submission and result retrieval
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 5 comments.
| File | Description | 
|---|---|
| http_service/bugbug_http/models.py | Refactored test selection logic into analyze_patch, addedschedule_tests_from_patchto process patches from Redis, and updated imports | 
| http_service/bugbug_http/app.py | Added /patch/<base_rev>/<patch_hash>/schedulesendpoint with GET/POST handlers, patch storage in Redis, and job scheduling | 
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| description: Get results of patch-based test selection. | ||
| summary: Get test selection results for a previously submitted patch. | ||
| parameters: | ||
| - name: base_rev | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We are currently not pulling the repo, so base_rev is not used at the moment. If we end up with that, we should remove it before merging.
Introduces a new /patch/<base_rev>/<patch_hash>/schedules endpoint to submit and retrieve test selection results for patches.
9f6f2d1    to
    476e6ed      
    Compare
  
    
Resolves #1718
Introduces a new /patch/<base_rev>/<patch_hash>/schedules endpoint to submit and retrieve test selection results for patches.