Skip to content

fix(deploy): require an explicit sql_identity_fence choice (TC-4465) - #768

Merged
samgbafa merged 1 commit into
mainfrom
bot/require-sql-fence-choice
Nov 28, 2026
Merged

samgbafa merged 1 commit into
mainfrom
bot/require-sql-fence-choice

Conversation

@samgbafa

Copy link
Copy Markdown
Contributor

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 to true. 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.yml at f1147c6)

  • :82-87: sql_identity_fence is now type: choice with options unset / true / false and default: 'unset'. It is still required: true.
  • :180: the "Validate image version against Cargo.toml" step in the version-guard job gets INPUT_SQL_IDENTITY_FENCE: ${{ inputs.sql_identity_fence }}.
  • :202-208: inside the existing if [ "${INPUT_DEPLOY_PHALA}" = "true" ] block, next to the authorize_quota_values check, anything other than true or false is 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 build and deploy-phala need version-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 existing named_keys_v1 rule. It refuses anything but a literal true/false before 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, then SQL_IDENTITY_FENCE).

A choice input renders as the string true or false, the same text the boolean rendered, so both lines receive exactly the values they did before. The fence code and the meaning of true are untouched. On push, tag and release events inputs.* is empty, as before, and the new check only runs when deploy_phala is true, 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.
    • New test_deploy_requires_explicit_sql_identity_fence checks two things:
      • unset and an empty value fail with zero boundary events (no image pull, no deploy) and with the guard's message.
      • Explicit true and false succeed, and the sealed SQL_IDENTITY_FENCE equals the chosen value.
    • The documented-commands test now asserts that every copy-paste deploy command in docs/releasing.md states -f sql_identity_fence=false. Before, the harness's default could hide an omission.
    • Two changed lines in the test file:
      • the mock node boundary records the sealed fence value;
      • run_deploy returns it.
  • Mutation check: with the version-guard check removed from the workflow source, the new test fails.
  • docs/releasing.md: the promotion bullet and the "Before any CVM mutation" list now describe the required explicit choice. Every documented deploy_phala=true command 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).
  • actionlint (local 1.6.25) on docker.yml reports the same 6 findings before and after this change, all of them already present: 3 × attestations scope 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.

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.
@samgbafa
samgbafa merged commit 9a56bb1 into main Nov 28, 2026
33 of 34 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant