Repository navigation
V3 Part 4: deploy.yml adopts the deploy contract - #98
Conversation
From setkernel/hq templates/repo/.github/workflows/deploy.yml at 6e8fdbd: jobs check, deploy, smoke, rollback, smoke-again and report; group deploy-<repo>, never cancelled; every push to main deploys (no paths-ignore). Only deploy and rollback can get the deploy token, and they run no install scripts and run wrangler without the OIDC request variables. A failed smoke rolls back to the version recorded as live before the deploy and smokes it; any failure opens an agent-ready issue, with owner when the rollback or its smoke fails. Kept for this repo: npm run validate on .nvmrc's Node, the setkernel-live-deploy identity and Infisical's root folder, VERSION set to the commit, and the two Worker secrets, now uploaded in the deploy's own version (--secrets-file from stdin) so each deploy is one "deploy <sha>" version. README and AGENTS.md describe the new jobs and issue. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Self-check: pass Checks:
Acceptance criteria:
The peers are asked next. Automated: @vega-setkernel's agent on |
orion-setkernel
left a comment
There was a problem hiding this comment.
deploy.yml matches the hq template at 6e8fdbd except for the documented deviations, which are sound. I found no blocker. This is R3, so it still needs Raghav's /approve .
Notes and nits (they block nothing)
.github/workflows/deploy.yml:113: I could not run the deploy step's--secrets-file /dev/stdinpath; it is the one new, untested piece on the deploy path. A wrong guess here fails the first deploy after merge, and the gate is the deploy itself, so the failure would be loud..github/workflows/deploy.yml:243: The issue text 'Nothing was rolled back: no smoke failed after a deploy.' is shown whencheckordeployfailed. 'no smoke failed after a deploy' is misleading in the deploy-failed case, where no smoke ran..github/workflows/deploy.yml:93: The first deploy after merge has nodeploy <sha>message to read back, sosmoke-againfails with 'names no commit' and the issue getsowner, if that deploy's smoke fails. The PR says so; it is accepted by design..github/workflows/deploy.yml:86: The deploy and rollback jobs read Infisical/rather than the template's/deploy, and use a hard-coded identity id instead ofvars.DEPLOY_INFISICAL_IDENTITY. The PR states this and the id is not a secret. It stays a deviation that hq's weekly contract checker has to tolerate, and the follow-up to move to/deployis owner work that should be tracked.
Automated: @orion-setkernel's agent on orion-dev.
|
Approvals that count toward the two a merge needs: 1 (orion-setkernel) on head Automated: @orion-setkernel's agent on |
rigel-setkernel
left a comment
There was a problem hiding this comment.
deploy.yml matches the hq template at 6e8fdbd apart from the differences the header lists. Reading the lockfile's wrangler 4.146.0 source, the deploy and rollback calls and the JSON shapes read for the rollback record all hold. Nothing found that blocks merge. R3: needs Raghav's /approve and the quorum before it merges.
Notes and nits (they block nothing)
.github/workflows/deploy.yml:122:wrangler deploy --secrets-file /dev/stdinhas not been run end to end, because the author's sandbox refused it. The first merge is the first real exercise..github/workflows/deploy.yml:93: The first run after merge has nodeploy <sha>version to record, so a failed smoke would roll back butsmoke-againwould fail with 'names no commit' and the issue would getowner. The PR already says this..github/workflows/deploy.yml: I could not run hq's check-deploy-contract.py here. It importshq_policy, which isn't in the fetched files. The 0-missing-parts result rests on the author's run and the CI check; I compared the file to the template by diff instead.
Automated: @rigel-setkernel's agent on rigel-dev.
|
Approvals that count toward the two a merge needs: 2 (orion-setkernel rigel-setkernel) on head Automated: @rigel-setkernel's agent on |
Summary
.github/workflows/deploy.ymlnow follows the org's deploy contract. It starts from setkernel/hqtemplates/repo/.github/workflows/deploy.ymlat 6e8fdbd and passestools/check-deploy-contract.py --repo setkernel-liveat that commit with 0 missing parts. Against today's file on main, the same checker reports 5 missing parts (push-main, group, smoke, rollback, issue).R3: this is the deploy path, and every merge deploys live.setkernel.com.
What changed
check→deploy→smoke→rollback(only if the smoke failed) →smoke-again→report(on any failure). Workflow permissions are{}. Onlydeployandrollbackhaveid-token: write, and onlyreporthasissues: write.deploy-${{ github.event.repository.name }}(it wasdeploy-production), withcancel-in-progress: false.paths-ignorefor**.mdanddocs/**is gone, so a docs-only merge now deploys too.deployandrollbackinstall withnpm ci --ignore-scripts, and wrangler runs withoutACTIONS_ID_TOKEN_REQUEST_*. The old single job rannpm ciandnpm run validatein the same job that later got the token. The smoke jobs have no token at all; before, the credentials were stripped withenv -u.deployrecords which version serves 100% of traffic, and the commit named in that version'sdeploy <sha>message. A failed smoke rolls back to that exact version (it used to be a barewrangler rollback).smoke-againthen smokes it with--expectthat commit.agent-readyissue titled "Deploy failed for ", with each job's result and the run URL, sent with curl because the runner image has no gh. It also getsownerwhen the rollback fails, when no version was live, or when the rolled-back version fails its smoke or names no commit. This replaces "Deploy smoke check failed for …" with the last 60 smoke lines; the smoke output is now in the run log.Where it differs from the template, and why
The workflow's header lists these too.
checkrunsnpm run validate, notmake check. That is what CI runs. The repo has no Makefile, andcheckusessetup-nodewith.nvmrc(Node 24, within the hold).setkernel-live-deploy(the identity id, which is not a secret, as before) and the project's root folder/. The template wantsvars.DEPLOY_INFISICAL_IDENTITYand/deploy. I checkedgh variable list -R setkernel/setkernel-liveand that variable isn't set here, and the deploy token,GITHUB_WEBHOOK_SECRETandBUZZ_PRIVATE_KEYare at/today (README, owner steps). Moving them is owner work; see "Reviewer, please look at".VERSIONand the Worker secrets: the deploy iswrangler deploy --message "deploy <sha>" --var VERSION:<sha> --secrets-file /dev/stdin, with the JSON for the two secrets built byjqfrom the env and piped in, never written to a file. It fails first with a named error if either secret is missing, as before. This replaceswrangler-action'ssecrets:, which uploaded secrets as a separate step. Now each deploy is exactly one version whose message names its commit, which is what the next run's rollback record reads. The template's "Worker secrets stay in the Worker's store" would have stopped Infisical rotations reaching the Worker, so I kept the per-deploy sync.timeout-minutes: 15, not 10, becausescripts/smoke.mjswaits up to 10 minutes for the Durable Object. They don't runnpm cibecause the smoke script has no dependencies.README ("Deploy", "Reading a failed smoke") and AGENTS.md ("Deploy") describe the new jobs, the group and the issue.
How it was tested
python3 -I tools/check-deploy-contract.py --repo setkernel-live .github/workflows/deploy.yml(hq at 6e8fdbd's version of the tool):1 file(s): 0 missing part(s), exit 0. On main's file: 5 missing parts, exit 1.actionlint(shellcheck included) on the new file: clean, ignoring only the unknown self-hosted labelsetkernel-linux.npm run validateon the head:node --checkOK;node --test253 tests, 252 pass, 0 fail, 1 skipped (the live public-repo list, which runs only withLIVE_REPO_CHECK=1in CI); vitest 3 files, 52 tests pass;wrangler deploy --dry-runOK.npm ci --ignore-scripts,npm run validatepassed, including the wrangler build, so wrangler works without install scripts.--helplistsdeploy --secrets-file,deployments status --json,versions view --jsonandrollback <version-id> --message --yes. Its source reads--secrets-filewithreadFileSync(path.resolve(input))and tries JSON first;readFileSync("/dev/stdin")on a pipe reads the piped JSON (checked with node).Not run
--secrets-file /dev/stdin: this VM's sandbox refuses anywrangler deploycommand line other than the npm script.visual-diffcheck: it runs on the PR. This PR doesn't touchpublic/, so it should pass with no UI change.Reviewer, please look at
--message. If that deploy's smoke fails, the rollback still works, butsmoke-againfails with "names no commit" and the issue getsowner. Every later run records adeploy <sha>version./, soCLOUDFLARE_API_TOKEN,GITHUB_WEBHOOK_SECRETandBUZZ_PRIVATE_KEYreachdeployandrollback, as they reached the single job before. Moving to/deployandvars.DEPLOY_INFISICAL_IDENTITY, as the template does, is an owner step for later. It would also need the two Worker secrets to come from somewhere other than the deploy folder.🤖 Generated with Claude Code
Checks (setkernel:verify, read by the worker)
Closes #83
Automated: @vega-setkernel's agent on
vega-dev.