You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Map #16 · implements the Phase 2 decision locked in #19 (prod wired-but-gated).
What to build
Replicate the staging auto-rebuild for prod, but leave it disabled behind an explicit go-live gate. Add the same final step to opencode-prod-main:
gcloud builds triggers run build-lab-base-prod --branch=main
…but keep it off — step commented out or the IAM grant withheld — until the prod go-live checklist passes. Separately, confirm/enable object versioning on the prod qbraid-codeq bucket (it is not TF-declared in this repo, only referenced by IAM; the fast break-glass rollback depends on it). Record the prod go-live checklist in CODEQ_DEPLOYMENT.md.
The gate's blocking item — lab-base Trivy restored to --exit-code=1 — is tracked cross-repo (infra#331 / Dstacks#34/#35/#38) and is NOT flipped by this ticket. The rollout-smoke-test go-live item is satisfied by #25.
Lands in qbraid-infrastructure (prod cloud-build-codeq.tf + bucket versioning) + CODEQ_DEPLOYMENT.md. Full spec: #19 → Phase 2.
Acceptance criteria
opencode-prod-main carries the gcloud builds triggers run build-lab-base-prod --branch=main step, but it is provably inert (commented step or withheld IAM) — a prod codeq push does NOT auto-rebuild yet.
Object versioning on the prod qbraid-codeq bucket is confirmed enabled (or enabled) and noted in the doc.
Implemented across two PRs — open for review (not merged).
Infra: qBraid/qbraid-infrastructure#620 (commits bacf662, cdb6d9f) — prod opencode-prod-main auto-rebuild wired but provably inert: commented step and withheld IAM (fails closed even if uncommented, since the executor SA holds no cloudbuild.builds.create). Same anti-cascade guardrails as staging.
Caveats (cannot be closed from source — no live GCP here):
Prod qbraid-codeq bucket object versioning must be confirmed live (gcloud storage buckets describe gs://qbraid-codeq --format='value(versioning.enabled)') — documented as a manual go-live gate rather than TF-declared (the bucket is out-of-band; importing it without creds risks a create/hijack).
Staging hit three separate IAM gaps getting the layer-1 auto-rebuild working, and the checklist as written only anticipates the first:
Custom-role creation 403 — CI SA lacks iam.roles.create (holds roles/iam.securityAdmin, which is get/list only). Fixed in qbraid-infrastructure#699 by dropping the custom role for roles/cloudbuild.builds.editor. qbraid-prod's CI SA (github-actions-v2-terraform@) has the identical role set, so a prod custom role would 403 the same way.
cloudbuild.builds.create on the trigger-runner SA — granted by the same PR.
iam.serviceAccounts.actAs on the trigger's executor SA — gcloud builds triggers run submits a build that runs as the trigger's configured service account (build-lab-base-prod → cloud-build-prod@), so the trigger-runner needs roles/iam.serviceAccountUser on it. This is the reverse direction from the existing token-creator binding and is easy to miss. Fixed for staging in qbraid-infrastructure#700.
anomalyco#698 ships prod IAM deliberately withheld, so none of these bite today — but all three are prerequisites for flipping the prod gate, in addition to the already-tracked lab-base Trivy --exit-code=1 restoration.
Suggest adding to the go-live checklist in CODEQ_DEPLOYMENT.md:
prod trigger-runner SA exists with roles/cloudbuild.builds.editor (not a custom role)
prod trigger-runner SA holds roles/iam.serviceAccountUser on cloud-build-prod@
executor SA holds roles/iam.serviceAccountTokenCreator on the trigger-runner SA
Activity
Kenny-Heitritter commentedon Jul 24, 2026
Implemented across two PRs — open for review (not merged).
bacf662,cdb6d9f) — prodopencode-prod-mainauto-rebuild wired but provably inert: commented step and withheld IAM (fails closed even if uncommented, since the executor SA holds nocloudbuild.builds.create). Same anti-cascade guardrails as staging.Caveats (cannot be closed from source — no live GCP here):
qbraid-codeqbucket object versioning must be confirmed live (gcloud storage buckets describe gs://qbraid-codeq --format='value(versioning.enabled)') — documented as a manual go-live gate rather than TF-declared (the bucket is out-of-band; importing it without creds risks a create/hijack).--exit-code=1) is cross-repo (infra#331 / Dstacks#34/Wire Azure terraform into CI/CD (IaC runner: staging auto-apply, prod gated) #35/Add billing pricing + quota for the 3 models (qbraid-api) #38) and intentionally not flipped here.terraform validatepasses; prod behavior unchanged.Merge pull request #42 from qBraid/codeq/deployment-doc-sections
Kenny-Heitritter commentedon Aug 1, 2026
Prod go-live checklist — add an IAM item.
Staging hit three separate IAM gaps getting the layer-1 auto-rebuild working, and the checklist as written only anticipates the first:
iam.roles.create(holdsroles/iam.securityAdmin, which is get/list only). Fixed in qbraid-infrastructure#699 by dropping the custom role forroles/cloudbuild.builds.editor.qbraid-prod's CI SA (github-actions-v2-terraform@) has the identical role set, so a prod custom role would 403 the same way.cloudbuild.builds.createon the trigger-runner SA — granted by the same PR.iam.serviceAccounts.actAson the trigger's executor SA —gcloud builds triggers runsubmits a build that runs as the trigger's configured service account (build-lab-base-prod→cloud-build-prod@), so the trigger-runner needsroles/iam.serviceAccountUseron it. This is the reverse direction from the existing token-creator binding and is easy to miss. Fixed for staging in qbraid-infrastructure#700.anomalyco#698 ships prod IAM deliberately withheld, so none of these bite today — but all three are prerequisites for flipping the prod gate, in addition to the already-tracked lab-base Trivy
--exit-code=1restoration.Suggest adding to the go-live checklist in
CODEQ_DEPLOYMENT.md:roles/cloudbuild.builds.editor(not a custom role)roles/iam.serviceAccountUseroncloud-build-prod@roles/iam.serviceAccountTokenCreatoron the trigger-runner SA