CCExtractor / CCExtractor/sample-platform
[PROPOSAL] Add versioned REST API endpoints for test results for NG frontend
- Vorherrschende Sprache
- Python
- Sterne
- 30
- Forks
- 85
- Ø Merge
- 6 T. 21 Std.
- Gemergte PRs (30 T.)
- 12
Beschreibung
## [PROPOSAL] Add versioned REST API endpoints for test results to support Sample Platform NG frontend
### Problem
The current platform primarily serves HTML pages and has very limited API surface. The NG frontend direction needs stable, versioned JSON endpoints for test summary/results/files/progress and category metadata.
### Proposed endpoints
- `GET /api/v1/tests//summary`
- `GET /api/v1/tests//results`
- `GET /api/v1/tests//files`
- `GET /api/v1/tests//progress`
- `GET /api/v1/categories`
### Proposed implementation notes
- Introduce a dedicated `mod_api` blueprint.
- Reuse existing model/controller logic where possible to avoid behavior drift.
- Return structured JSON with consistent status envelope and 404 handling for missing tests.
- Add focused API tests for success and not-found paths.
### Why this is valuable
- Unblocks frontend/API decoupling for NG work.
- Creates a clear contract for external consumers and automation.
- Reduces coupling to server-rendered templates.
### Verification plan
- Add integration tests under `tests/test_api/`.
- Validate endpoint behavior locally with `nose2` test suite.
---
**In raising this issue, I confirm the following (please check boxes, eg [X]):**
- [X] I have read and understood the [contributors guide](https://github.com/CCExtractor/sample-platform/blob/master/.github/CONTRIBUTING.md).
- [X] I have checked that the bug-fix I am reporting can be replicated, or that the feature I am suggesting isn't already present.
- [X] I have checked that the issue I'm posting isn't already reported.
- [X] I have checked that the issue I'm posting isn't already solved and no duplicates exist in [closed issues](https://github.com/CCExtractor/sample-platform/issues?q=is%3Aissue+is%3Aclosed) and in [opened issues](https://github.com/CCExtractor/sample-platform/issues)
- [X] I have checked the pull requests tab for existing solutions/implementations to my issue/suggestion.
**My familiarity with the project is as follows (check one, eg [X]):**
- [ ] I have never visited/used the platform.
- [ ] I have used the platform just a couple of times.
- [X] I have used the platform extensively, but have not contributed previously.
- [ ] I am an active contributor to the platform.
---
Beitragsleitfaden
Rechercherichtung
Beginnen Sie mit der Überprüfung der vorhandenen Model- und Controller-Logik und bestimmen Sie anschließend, wie das vorgeschlagene mod_api-Blueprint in die Anwendung passt. Fügen Sie die versionierten Endpunkte für Testergebnisse und Kategorien mit konsistenten JSON-Antworten und einer Behandlung fehlender Tests hinzu. Fügen Sie Integrationstests für erfolgreiche und nicht gefundene Ergebnisse unter tests/test_api/ hinzu und führen Sie die nose2-Testsuite aus.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- python
- Bereich
- api, backend
- Issue-Typ
- Feature
- Schwierigkeit
- 5/5
- Geschätzter Aufwand
- Über eine Woche
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 35/100