Skip to content

fix(deploy): select desktop-backend's runtime image by container name - #12156

Merged
Git-on-my-level merged 1 commit into
mainfrom
fix/desktop-lineage-multicontainer-digest
Aug 24, 2026
Merged

Git-on-my-level merged 1 commit into
mainfrom
fix/desktop-lineage-multicontainer-digest

Conversation

@Git-on-my-level

@Git-on-my-level Git-on-my-level commented Aug 24, 2026 •

Copy link
Copy Markdown
Member

Summary

desktop_backend_auto_dev.yml and desktop_backend_prod.yml sourced the desktop-backend
candidate's runtime image reference from gcloud run revisions describe --format='value(status.imageDigest)'. That field is the legacy single-container scalar
in the Cloud Run v1 Revision API — RevisionStatus has no per-container digest map, so
it is empty on any multi-container revision.

PR #11998 attached a Managed Prometheus collector sidecar to every desktop-backend
candidate, making them two-container revisions. Since then the field has come back
empty and the lineage guard has failed closed on every candidate with:

desktop-backend image lineage verification failed: image reference must use an exact sha256 digest: ''

Dev desktop-backend has not deployed since 2026-08-22T19:26:45Z as a result.

The guard itself is correct — it should fail closed on an unproven image. The bug is
that its input went missing, not that the check is wrong.

Fix

Both workflows now extract the runtime image from gcloud run revisions describe --format=json by selecting the container named desktop-backend-1, and assert there
is exactly one such container with a non-empty string image — so the check still fails
closed if the container topology becomes ambiguous again, instead of silently reading
an empty scalar.

This was verified against the live dev revision
desktop-backend-4b8636e55fcf-32744822554-1: the old field returned empty, the new
extraction returns
gcr.io/based-hardware-dev/desktop-backend@sha256:b6c51555ebd7274728ccb79e0f2957fd1f6761d469aa51d5eb999d2debc6b706.

This is not a tautology: verify_desktop_backend_image_lineage.py independently
derives the expected linux/amd64 child digest from the registry index and compares it
against this container's spec image, so the real lineage property is still proven.

Test plan

  • .github/scripts/test_check_desktop_backend_release_policy.py — added
    test_neither_deploy_workflow_reads_the_legacy_single_container_digest_field (both
    workflows no longer reference the legacy field and both select
    desktop-backend-1 by name), plus
    test_runtime_image_filter_selects_desktop_backend_container_on_two_container_revision
    and test_runtime_image_filter_rejects_missing_or_duplicated_desktop_backend_container,
    which extract each workflow's actual jq filter and run it against realistic
    two-container Revision JSON (desktop-backend-1 + collector, status.imageDigest
    absent) to prove the extraction selects the right image and still fails closed on a
    missing/duplicated/empty container.
  • actionlint on both modified workflow files.
  • Full local run of .github/scripts/test_check_desktop_backend_release_policy.py
    (30/30 passing).
  • Dev desktop_backend_auto_dev.yml run on the merge commit — watched end to end
    after merge.

Product invariants affected

  • INV-DATA-1: this is a deploy-verification path, not a data-plane routing change —
    no serving-plane selection is touched. Naming it here because the guard exists to
    prove the digest running in a given environment is the one actually built, which
    underpins the continuity guarantee INV-DATA-1 depends on; the fix restores that proof
    rather than weakening it.

Failure-Class: FC-config-target-identified-by-count-not-identity

Review in cubic

…, not the empty single-container digest field

status.imageDigest is the legacy single-container scalar in the Cloud Run v1
Revision API and comes back empty on any multi-container revision. The
Managed Prometheus sidecar (#11998) made every desktop-backend candidate
two-container, so the field went empty and image lineage verification has
failed closed on every dev/prod candidate since. Extract the runtime image
from the named desktop-backend-1 container instead, asserting exactly one
match so the guard still fails closed on an ambiguous topology.

Co-Authored-By: Claude Opus 5 <[email protected]>
@Git-on-my-level
Git-on-my-level merged commit ee92868 into main Aug 24, 2026
39 checks passed
@Git-on-my-level
Git-on-my-level deleted the fix/desktop-lineage-multicontainer-digest branch August 24, 2026 17:03
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.

1 participant