Skip to content

Conversation

@suhaibmujahid
Copy link
Member

@suhaibmujahid suhaibmujahid commented Oct 21, 2025

Resolves #1718

Introduces a new /patch/<base_rev>/<patch_hash>/schedules endpoint to submit and retrieve test selection results for patches.

@suhaibmujahid suhaibmujahid requested a review from Copilot October 21, 2025 21:39
Copy link

Copilot AI left a 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_tests to use a new shared analyze_patch function
  • Added schedule_tests_from_patch function 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, added schedule_tests_from_patch to process patches from Redis, and updated imports
http_service/bugbug_http/app.py Added /patch/<base_rev>/<patch_hash>/schedules endpoint 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
Copy link
Member Author

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Define an API to select tests POSTing the contents of a patch

1 participant