Repository navigation
fix(ci): make development Pusher Firebase probe identity explicit - #13559
Conversation
There was a problem hiding this comment.
2 issues found across 4 files
Confidence score: 3/5
- In
.github/workflows/gcp_backend_pusher_auto_deploy.yml, rerunning the same workflow can collide with the first attempt’s immutable diagnostics artifact and fail before qualification is recorded; includegithub.run_idin the artifact name and otherwise make reruns unique. - In
.github/workflows/gcp_backend_pusher_auto_deploy.yml, the pre-publish validation can accept an invalid service-account local part when the suffix is approved, allowing deployment to proceed until IAM rejects it; validate the complete service-account format before deployment.
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name=".github/workflows/gcp_backend_pusher_auto_deploy.yml">
<violation number="1" location=".github/workflows/gcp_backend_pusher_auto_deploy.yml:92">
P2: When the environment value has an invalid service-account local part but the approved suffix, this wildcard passes and IAM rejects it only after deployment. Validate the complete service-account format in this prepublish gate.</violation>
<violation number="2" location=".github/workflows/gcp_backend_pusher_auto_deploy.yml:240">
P2: On a rerun of the same workflow run, this fixed artifact name collides with the first attempt’s immutable artifact, so the rerun fails at diagnostics instead of recording qualification. Include `github.run_id` and `github.run_attempt` in the artifact name to preserve each attempt’s evidence.</violation>
</file>
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
| if: always() | ||
| uses: actions/upload-artifact@v7 | ||
| with: | ||
| name: pusher-dev-probe-diagnostics |
There was a problem hiding this comment.
P2: On a rerun of the same workflow run, this fixed artifact name collides with the first attempt’s immutable artifact, so the rerun fails at diagnostics instead of recording qualification. Include github.run_id and github.run_attempt in the artifact name to preserve each attempt’s evidence.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At .github/workflows/gcp_backend_pusher_auto_deploy.yml, line 240:
<comment>On a rerun of the same workflow run, this fixed artifact name collides with the first attempt’s immutable artifact, so the rerun fails at diagnostics instead of recording qualification. Include `github.run_id` and `github.run_attempt` in the artifact name to preserve each attempt’s evidence.</comment>
<file context>
@@ -217,6 +233,17 @@ jobs:
+ if: always()
+ uses: actions/upload-artifact@v7
+ with:
+ name: pusher-dev-probe-diagnostics
+ path: |
+ pusher-dev-deployment-receipt.json
</file context>
| name: pusher-dev-probe-diagnostics | |
| name: pusher-dev-probe-diagnostics-${{ github.run_id }}-${{ github.run_attempt }} |
| case "$FIREBASE_PROBE_SIGNER_SERVICE_ACCOUNT" in | ||
| *@based-hardware.iam.gserviceaccount.com) ;; | ||
| *) | ||
| echo "FIREBASE_PROBE_SIGNER_SERVICE_ACCOUNT must belong to the based-hardware Firebase project." >&2 | ||
| exit 1 | ||
| ;; | ||
| esac |
There was a problem hiding this comment.
P2: When the environment value has an invalid service-account local part but the approved suffix, this wildcard passes and IAM rejects it only after deployment. Validate the complete service-account format in this prepublish gate.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At .github/workflows/gcp_backend_pusher_auto_deploy.yml, line 92:
<comment>When the environment value has an invalid service-account local part but the approved suffix, this wildcard passes and IAM rejects it only after deployment. Validate the complete service-account format in this prepublish gate.</comment>
<file context>
@@ -80,6 +80,23 @@ jobs:
+ echo "Development Pusher semantic probe requires FIREBASE_PROBE_SIGNER_SERVICE_ACCOUNT." >&2
+ exit 1
+ fi
+ case "$FIREBASE_PROBE_SIGNER_SERVICE_ACCOUNT" in
+ *@based-hardware.iam.gserviceaccount.com) ;;
+ *)
</file context>
| case "$FIREBASE_PROBE_SIGNER_SERVICE_ACCOUNT" in | |
| *@based-hardware.iam.gserviceaccount.com) ;; | |
| *) | |
| echo "FIREBASE_PROBE_SIGNER_SERVICE_ACCOUNT must belong to the based-hardware Firebase project." >&2 | |
| exit 1 | |
| ;; | |
| esac | |
| if [[ ! "$FIREBASE_PROBE_SIGNER_SERVICE_ACCOUNT" =~ ^[a-z][a-z0-9-]{4,28}[a-z0-9]@based-hardware\.iam\.gserviceaccount\.com$ ]]; then | |
| echo "FIREBASE_PROBE_SIGNER_SERVICE_ACCOUNT must belong to the based-hardware Firebase project." >&2 | |
| exit 1 | |
| fi |
…p GCP_SERVICE_ACCOUNT key staging (#14516) ## Failure-Class Failure-Class: none ## Summary Credential-rotation Phase C: makes the desktop-backend auto-dev release probe **JSON-free** — the last `secrets.GCP_SERVICE_ACCOUNT` consumption in the lane. The probe now signs Firebase custom tokens via IAM `signJwt` on the named signer (`vars.FIREBASE_PROBE_SIGNER_SERVICE_ACCOUNT` = `firebase-adminsdk-4z2mm@based-hardware`) instead of staging a base64 service-account key file in the runner. This is the Phase D gate item "desktop soak not JSON-free (probe B64 still staged)". ## Diff areas 1. `desktop_backend_auto_dev.yml`: delete the "Stage candidate probe signer" key-staging step; "Mint candidate probe identity" switches to `--signer-service-account "$FIREBASE_PROBE_SIGNER_SERVICE_ACCOUNT"` with a fail-closed empty-var check (env var sourced in the same step per the minter guard test); cleanup step drops the signer-file rm. 2. `check-desktop-backend-release-policy.py`: required fragments swap from key-staging markers to the named-signer contract (env mapping + flag + empty check). 3. `test_check_desktop_backend_release_policy.py`: fixtures updated; new negative guard asserting the workflow no longer references `secrets.GCP_SERVICE_ACCOUNT`. 4. `deploy-backend-stack/action.yml`: description/comments updated — desktop-backend moved to the named-signer path; `gcp_backend.yml`/`sync_ledger` still supply the credential (untouched behavior). ## Precedent The minter's `--signer-service-account` path is not new: #13559/#13667 landed it for the pusher dev lane (2026-09-13), green since. The IAM prerequisites already exist and are audit-verified: `FIREBASE_PROBE_SIGNER_SERVICE_ACCOUNT` set in env `development` (2026-09-16T04:21:46Z) and `roles/iam.serviceAccountTokenCreator` for `omi-ci-deployer-dev` bound on `firebase-adminsdk-4z2mm@based-hardware` by david@ at 2026-09-16T04:21:44Z (resource-level, token-signing only — no prod data access). See KB evidence 2026-09-18-iam-grants-and-rows-2-3. ## Verification - `test_firebase_release_probe_token.py` 19 passed (incl. workflow-signer guard tests) - `test_check_desktop_backend_release_policy.py` 37 passed + 58 subtests - workflow grep: zero `secrets.GCP_SERVICE_ACCOUNT` / `FIREBASE_PROBE_SIGNER_B64` / `DESKTOP_BACKEND_PROBE_SIGNER_FILE` - local `make preflight` green ## Risk / rollback If the IAM grant or var were missing, "Mint candidate probe identity" fails closed **before** traffic routing — dev keeps serving the prior revision; `candidate_only=true` dispatches skip the probe entirely and stay green. Rollback = single revert (the grant is inert without the flag). ## Product invariants affected - INV-DATA-1 Preserved: this PR changes only how the development desktop-backend release probe **authenticates its custom-token signing** (IAM signJwt on a named prod-project Firebase SA instead of a staged key file). It alters no routing authority, no serving endpoint, no Firebase/Firestore project binding; the probe still authenticates against `FIREBASE_AUTH_PROJECT_ID=based-hardware` exactly as before and still targets the 0%-traffic dev candidate. <!-- This is an auto-generated description by cubic. --> <a href="https://cubic.dev/pr/BasedHardware/omi/pull/14516?utm_source=github" target="_blank" rel="noopener noreferrer" data-no-image-dialog="true"><picture><source media="(prefers-color-scheme: dark)" srcset="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://www.cubic.dev/buttons/review-in-cubic-light.svg"><img alt="Review in cubic" src="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"></picture></a> <!-- End of auto-generated description by cubic. -->
Product invariants affected
Failure-Class: FC-release-probe-signer-identity
Summary
Use an explicitly named Firebase-project service account for the development Pusher semantic probe, reject cross-project remote signers, fail before publishing when signer configuration is missing or from the wrong project, and retain non-secret probe diagnostics on failure.
Verification
Operational prerequisite
Set the Development environment variable
FIREBASE_PROBE_SIGNER_SERVICE_ACCOUNTto an approved@based-hardware.iam.gserviceaccount.comaccount and grant the deployment principalroles/iam.serviceAccountTokenCreatoron that account. No IAM or deployment changes are included in this PR.