Skip to content

AI Agents & MCPs & AI Workflow Automation • (~400 MCP servers for AI agents) • AI Automation / AI Agent with MCPs • AI Workflows & AI Agents • MCPs for AI Agents

fix(cloud): start the approval when the checks pass in a normal run (#17017)

Othman Abu Ajamieh6fc4c600cd49
diff --git a/.github/workflows/continuous-delivery-cloud.yml b/.github/workflows/continuous-delivery-cloud.yml
index 728fb959818..b931ab68a84 100644
--- a/.github/workflows/continuous-delivery-cloud.yml
+++ b/.github/workflows/continuous-delivery-cloud.yml
@@ -328,7 +328,7 @@ jobs:
# The one approval. A newer candidate cancels an older one that still waits here.
approve:
needs: [cut, e2e-matrix, upgrade-test, tickets]
- if: needs.cut.outputs.skip != 'true'
+ if: ${{ !cancelled() && needs.cut.outputs.skip != 'true' && needs.e2e-matrix.result == 'success' && needs.upgrade-test.result == 'success' && needs.tickets.result == 'success' }}
runs-on: ubuntu-latest
environment:
name: production
@@ -344,6 +344,7 @@ jobs:
# canary and the fleet. The group matches continuous-delivery-rollback.yml.
deploy:
needs: [cut, approve]
+ if: ${{ !cancelled() && needs.approve.result == 'success' }}
runs-on: ubuntu-latest
concurrency:
group: promote-production
@@ -504,7 +505,7 @@ jobs:
# A rollback, an emergency deploy or a hotfix deploy does not sync; the next normal deploy records it.
linear-release:
needs: [cut, deploy]
- if: ${{ !inputs.hotfix_prs }}
+ if: ${{ !cancelled() && needs.deploy.result == 'success' && !inputs.hotfix_prs }}
runs-on: ubuntu-latest
timeout-minutes: 5
continue-on-error: true
diff --git a/brain/knowledge/engineering/cloud-deployment-paths.md b/brain/knowledge/engineering/cloud-deployment-paths.md
index 3f071574be4..e18599d677b 100644
--- a/brain/knowledge/engineering/cloud-deployment-paths.md
+++ b/brain/knowledge/engineering/cloud-deployment-paths.md
@@ -20,7 +20,8 @@ A hotfix merges into `main` first. A manual gate run with `hotfix_prs` (ENG-1098
- **The breaking-migration check runs in the `deploy` job, after the approval.** It fails when any pending migration carries `breaking = true` (rollback safety — see `tools/scripts/check-manifest-migrations.ts`), so the fleet never deploys. To ship a breaking migration on purpose, run the gate by hand with `skip_migration_check`.
- **`deploy` re-reads Cloud under the lock and refuses to drop anything Cloud runs.** It fails when the canary and the fleet run different images, when the fleet moved after `cut`, or when a commit in `merge-base(cloud, candidate)..cloud` has no `(#N)` subject or its PR number is missing from the candidate's history. That one rule blocks a downgrade and a silent revert of a fix shipped through another path (an emergency deploy, later hotfix mode); comparing commits alone misses the second case, because cherry-picked SHAs never match `main`. After `emergency-cloud-deploy.yml` (fleet only), deploy the fleet's tag to the canary by hand or the gate stays blocked.
- **A hotfix run has its own approval group (`cloud-approval-hotfix-<run id>`).** The full gate run's group cancels a waiting older run, which would otherwise cancel a hotfix waiting for approval. The re-read under the lock in `deploy` catches a hotfix and a full gate run that were cut from the same Cloud commit.
-- **The hotfix push uses the release GitHub App token, not `GITHUB_TOKEN`.** A picked commit can change a workflow file, and `GITHUB_TOKEN` cannot push those.
+- **The hotfix push uses the release GitHub App token, not `GITHUB_TOKEN`.** A picked commit can change a workflow file, and `GITHUB_TOKEN` cannot push those. `RELEASE_APP_ID` and `RELEASE_APP_PRIVATE_KEY` must be repo secrets: `cut` has no environment, so the copies in the `release` environment are empty there.
+- **Every job below `build-pick` needs an explicit status function in its `if`.** A normal run skips `build-pick`, and an `if` with no status function gets an implicit `success()`, which is false when any earlier job in the chain was skipped. The first rehearsal (2026-10-29) passed every check, then skipped `approve` and `deploy` and still showed green. A job that must not run after a failed check (`approve`, `deploy`, `linear-release`) uses `!cancelled()` plus `needs.<job>.result == 'success'`, not `always()`, so a cancelled run never deploys. A job that reports failures (`report`) keeps `always()`.
- **Tag readers accept `.beta` and `.pick`.** The gate and `continuous-delivery-rollback.yml` both parse the running tag; a reader that matches only `.beta` reads nothing after a hotfix deploy.
- **The approval sits before the canary on purpose.** The canary runs migrations on the shared database at boot, so a canary deploy that waits days for the fleet's approval brings back the ENG-1062 problem.
- **A reusable workflow checks out `github.sha`, not the candidate.** `e2e-matrix.yml` and `upgrade-test.yml` take a `ref` input, and the gate passes the candidate SHA; without it the specs come from the newest `main`.