run: separate run/result API modules and align contracts#324
Open
ol-zayatsm wants to merge 5 commits into
Open
run: separate run/result API modules and align contracts#324ol-zayatsm wants to merge 5 commits into
ol-zayatsm wants to merge 5 commits into
Conversation
47598e7 to
7d97913
Compare
ol-nata
suggested changes
Jun 9, 2026
| } | ||
|
|
||
|
|
||
| def serialize_run_list_result(result: RunListResult): |
Collaborator
There was a problem hiding this comment.
serialize_run_list_result is defined but never used. It could replace the manual response construction in RunViewSet.list, but that would require switching from the DRF paginator to RunService.list_runs. Either wire it up or remove it.
7d97913 to
008f08d
Compare
The API module intended to declare public exports, but used a plain all variable instead of Python's __all__ convention. Fix the export declaration separately so later run and result API refactors do not carry an unrelated module-level cleanup. Signed-off-by: Mikhail Zayats <mikhail.zayats@oktetlabs.ru>
008f08d to
7f3b788
Compare
Split run and result API views into dedicated modules to keep entity-specific code isolated and easier to evolve independently. Signed-off-by: Mikhail Zayats <mikhail.zayats@oktetlabs.ru>
Replace dict-based service responses with typed DTOs to introduce explicit and structured data contracts across service boundaries and move serialization to API/MCP boundary to improve separation of concerns between service layer and API/MCP layers. Signed-off-by: Mikhail Zayats <mikhail.zayats@oktetlabs.ru>
Ensure consistency between OpenAPI schemas and API responses by introducing explicit request/response serializers and binding them via drf-spectacular. Signed-off-by: Mikhail Zayats <mikhail.zayats@oktetlabs.ru>
Ensure consistency between OpenAPI schemas and API responses by introducing explicit request/response serializers and binding them via drf-spectacular. Signed-off-by: Mikhail Zayats <mikhail.zayats@oktetlabs.ru>
7f3b788 to
dd7e981
Compare
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.
Summary
Split run and result API code into separate modules before applying the
run serialization and Swagger contract updates.
This PR also fixes the API module export declaration in its own commit,
keeps run service DTOs behind explicit API serializers, and updates the
OpenAPI contracts so documented request/response schemas match the
actual API payloads.
Changes
allto__all__in a separate preparatory commit.RunViewSetandResultViewSetinto separaterunandresultAPI modules.
dictionaries.
result endpoints.
Validation
api_v2.resultsimports are gone.serialize_run_list_resultdid not return.