[Feature] : API ENDPOINTS PR 5 : Result Data and Baseline Approval#1134
Open
pulk17 wants to merge 7 commits into
Open
[Feature] : API ENDPOINTS PR 5 : Result Data and Baseline Approval#1134pulk17 wants to merge 7 commits into
pulk17 wants to merge 7 commits into
Conversation
58a125b to
bc5b0ea
Compare
|
This was referenced Jun 29, 2026
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.



[FEATURE]
In raising this pull request, I confirm the following (please check boxes):
My familiarity with the project is as follows (check one):
Results data and baseline approvals (PR 5/6)
Summary
Part 5 of 6 (supersedes #1117). Exposes raw expected/actual output,
structured/unified diffs, and the baseline-approval workflow.
Endpoints (
mod_api/routes/results.py)Output/diff routes are keyed by run → sample → regression test → output:
GET …/regression-tests/{regression_id}/outputs/{output_id}/expected—expected file (
?format=base64|text; 1 MiB inline cap withdownload_url+sha256 for larger).
results:read.…/outputs/{output_id}/actual— actual output;got=null(matched expected)→ 303 to
/expected; the missing-output sentinel → 404.results:read.…/outputs/{output_id}/diff—?format=structured(default; capped line-levelhunks) or
unified. Files > 10 MiB → 422 withdownload_url.results:read.POST /runs/{run_id}/samples/{sample_id}/baseline-approval— admin +baselines:write. Repoints the regression test's expected hash to the run'sactual output (after verifying the file exists in storage);
remove_variants= truedrops platform variants. Every approval is audit-logged (approver,old/new hash, remove_variants).
Service / schemas
services/diff_service.pyhandles reading, decoding (UTF-8 with cp1252fallback), and unified→structured diff generation, with size/hunk/line caps.
schemas/results.pyadds nested result/diff/approval schemas.Testing
168 tests; storage backends mocked for both local and GCS; baseline-approval
permission boundaries asserted. Lint/type clean.
Next
PR 6 (#1135): errors, logs, and the OpenAPI document.