fix(release): offline DB schema init + preflight digest-pin env - #226
Merged
Merged
Conversation
External-machine test (0912) failed at startup: the offline bundle had no
DB migrations, so the controller died on 'relation task_runs does not
exist'. Ship a docker-entrypoint-initdb.d bundle under release/offline/db-init/:
- 000-roles.sql idempotent pre-create of every role the migrations
reference (PG folds unquoted identifiers to lowercase
- the mergepilot_approver trap)
- 001-init.sql tools/audit-db/*.sql topologically sorted so
m3b_policy (approvals) precedes the b4 series
- 002-console.sql demo_console migrations (environment_identity +
mergepilot_reader ACL)
- 003-logins.sql runtime LOGIN roles + passwords + reader
default_transaction_read_only (NOT_READ_ONLY gate)
- 004-environment.sql ISOLATED_LIVE environment marker row
- 005-seed.sql demo task_runs row (RUN_NOT_FOUND fail-closed)
compose: mount the init dir into postgres and pass
MERGEPILOT_DECLARED_PG_IMAGE to the preflight digest gate
(IMAGE_DIGEST_MISMATCH). start-stack.{bat,sh} two-phase launcher measures
the compose bridge IP for MERGEPILOT_PG_EXPECTED_SERVER_ADDRESSES
(WRONG_SERVER pin).
Verified end-to-end from a fresh volume: 6 services healthy, preflight
PREFLIGHT_OK (exit 0), 8600/8090 return 200, 29 tables + l2_* functions
present.
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.
问题
0912 外部 Windows 机器烟测:镜像 load 9/9、digest 9/9,但栈起不来 — 控制器报
relation "task_runs" does not exist(离线包缺 DB 迁移),随后又连环暴露 5 个启动门禁问题。修复(release/offline/)
approvals尚未创建 → 按表依赖拓扑排序compose 增加两处:postgres 挂载
docker-entrypoint-initdb.d;preflight 传MERGEPILOT_DECLARED_PG_IMAGE(IMAGE_DIGEST_MISMATCH 门,tag 引用与 digest 声明分离的 §4 方案)。start-stack.{bat,sh} 两阶段启动器:先单起 postgres 测桥接 IP 写入 MERGEPILOT_PG_EXPECTED_SERVER_ADDRESSES(WRONG_SERVER pin),再全量启动。
验证(全新卷端到端)
Up (healthy),preflight 一次性门禁PREFLIGHT_OK(exit 0)ZIP 布局(compose 与 db-init 同级)已按测试字节原样随 v0.2.1 发布;仓库内挂载路径为 ./release/offline/db-init(唯一文本差异,PR 内说明)。