Repository navigation
feat: dev/migrate CLI commands and LOG_CONSOLE env vars - #40
Merged
Merged
Conversation
Closes #35, closes #36 - uv run dev: starts uvicorn with reload=True for local development - uv run migrate: applies all migrations/*.sql files in order against the configured PostgreSQL database (requires CHECKPOINT_BACKEND=postgres) - Both also registered as devops-agent dev / devops-agent migrate subcommands - LOG_CONSOLE_ENABLED: set false to suppress all console output (e.g. production) - LOG_CONSOLE_COLORIZE: set false to strip ANSI colour codes (CI / Docker logs) - pyproject.toml: add testpaths = ["tests"] to pytest config - .env.example: document the three new log env vars
… and log env vars
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #35
Closes #36
Changes
Issue #35 — Better CLI commands
uv run dev/devops-agent dev— starts uvicorn with--reloadfor local developmentuv run migrate/devops-agent migrate— applies allmigrations/*.sqlfiles in order against the configured Postgres DB; prints ✓/✗ per file and exits non-zero on failurepyproject.toml: addedtestpaths = ["tests"]to[tool.pytest.ini_options]Issue #36 — LOG_LEVEL env vars
LOG_CONSOLE_ENABLED(defaulttrue) — set tofalseto silence all console output; useful when logging to a file or external collectorLOG_CONSOLE_COLORIZE(defaulttrue) — set tofalseto strip ANSI colour codes; useful for CI pipelines and Docker log drivers that don't handle colourappsettings.py→_setup_logging()incli/main.py.env.exampleUsage
Test plan
uv run devstarts server with reload, URL printed to consoleuv run migratewith postgres DSN applies all 11 migrations and prints ✓ per fileuv run migratewithout postgres config prints clear error and exits 1LOG_CONSOLE_COLORIZE=falseproduces plain text log outputLOG_CONSOLE_ENABLED=falseproduces no console output