Skip to content

[Feature] : API ENDPOINTS PR 5 : Result Data and Baseline Approval#1134

Open
pulk17 wants to merge 7 commits into
CCExtractor:masterfrom
pulk17:api-pr5-results
Open

[Feature] : API ENDPOINTS PR 5 : Result Data and Baseline Approval#1134
pulk17 wants to merge 7 commits into
CCExtractor:masterfrom
pulk17:api-pr5-results

Conversation

@pulk17

@pulk17 pulk17 commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

[FEATURE]

In raising this pull request, I confirm the following (please check boxes):

  • I have read and understood the contributors guide.
  • I have checked that another pull request for this purpose does not exist.
  • I have considered, and confirmed that this submission will be valuable to others.
  • I accept that this submission may not be used, and the pull request closed at the will of the maintainer.
  • I give this submission freely, and claim no ownership to its content.

My familiarity with the project is as follows (check one):

  • I have never used the project.
  • I have used the project briefly.
  • I have used the project extensively, but have not contributed previously.
  • I am an active contributor to the project.

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.

Stacking: stacked on PR 4 (#1133). Please review #1133 first.

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 with download_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-level
    hunks) or unified. Files > 10 MiB → 422 with download_url. results:read.
  • POST /runs/{run_id}/samples/{sample_id}/baseline-approvaladmin +
    baselines:write.
    Repoints the regression test's expected hash to the run's
    actual output (after verifying the file exists in storage); remove_variants= true drops platform variants. Every approval is audit-logged (approver,
    old/new hash, remove_variants).

Service / schemas

services/diff_service.py handles reading, decoding (UTF-8 with cp1252
fallback), and unified→structured diff generation, with size/hunk/line caps.
schemas/results.py adds 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.

@pulk17 pulk17 force-pushed the api-pr5-results branch 7 times, most recently from 58a125b to bc5b0ea Compare June 26, 2026 15:56
@pulk17 pulk17 force-pushed the api-pr5-results branch from bc5b0ea to 05e55cc Compare June 27, 2026 07:43
@sonarqubecloud

Copy link
Copy Markdown

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.

1 participant