Skip to content

feat(backend): simplify YAML startup and validate configs before serving - #10

Merged
gokugiant merged 3 commits into
mainfrom
codex/backend-config-cli
Nov 13, 2026
Merged

gokugiant merged 3 commits into
mainfrom
codex/backend-config-cli

Conversation

@gokugiant

@gokugiant gokugiant commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

Change

Allow selecting the device YAML with python main.py --config … --mode hardware (also supported by python -m newswitch.app). Explicit CLI arguments override environment variables, while the existing ASGI/environment entrypoint remains available.

Validate device YAML before serving HTTP. A missing, malformed or schema-invalid file now fails immediately instead of failing in a background manager task. just dev performs the same preflight and does not start the frontend after backend startup failure.

The development commands prepare Serial/CAN dependencies automatically through uv run --extra uc2. Migrate the deprecated uv development-dependency field without changing package versions, enable terminal warnings, and update the Quickstart and YAML examples. Ignore generated configuration backups in subdirectories.

Validation

  • Full backend test suite; Ruff lint and formatting.
  • Missing-file failure reproduced with both the Python CLI and just dev.
  • CLI help, existing ASGI import and development-command dry runs checked.
  • Device YAML preflight does not write runtime files or open hardware.

The local SSO decision document and runtime backup are excluded. Camera, authentication and frontend implementations are unchanged; no new physical hardware tests were needed for this startup change.

CI baseline comparison

Local validation: 448 backend tests passed, 4 skipped; Ruff lint/format passed. The GitHub macOS/Python 3.12 tests pass, and the codegen-drift job's generation and drift-check steps pass.

CI is not green on the existing main (534cd0e, run 43387114217). Compared with PR run 43447313132:

  • Windows fails building the unchanged pinned UC2-REST dependency with the same UnicodeDecodeError.
  • Ubuntu/Python 3.11 reports exactly the same six failing tests (protocol conformance and autofocus); macOS/Python 3.11 reports the same five protocol tests.
  • Browser user-management cases fail at the existing shared getByText('Manage accounts and roles.') visibility assertion. This run affects three cases versus two on the baseline; both fail in the same helper. Frontend/authentication code is unchanged.

Those existing CI issues are recorded here rather than changing unrelated frontend, autofocus or upstream driver code in this startup PR.

@gokugiant
gokugiant merged commit b37ff7d into main Nov 13, 2026
3 of 11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant