Skip to content

run: separate run/result API modules and align contracts#324

Open
ol-zayatsm wants to merge 5 commits into
ts-factory:mainfrom
ol-zayatsm:run_services_update
Open

run: separate run/result API modules and align contracts#324
ol-zayatsm wants to merge 5 commits into
ts-factory:mainfrom
ol-zayatsm:run_services_update

Conversation

@ol-zayatsm

@ol-zayatsm ol-zayatsm commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

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

  • Fix all to __all__ in a separate preparatory commit.
  • Move RunViewSet and ResultViewSet into separate run and result
    API modules.
  • Add run API serializers for converting service DTOs to response
    dictionaries.
  • Remove unused run list serialization helper.
  • Add explicit Swagger serializers and schema decorators for run and
    result endpoints.

Validation

  • Checked that old api_v2.results imports are gone.
  • Checked that serialize_run_list_result did not return.
  • Syntax-checked touched Python files.

@ol-zayatsm ol-zayatsm marked this pull request as draft June 1, 2026 08:05
@ol-zayatsm ol-zayatsm force-pushed the run_services_update branch from 47598e7 to 7d97913 Compare June 3, 2026 18:50
Comment thread bublik/interfaces/run_serializers.py Outdated
}


def serialize_run_list_result(result: RunListResult):

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@ol-zayatsm ol-zayatsm force-pushed the run_services_update branch from 7d97913 to 008f08d Compare June 15, 2026 17:26
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>
@ol-zayatsm ol-zayatsm force-pushed the run_services_update branch from 008f08d to 7f3b788 Compare June 15, 2026 20:22
@ol-zayatsm ol-zayatsm marked this pull request as ready for review June 15, 2026 20:32
@ol-zayatsm ol-zayatsm changed the title run: isolate API serialization from run service results run: separate run/result API modules and align contracts Jun 16, 2026
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>
@ol-zayatsm ol-zayatsm force-pushed the run_services_update branch from 7f3b788 to dd7e981 Compare June 17, 2026 20:22
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.

2 participants