사람 승인 게이트를 명시화

This commit is contained in:
Yun Chan 2026-08-29 23:59:29 +09:00
parent 707dba4f8f
commit 3a7b6f7760
5 changed files with 133 additions and 3 deletions

View file

@ -115,14 +115,17 @@ RELEASE_E2E_TIMEOUT_SECONDS = 15 * 60
# Existing preview volumes do not replay docker-entrypoint-initdb.d. These
# forward-compatible, idempotent Outcome OS migrations must therefore land
# before the new API image is restarted. Every file is applied atomically.
# before the new API image is restarted. Transactional files are atomic;
# online indexes run outside a transaction so production writes stay available.
RELEASE_DB_MIGRATIONS = (
"14_continuous_improvement.sql",
"15_self_directed_practice_runtime.sql",
"16_calibration_transfer_actual_execution.sql",
"17_improvement_workbook_contracts.sql",
"18_admin_usage_ledger_index.sql",
"19_auth_identity_alias.sql",
)
RELEASE_DB_ONLINE_MIGRATIONS = frozenset({"18_admin_usage_ledger_index.sql"})
# These files are runtime-critical but were added after the first manifest
# snapshot. A release must classify them as whole-file payloads; otherwise a
@ -133,6 +136,7 @@ REQUIRED_RELEASE_PAYLOAD_PATHS = (
"infra/db/init/15_self_directed_practice_runtime.sql",
"infra/db/init/16_calibration_transfer_actual_execution.sql",
"infra/db/init/17_improvement_workbook_contracts.sql",
"infra/db/init/18_admin_usage_ledger_index.sql",
"infra/db/init/19_auth_identity_alias.sql",
)
@ -867,6 +871,11 @@ class NasPreviewDeploymentDriver:
migration_commands: list[str] = []
for migration_name in RELEASE_DB_MIGRATIONS:
migration_path = f"{release_root}/infra/db/init/{migration_name}"
transaction_flag = (
""
if migration_name in RELEASE_DB_ONLINE_MIGRATIONS
else "--single-transaction "
)
migration_commands.extend(
[
f"test -f {shlex.quote(migration_path)}",
@ -876,7 +885,7 @@ class NasPreviewDeploymentDriver:
f"-f {shlex.quote(compose)} -f {shlex.quote(remote_override)} "
"exec -T db sh -lc "
+ shlex.quote(
'psql -v ON_ERROR_STOP=1 --single-transaction '
f"psql -v ON_ERROR_STOP=1 {transaction_flag}"
'-U "$POSTGRES_USER" -d "$POSTGRES_DB"'
)
+ f" < {shlex.quote(migration_path)}"