WBS-7.9, WBS-7.10: KIS data collection fallback resiliency & deploy_gas.py pre-deploy thin-adapter lint integration

This commit is contained in:
2026-06-22 10:25:23 +09:00
parent 2af3681fb9
commit 93f046c76c
4 changed files with 61 additions and 0 deletions
+44
View File
@@ -248,14 +248,58 @@ def sync_sector_insights_via_clasp_run() -> bool:
return True
def run_pre_deploy_linter() -> bool:
print("[deploy_gas] Running pre-deploy gas thin-adapter audit...")
# Run auditor v1
audit_res = subprocess.run(
["python", "tools/audit_gas_thin_adapter_v1.py"],
cwd=str(ROOT),
shell=True,
capture_output=True,
text=True,
encoding="utf-8",
errors="replace",
)
if audit_res.returncode != 0:
print("[deploy_gas] Error: tools/audit_gas_thin_adapter_v1.py failed")
print(audit_res.stdout)
print(audit_res.stderr)
return False
# Run validator v2
validate_res = subprocess.run(
["python", "tools/validate_gas_thin_adapter_v2.py"],
cwd=str(ROOT),
shell=True,
capture_output=True,
text=True,
encoding="utf-8",
errors="replace",
)
print(validate_res.stdout)
if validate_res.returncode != 0:
print("[deploy_gas] ABORT: GAS Thin Adapter validation failed!")
if validate_res.stderr:
print("STDERR: " + validate_res.stderr)
return False
print("[deploy_gas] Pre-deploy thin-adapter audit PASS")
return True
def main() -> None:
parser = argparse.ArgumentParser(description="GAS auto-deploy")
parser.add_argument("--dry-run", action="store_true", help="List files without writing")
parser.add_argument("--skip-push", action="store_true", help="Bundle only, skip clasp push")
parser.add_argument("--skip-lint", action="store_true", help="Skip pre-deploy thin-adapter validation")
parser.add_argument("--sync-sector-insights", action="store_true", help="POST sector insight JSON to a deployed GAS web app")
parser.add_argument("--webapp-url", default=os.environ.get("GAS_WEBAPP_URL", DEFAULT_WEBAPP_URL), help="Apps Script web app URL for sync POST")
args = parser.parse_args()
if not args.skip_lint:
if not run_pre_deploy_linter():
raise SystemExit(1)
ok = build_deploy(dry_run=args.dry_run)
if not ok:
print("[deploy_gas] Some source files missing -- check warnings above")