Skip to content

fix(preprod): Return snapshot state as enum name string - #123264

Open
NicoHinderling wants to merge 1 commit into
perf/preprod-snapshot-details-dict-serializationfrom
fix/preprod-snapshot-state-name
Open

fix(preprod): Return snapshot state as enum name string#123264
NicoHinderling wants to merge 1 commit into
perf/preprod-snapshot-details-dict-serializationfrom
fix/preprod-snapshot-state-name

Conversation

@NicoHinderling

@NicoHinderling NicoHinderling commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Summary

Stacked on #123239. The snapshot-details GET response serialized state as
the raw ArtifactState int (e.g. 1), even though the OpenAPI examples
("state": "UPLOADED") and the frontend state: string type both expect the
enum name. Emit ArtifactState(artifact.state).name instead, matching the
existing installable_builds.py convention and aligning runtime with the
schema.

Blast radius

  • Frontend: already types state as string and never branches on it
    (state-based UI reads comparison_state), so no frontend change is needed.
  • Examples/schema: already string; the examples validator now agrees with
    runtime.

Testing

  • pytest .../test_preprod_artifact_snapshot.py (57 passed)
  • make build-api-docs && pnpm run validate-api-examples → No errors found
  • mypy + ruff clean

https://claude.ai/code/session_013SAxBGjuP4a7cxRx3WmZa4

The snapshot-details endpoint emitted the raw `ArtifactState` int (e.g.
`1`), but the documented examples and the frontend `state: string` type
both expect the enum name. Serialize `state` as `ArtifactState(...).name`
(e.g. `"UPLOADED"`), matching the existing convention in
`installable_builds.py` and aligning runtime with the OpenAPI contract.

Regenerate the golden fixtures and update the endpoint test accordingly.

Claude-Session: https://claude.ai/code/session_013SAxBGjuP4a7cxRx3WmZa4
@NicoHinderling
NicoHinderling requested a review from a team as a code owner August 31, 2026 22:33
@github-actions github-actions Bot added the Scope: Backend Automatically applied to PRs that change backend components label Aug 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Backend Automatically applied to PRs that change backend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants