bugbug
bugbug copied to clipboard
Define an API to select tests POSTing the contents of a patch
This way we can:
- Start the test selection jobs even earlier than now (currently we start them after a Mercurial push);
- Run the selector locally without a push to try (to select tests to run locally).
@anooptp since you worked on #2655, this might be interesting for you (beware: it is a more difficult task).
Thank you @marco-c for letting me know. I will surely look into this. Could you please provide more details on the requirement. Thank you.
The first step will be to define a new API in http_service/bugbug_http/app.py, similar to https://github.com/mozilla/bugbug/blob/9c57dbc93227b4a2db218f60cb4cf7c1d0c07fe9/http_service/bugbug_http/app.py#L725. It should be a POST API though instead of GET, and the body of the post will be the contents of a patch.
The API will submit a job to the background worker, and the job will have to be implemented in http_service/bugbug_http/models.py similarly to https://github.com/mozilla/bugbug/blob/9c57dbc93227b4a2db218f60cb4cf7c1d0c07fe9/http_service/bugbug_http/models.py#L178. The main difference with this code will be that instead of just pulling a revision from the repo (https://github.com/mozilla/bugbug/blob/9c57dbc93227b4a2db218f60cb4cf7c1d0c07fe9/http_service/bugbug_http/models.py#L187), we will also apply the patch that was passed through the API.
I can help you more once you start implementing it (start with the API side in app.py) and you have specific questions about the implementation.
@marco-c Thanks for the details.