Skip to content

fix(deploy): publish backend release provenance from the deployed artifact - #11841

Merged
Git-on-my-level merged 1 commit into
mainfrom
fix/backend-release-sha-provenance
Aug 19, 2026
Merged

Git-on-my-level merged 1 commit into
mainfrom
fix/backend-release-sha-provenance

Conversation

@Git-on-my-level

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

Copy link
Copy Markdown
Member

The defect

google-github-actions/deploy-cloudrun stamps a commit-sha label from GITHUB_SHA — the ref the workflow run was triggered on. A pinned deploy checks out and builds release_sha. Those differ on exactly the deploys that were deliberate, so the label names a commit that was never deployed.

Measured on the 2026-08-19 production deploy of backend, dispatched with release_sha=2ebef0dc12:

Marker Value Derived from Truthful
revision name backend-2ebef0d-… 2ebef0dc12 git rev-parse --short=7 HEAD after checkout yes
image tag gcr.io/…/backend:2ebef0d 2ebef0dc12 same short SHA yes
commit-sha label b27420e01c GITHUB_SHA no

b27420e01c was main HEAD when the run was dispatched. It was never built and never deployed.

Why this is worse than publishing nothing

commit-sha is the first marker an operator reads to answer "what is running in production". During the 2026-08-19 incident it produced two reversals in one session: first the conclusion that production carried five commits it did not, then a latency improvement re-attributed to #11830 — a fix that was not actually deployed. The truthful signals (revision-name suffix, image tag) sat unread beside it, because nobody reaches for an image digest when a field literally named commit-sha is present.

desktop-backend was unaffected: it already publishes OMI_DESKTOP_BACKEND_RELEASE_SHA from its admitted source SHA, and reading that env var resolved the same incident in one query.

The fix

Propagate the pattern that already works, and prove it:

  1. OMI_BACKEND_RELEASE_SHA is published on the backend Cloud Run service from inputs.admitted_sha — the release_sha that verify_backend_release_admission.py validated as an ancestor of main and that the job checked out. True by construction.
  2. A post-deploy readback describes the revision that was actually created, extracts the marker, and fails the deploy on mismatch. An untrue provenance marker now stops the release rather than outliving it.

The misleading commit-sha label cannot be suppressed from inside the action, so this adds a marker that is correct rather than trying to correct one that is structurally wrong. The failure-class definition records that asymmetry so the next person does not read the label and re-derive the same wrong answer.

Scope

backend only, matching the service the incident touched. backend-sync, backend-sync-backfill and backend-integration deploy through the same action and have the same gap — deliberately left for a follow-up rather than widening a production deploy path in one change. A per-service serving-SHA drift view is the natural next step, and it is only meaningful once the markers it reads are trustworthy.

Verification

  • jq extraction expression validated against a live revision: returns b27420e01cd7a48cecc7f75107895feb45dafcc9 from desktop-backend-b27420e01cd7-32203390739-1
  • YAML parses; the readback is a single piped line, so it cannot break the block scalar the way an inline heredoc did
  • make preflight green

Failure-Class: new

Review in cubic

…ifact

deploy-cloudrun stamps a commit-sha label from GITHUB_SHA, the ref the run was
triggered on, while a pinned deploy checks out and builds release_sha. The two
differ on exactly the deploys that were deliberate, so the label names a commit
that was never deployed.

The 2026-08-19 production deploy of backend was dispatched with
release_sha=2ebef0dc12. The revision name and image tag both read 2ebef0d,
derived from the checked-out SHA and correct. The commit-sha label read
b27420e, which was main HEAD at dispatch and was never built. Because
commit-sha is the field an operator reads first, that produced two wrong
conclusions in one incident: that production carried five commits it did not,
and that a latency improvement came from a fix that was not deployed.

backend now publishes OMI_BACKEND_RELEASE_SHA from the admitted release SHA,
mirroring desktop-backend, which was unaffected precisely because it already
did. A post-deploy step reads the marker back off the revision that was
created and fails the deploy on mismatch, so an untrue provenance marker stops
the release instead of outliving it.

The misleading label cannot be suppressed from inside the action, so this adds
a marker that is correct rather than correcting one that is structurally wrong.

Co-Authored-By: Claude Opus 5 <[email protected]>
@Git-on-my-level
Git-on-my-level force-pushed the fix/backend-release-sha-provenance branch from 86a05b7 to e781359 Compare August 19, 2026 03:04
@Git-on-my-level
Git-on-my-level merged commit cd8502a into main Aug 19, 2026
28 checks passed
@Git-on-my-level
Git-on-my-level deleted the fix/backend-release-sha-provenance branch August 19, 2026 04:08
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