Repository navigation
Deploy every merge to staging, then production; require a staging run before merging - #409
Merged
Merged
Conversation
… before merging Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…job, lock under /run A branch deployed to staging no longer supplies the scripts that run as root on the host, and its code never shares a job with a token that can write commit statuses. The host lock moves out of the world-writable /run/lock. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What and why
Merging to
mainnow deploys to production with no manual step, and a change to the running service is run on staging before it can merge.deploy(new): whencipasses onmain, it deploys that commit to staging. If staging starts cleanly, the same commit goes to production. It can also be run by hand with any commit onmain, to redeploy or roll back.PROD_AUTO_DEPLOY=falsestops it at staging.deploy-staging: now for trying a branch before merging, by pushing it tostagingor running the workflow with a ref. The scripts that run as root on the host come frommain; the branch only supplies the release. A separate job with no branch code marks the deployed commit with thestagingstatus.staging-check(new): sets thestagingstatus on each PR head. Docs-, tests-, evals- and Markdown-only changes pass on their own. Anything else stays pending until that commit is deployed to staging, and a new push resets it. It runs onpull_request_targetbut never checks out PR code.activate_release.sh, used by every deploy:/run/tin-lite-deploy.lock), so people and CI never deploy at the same time;/healthzstays 200 from the old process during the drain);deploy.sh: prod now uses the release env kept on the host (/etc/tin-lite/release.env), like staging.TIN_LITE_UPLOAD_ENV=1keeps the old upload path.docs/repository-policy.md, CONTRIBUTING anddocs/staging.mdnow say that merging deploys. The PR template gains a Tested on staging section.Verification
deploy.sh:TIN_LITE_RELEASE_SOURCEreleased from a separate checkout using this checkout's scripts;test_secret_fences,test_staging_isolation; YAML parses.install_switchboard.shgenerates (Caddyfile, units, squid, proxy helpers; the only difference is the stop timeout living in a drop-in, which has the same effect). Its install fingerprint is recorded, so the first automatic prod deploy won't restart the proxy./run/lock.Tested on staging
The staging deploys above. The
deployworkflow itself can only run once this is onmain: merging this PR is its first run, and it deploys #406–#408 plus this PR to production (prod is at d9d7870; no migrations or catalog executor changes since).Notes
Operator setup already done:
tin-lite-prod-deployerservice account, trusted only for this repo'sproductionenvironment (by its ID-based subject), with OS Login and viewer on the prod VM only.gcloud compute sshas<user>_emotionmachine_ai; raw SSH with the old project keys no longer works there./etc/tin-lite/release.envseeded on prod from the current release.productionenvironment is limited tomain; thestagingenvironment tomainandstaging.PROD_AUTO_DEPLOY=true.After merge: add
stagingas a required status check onmain. It isn't required yet, becausestaging-checkhas to be onmainfirst.The maintainer bypass also covers the new check; the policy text says skipping staging for a service change is deploying it untested.
🤖 Generated with Claude Code