Skip to content

Fail explicit config writes when AF_CONFIG is non-regular#217

Open
RitwijParmar wants to merge 1 commit into
astronomer:mainfrom
RitwijParmar:codex/astronomer-writable-config-guard
Open

Fail explicit config writes when AF_CONFIG is non-regular#217
RitwijParmar wants to merge 1 commit into
astronomer:mainfrom
RitwijParmar:codex/astronomer-writable-config-guard

Conversation

@RitwijParmar

Copy link
Copy Markdown

Summary

  • Adds a ConfigManager.require_writable() guard that preserves neutralized-config read/no-op behavior while giving explicit config mutations a clear failure path.
  • Wires the guard through af instance add/use/delete/reset, instance discovery write preflight, and af telemetry enable/disable.
  • Adds CLI and layered-config tests for directory-backed AF_CONFIG as the platform-neutral stand-in for /dev/null.

Fixes #194.

Verification

  • /Users/ritwij/Library/Python/3.9/bin/uv run pytest tests/test_cli_instances.py tests/test_cli_config_writes.py tests/test_layered.py tests/test_config.py (137 passed)
  • /Users/ritwij/Library/Python/3.9/bin/uv run pytest tests --ignore=tests/integration (574 passed)
  • /Users/ritwij/Library/Python/3.9/bin/uv run ruff check src tests/test_cli_instances.py tests/test_cli_config_writes.py tests/test_layered.py
  • /Users/ritwij/Library/Python/3.9/bin/uv run ruff format --check src tests/test_cli_instances.py tests/test_cli_config_writes.py tests/test_layered.py

Full pytest was also attempted; only tests/integration/test_api_endpoints.py failed because no Airflow server was listening on localhost:8080 in my local environment.

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.

af CLI: error on config-modifying commands when AF_CONFIG points to a non-regular path

1 participant