[Feature] : API ENDPOINTS PR 6 : Errors, Logs, and OpenAPI Documentation#1135
Open
pulk17 wants to merge 9 commits into
Open
[Feature] : API ENDPOINTS PR 6 : Errors, Logs, and OpenAPI Documentation#1135pulk17 wants to merge 9 commits into
pulk17 wants to merge 9 commits into
Conversation
|
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.



Please prefix your pull request with one of the following: [FEATURE] [FIX] [IMPROVEMENT].
In raising this pull request, I confirm the following (please check boxes):
My familiarity with the project is as follows (check one):
{pull request content here}# Feature: Errors, Logs, and OpenAPI Documentation (PR 6/6)
Executive Summary
This Pull Request is Part 6 of 6, marking the grand finale of the JSON REST API initiative! 🎉
This final piece introduces the endpoints necessary for diagnosing deep CI failures: the Errors & Logs services. It allows clients to query infrastructure errors, summarize failure metrics, and cleanly paginate through massive standard output logs without crashing the server.
Most importantly, it introduces the OpenAPI 3.1 Specification (
openapi-ci-api.yaml), which fully documents the 25+ endpoints we have built across the previous 5 PRs, acting as the official contract for the platform.Architectural Additions & Enhancements
1. Errors & Logs Endpoints (
mod_api/routes/errors_logs.py)Mounted at
/api/v1/runs, this router finishes the diagnostic capabilities:GET /runs/<run_id>/errors: Fetches all structured test failures for a run, with extensive filtering (e.g.,?category=infrastructure,?test_id=10).GET /runs/<run_id>/infrastructure-errors: Dedicated endpoint to pull critical platform-level faults (e.g., Out Of Memory, Network Timeouts) that ruined a CI run but aren't strictly algorithmic regressions.GET /runs/<run_id>/error-summary: Aggregates and buckets errors by type/code, allowing the UI to render charts (e.g., "50 tests failed due to 'Missing Output'").GET /runs/<run_id>/logs&/runs/<run_id>/samples/<sample_id>/logs: Exposes cursor-paginated access to the raw runnerstdout/stderrlogs (powered by the newlog_service).2. Log Service (
mod_api/services/log_service.py).logfiles off disk/storage without loading them entirely into memory.3. API Contract & Documentation
openapi-ci-api.yaml: The definitive OpenAPI specification. Documents every route, expected status code, parameter, JSON schema, and OAuth2/Bearer Token security definition.verify_schemathesis.py: A massive 900+ line property-based testing suite utilizingschemathesisto formally verify that our actual API endpoints strictly adhere to the rules defined in our OpenAPI spec.Testing & Quality Assurance
verify_schemathesis.pytest script performs rigorous stateful fuzz-testing against the endpoints using the OpenAPI spec as its rulebook. (Note: Since it requiresschemathesisandhypothesisdependencies, it is currently intended to be run manually/separately, and is deliberately not auto-collected by standardpytest).isort,pydocstyle,pycodestyle, andmypypass perfectly across the entiremod_api/andtests/api/directories.Conclusion
With this PR, the core CI Platform API is structurally complete! Clients, runners, and automated bots can now fully orchestrate the CI pipeline natively via HTTP/JSON. Thank you to all the reviewers who have pushed through these 6 PRs!