Repository navigation
[v5] Add a batch resolution endpoint for regressions - #678
Open
NopeCharon wants to merge 1 commit into
Open
NopeCharon wants to merge 1 commit into
NopeCharon wants to merge 1 commit into
Conversation
The indicator lookup (`POST .../regressions/indicators/query`) returns
each indicator with only the UUID of its regression. A client that needs
the title, state or commit of the regressions it found had to fetch each
one's detail, or walk `GET /regressions` and join on the UUID.
Add `POST /api/projects/{project}/suites/{suite}/regressions/resolve`,
modelled on `POST .../commits/resolve` (E3). The body is
`{"regressions": ["<uuid>", ...]}`, from 1 to I2's maximum page size
UUIDs, matched case-insensitively and deduplicated. The response is
`{"results": {...}, "not_found": [...]}`: `results` maps each UUID that
was found (in lowercase) to the regression as the list returns it, and
UUIDs that match no regression are reported in `not_found` rather than
answered with a 404, so a client resolving the results of an earlier
lookup can simply drop ones deleted in between. A NUL in a UUID is still
a 400, as everywhere else (D5).
The endpoint is `read`-scoped and not paginated, as the response is
bounded by the request. The lookup binds the UUIDs as a single array
parameter, so the statement text, and the driver's prepared-statement
cache entry, are the same whatever the size of the request.
The results carry `machine_count` and `test_count`, as the list items
do: the request body names the regressions, so there is no request-level
filter for the counts to disagree with.
The design document (E8), `llms.txt` and the client's generated API types
are updated, and the endpoint is covered by tests for the response shape,
case-insensitive matching, deduplication and ordering, `not_found`, the
request bounds, the NUL rejection, the single prepared statement, the
missing suite, and the lack of a credential requirement.
Fixes llvm#305
This branch has not been deployed
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.
Fixes #305.
Adds
POST /api/projects/{project}/suites/{suite}/regressions/resolve, modelled onPOST .../commits/resolve(E3), so a client holding the regression UUIDs returned by the indicator lookup can read their title, state and commit in one request.{"regressions": ["<uuid>", ...]}: 1 to I2's maximum page size UUIDs, matched case-insensitively, duplicates ignored.{"results": {"<uuid>": {...}}, "not_found": [...]}. Each result is a regression as the list returns it (so it includesmachine_countandtest_count, which the issue left open; there is no request-level filter for them to disagree with). UUIDs that match no regression are reported innot_foundinstead of a 404. A NUL in a UUID is still a 400 (D5).readscope, not paginated. The UUIDs are bound as one array parameter, so the statement text is the same whatever the request size (as for commits).llms.txt, and the generated client types (schema.d.ts).I did not switch the Graph's regression annotations (GR12/GR14) over to the new endpoint; that can be a follow-up.
Tests (
test_regressions.py,test_docs.py): response shape equal to the list item, nonotes/indicators, case-insensitive match, dedupe and request order,not_found, over-long values, NUL, size bounds, invalid bodies, no credential needed, one statement for any request size, unknown suite, and the OpenAPI document checks (documented operation, 404/409, request example, response samples).Checked locally against PostgreSQL 18:
ruff check,ruff format --check,mypy,test_regressions.py(226 passed),test_docs.py, the OpenAPI generation, andschema.d.tsregenerated with openapi-typescript.