feat(editorial): wire serialized Stage runtime install and PMO proposal client

This commit is contained in:
devops committed 2026-10-24 03:41:11 +00:00
1 parent 8869ce2583
commit f7cf2c8f5d
8 files changed
+387 -4

No files matched your search

+5
View File
@@ -5,6 +5,8 @@ stage_runtime_provision() {
[ "${GITHUB_ACTIONS:-${GITEA_ACTIONS:-}}" = true ]
[ "${STAGE_PROVISION_ENABLED:-}" = true ]
export DEPLOY_SHA STAGE_PROVISION_APPROVED_SHA="$DEPLOY_SHA" CI=true
PYTHONDONTWRITEBYTECODE=1 python3 -m unittest discover -s infra/hermes-editorial/tests
PYTHONDONTWRITEBYTECODE=1 python3 -m unittest discover -s scripts -p test_editorial_provision.py
PYTHONDONTWRITEBYTECODE=1 python3 - <<'PY'
import os, json, subprocess, importlib.util, resource, secrets, re, stat
from pathlib import Path
@@ -63,6 +65,9 @@ rows=json.loads(docker('exec','-w','/app','canino_backend_stage','node','-e',que
if not 1<=len(rows)<=1000 or any(not isinstance(r,dict) or set(r)!={'id'} or not isinstance(r['id'],str) or not re.fullmatch('[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}',r['id']) for r in rows):
raise ValueError('Verified admin subjects required')
m.provision(root,uid,gid)
spec=importlib.util.spec_from_file_location('editorial','scripts/provision-editorial-runtime.py')
editorial=importlib.util.module_from_spec(spec);spec.loader.exec_module(editorial)
editorial.provision(os.environ['DEPLOY_SHA'],uid,gid)
# Leave the validated deny-all sentinel unchanged for repeat provisioning.
capture=os.environ['DEPLOY_SHA']+'-'+secrets.token_hex(8)
dest=root/'snapshots'/capture