videogen/apps/api/tools/ops/preflight.py
caelum0x d56639a594
Some checks failed
build-images / web (push) Has been cancelled
vision2026-ci / Python SDK resource tests (push) Has been cancelled
build-images / api (push) Has been cancelled
build-images / worker-gpu (push) Has been cancelled
vision2026-ci / Shared packages (TS≡Python golden parity) (comfy-workflow-schema) (push) Has been cancelled
vision2026-ci / Shared packages (TS≡Python golden parity) (effects-core) (push) Has been cancelled
vision2026-ci / Shared packages (TS≡Python golden parity) (eventbus-types) (push) Has been cancelled
vision2026-ci / Shared packages (TS≡Python golden parity) (growth-analytics) (push) Has been cancelled
vision2026-ci / Shared packages (TS≡Python golden parity) (provider-adapter-kit) (push) Has been cancelled
vision2026-ci / Shared packages (TS≡Python golden parity) (publishing-connectors) (push) Has been cancelled
vision2026-ci / Shared packages (TS≡Python golden parity) (render-core) (push) Has been cancelled
vision2026-ci / Shared packages (TS≡Python golden parity) (shot-template-schema) (push) Has been cancelled
vision2026-ci / Shared packages (TS≡Python golden parity) (trends-schema) (push) Has been cancelled
vision2026-ci / Desktop engine crates (test + clippy + fmt) (push) Has been cancelled
codeql / Analyze (javascript-typescript) (push) Has been cancelled
codeql / Analyze (python) (push) Has been cancelled
perf / API hot-path micro-smoke (budgeted) (push) Has been cancelled
perf / Desktop engine crates (release build check) (push) Has been cancelled
vision2026-ci / API phase modules (ruff + pytest) (push) Has been cancelled
vision2026-ci / Alembic upgrade + drift check (push) Has been cancelled
vision2026-ci / Shared packages (TS≡Python golden parity) (caption-engine) (push) Has been cancelled
Menivor — open source release (MIT), free to use and fork
Paid, hosted product at menivor.com, now retired as a company project.
Fresh squashed history of the cleaned working tree (secret-scanned,
no .env, no customer data, no outreach logs). Built on
MoneyPrinterTurbo (MIT, harry0703) — see NOTICE.
2026-12-04 02:10:26 +03:00

58 lines
1.9 KiB
Python
Executable File

#!/usr/bin/env python3
"""Validate deployment configuration without printing secrets or calling providers.
This is a configuration gate, not a fake live-provider test. It prevents the
common failure mode where a deployed credential quietly exposes checkout or
publishing before the launch switch and release approval are intentionally set.
The check logic itself lives in ``app.core.launch_preflight`` so the API
process can run the exact same checks at startup (fail-fast under a public
launch posture, warn-only in pilot/dev). This CLI stays the release-gate entry
point with unchanged flags, output, and exit codes.
"""
from __future__ import annotations
import argparse
import sys
from pathlib import Path
# Runnable both as ``python3 apps/api/tools/ops/preflight.py`` (release gate,
# repo root) and from inside apps/api: put the API root on sys.path so the
# stdlib-only ``app.core.launch_preflight`` module resolves.
_API_ROOT = Path(__file__).resolve().parents[2]
if str(_API_ROOT) not in sys.path:
sys.path.insert(0, str(_API_ROOT))
from app.core.launch_preflight import ( # noqa: E402
broll_provider,
collect_preflight_errors,
collect_preflight_warnings,
launch_mode,
public_tier,
)
def main() -> int:
parser = argparse.ArgumentParser()
parser.add_argument("--production", action="store_true", help="require production dependencies")
args = parser.parse_args()
errors = collect_preflight_errors(production=args.production)
if errors:
print("ReelForge deployment preflight failed:", file=sys.stderr)
for error in errors:
print(f"- {error}", file=sys.stderr)
return 1
for note in collect_preflight_warnings():
print(f"- warning: {note}")
print(
f"ReelForge deployment preflight passed "
f"(mode={launch_mode()}, tier={public_tier()}, broll={broll_provider()})."
)
return 0
if __name__ == "__main__":
raise SystemExit(main())