Repository navigation
fix(deploy): require an explicit sql_identity_fence choice (TC-4465) - #768
Merged
Merged
Conversation
sql_identity_fence becomes a required choice input (unset/true/false, default unset). The version guard refuses deploy_phala=true with unset before any build or CVM mutation; the Deploy step refuses anything but literal true/false before sealing. The true/false mapping to TINYCLOUD_DATABASE__WRITE_FENCE and PHALA_ENV_SQL_IDENTITY_FENCE is unchanged. test-deploy-recovery covers the refusal and requires documented commands to state the fence. Details: TC-4465.
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.
Linear: TC-4465
Why
On 2026-11-28 the ACVB deploy of #766 (run 46189139062) was dispatched without
-f sql_identity_fence=false. The input was a boolean that defaulted totrue. That fenced production SQL/DuckDB and writes, and users got 503s from 21:09 to 21:25Z. With this change, a production deploy cannot run with an unstated fence choice.Fail-early path (
.github/workflows/docker.ymlat f1147c6):82-87:sql_identity_fenceis nowtype: choicewith optionsunset/true/falseanddefault: 'unset'. It is stillrequired: true.:180: the "Validate image version against Cargo.toml" step in theversion-guardjob getsINPUT_SQL_IDENTITY_FENCE: ${{ inputs.sql_identity_fence }}.:202-208: inside the existingif [ "${INPUT_DEPLOY_PHALA}" = "true" ]block, next to theauthorize_quota_valuescheck, anything other thantrueorfalseis refused with:::error::deploy_phala=true requires an explicit -f sql_identity_fence=false (production) or -f sql_identity_fence=true (keeps SQL/DuckDB and writes fenced); see docs/releasing.md.Both
buildanddeploy-phalaneedversion-guard, so the refusal comes before any build, image pull or CVM mutation.:1245-1249: a second check in the Deploy to Phala Cloud step, next to the existingnamed_keys_v1rule. It refuses anything but a literaltrue/falsebefore the value is sealed.Unchanged true/false mapping
:1032:TINYCLOUD_DATABASE__WRITE_FENCE: ${{ inputs.sql_identity_fence }}(sealed-config preflight).:1198:PHALA_ENV_SQL_IDENTITY_FENCE: ${{ inputs.sql_identity_fence }}(sealed Phala env, thenSQL_IDENTITY_FENCE).A choice input renders as the string
trueorfalse, the same text the boolean rendered, so both lines receive exactly the values they did before. The fence code and the meaning oftrueare untouched. On push, tag and release eventsinputs.*is empty, as before, and the new check only runs whendeploy_phalaistrue, so builds without a deploy are unaffected.Tests and docs
scripts/ci/test-deploy-recovery.py. This harness runs the workflow's actual step Bash.test_deploy_requires_explicit_sql_identity_fencechecks two things:unsetand an empty value fail with zero boundary events (no image pull, no deploy) and with the guard's message.trueandfalsesucceed, and the sealedSQL_IDENTITY_FENCEequals the chosen value.docs/releasing.mdstates-f sql_identity_fence=false. Before, the harness's default could hide an omission.nodeboundary records the sealed fence value;run_deployreturns it.docs/releasing.md: the promotion bullet and the "Before any CVM mutation" list now describe the required explicit choice. Every documenteddeploy_phala=truecommand already passes-f sql_identity_fence=false.CHANGELOG.md: entry added.Local checks
python3 scripts/ci/test-deploy-recovery.py: 36 tests OK (35 before, plus the new one).docker.ymlreports the same 6 findings before and after this change, all of them already present: 3 ×attestationsscope unknown to this old actionlint, 3 shellcheck info/warnings. No new findings. The repo has no actionlint CI job.Do not merge or dispatch without Naomi's GO.