[Feature] : API ENDPOINTS PR 6 : Errors, Logs, and OpenAPI Documentation#1135
Open
pulk17 wants to merge 6 commits into
Open
[Feature] : API ENDPOINTS PR 6 : Errors, Logs, and OpenAPI Documentation#1135pulk17 wants to merge 6 commits into
pulk17 wants to merge 6 commits into
Conversation
pulk17
requested review from
canihavesomecoffee and
thealphadollar
as code owners
June 24, 2026 11:38
pulk17
force-pushed
the
api-pr6-swagger
branch
5 times, most recently
from
June 27, 2026 16:00
439ae42 to
f7dd2fa
Compare
9 tasks
9 tasks
|
This was referenced Jul 20, 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):
Overview
Sixth PR of the CI API stack (#1130 → #1141, merge bottom-up). The debugging surface — structured errors and raw logs — plus the OpenAPI contract for the whole API and a contract-test suite that validates the implementation against it.
Endpoints
GET /runs/{id}/errors— one structured ErrorItem per detected failure:exit_code_mismatch,diff_mismatch, ormissing_output, each with severity, ids, and a human-readable message. There's no error table in the schema — errors are derived from result rows, using the same derivation as/runs/{id}/summary, so the two can never disagree on counts.GET /runs/{id}/error-summary— the same errors bucketed by?group_by=type|sample_id|severity, with per-bucket counts, worst-seen severity, and first/last-seen timestamps. Useful for "what kind of failure dominates this run".GET /runs/{id}/infrastructure-errors— best-effort classification of canceled-run progress messages (VM provisioning, checkout, build, worker, storage). Explicitly excludes user-initiated cancellations. Best-effort because the CI worker has no structured error protocol yet — this is honest keyword matching, labeled as such.GET /runs/{id}/logsandGET /runs/{id}/samples/{sid}/logs— build and per-sample logs with cursor pagination (cursor = line offset; valid because logs are append-only). Log reads fall back utf-8 → cp1252 witherrors='replace', so a stray byte can't 500 the endpoint.The contract
openapi-ci-api.yamlis the source of truth for the API. It documents every endpoint, parameter, response shape, and error body in the stack. The yaml defines its own component schemas; marshmallow schemas exist in code only where routes actually serialize through them — there is deliberately no parallel shadow copy of the contract in Python.scripts/verify_schemathesis.pyruns property-based contract tests against the live app: broad fuzzing of every operation, per-endpoint response validation, negative auth testing (missing/invalid/expired/readonly tokens), and response invariants. It is not wired into CI — schemathesis is an unpinned, hypothesis-based dependency and would add flake risk to every PR. Run it locally:Testing
21 new tests; 185 total at this layer. Error derivation (rc mismatch, diff, missing output — with and without expected-output rows), summary bucketing and severity escalation, infra-error classification and the via-API exclusion, log pagination cursors, and encoding fallbacks.