Skip to content

fix(BA-5963): resolve current_revision_id by explicit match, not list[0]#11494

Draft
jopemachine wants to merge 3 commits intomainfrom
fix/BA-5963-current-revision-id-mismatch
Draft

fix(BA-5963): resolve current_revision_id by explicit match, not list[0]#11494
jopemachine wants to merge 3 commits intomainfrom
fix/BA-5963-current-revision-id-mismatch

Conversation

@jopemachine
Copy link
Copy Markdown
Member

@jopemachine jopemachine commented May 6, 2026

Summary

  • _convert_deployment_info_to_data picked info.model_revisions[0] as the current revision spec. During a rolling update the list also contains the deploying revision, and PostgreSQL returned them in undefined order, so the API could expose the deploying revision id under current_revision_id (or null when downstream adapters derived the id from data.revision.id).
  • Match the spec by info.current_revision_id directly in services/deployment/service.py; add order_by="DeploymentRevisionRow.revision_number" on EndpointRow.revisions for deterministic iteration in any other caller.
  • Carry current_revision_id through the data layer (ModelDeploymentData.current_revision_id) and read it from there in the GraphQL/REST v2 adapter, instead of recomputing it from data.revision.id. This stops the API from collapsing to null when the matching ModelRevisionSpec can't be resolved (e.g. dangling endpoints.current_revision after a revision row was removed) — the column value now flows straight through.

Resolves BA-5963.

jopemachine and others added 2 commits May 6, 2026 18:33
`_convert_deployment_info_to_data` picked `info.model_revisions[0]` as the
current revision. During a rolling update the list contains both current
and deploying revisions, and PostgreSQL returned them in undefined order
because `EndpointRow.revisions` had no `order_by`, so `current_revision_id`
in REST/GraphQL responses could be reported as the deploying revision id —
or as null when downstream adapters derived it from `data.revision.id`.

Match the spec by `info.current_revision_id` directly, and add `order_by`
on the `revisions` relationship for deterministic iteration in any other
caller.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@github-actions github-actions Bot added size:S 10~30 LoC comp:manager Related to Manager component labels May 6, 2026
Stop deriving the API's `current_revision_id` from `data.revision.id`,
which fell through to `null` whenever the matching `ModelRevisionSpec`
could not be resolved (e.g. dangling `endpoints.current_revision`
pointing at a removed `deployment_revisions` row — a real path observed
in the field after replica/revision cleanup).

Carry the column value through the data layer: `ModelDeploymentData`
now has its own `current_revision_id`, populated from
`info.current_revision_id` in the service layer, and the GraphQL/REST v2
adapter reads it directly. Identity is now decoupled from the spec, so
the API mirrors the DB column even when the spec lookup fails.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@github-actions github-actions Bot added size:M 30~100 LoC and removed size:S 10~30 LoC labels May 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp:manager Related to Manager component size:M 30~100 LoC

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant