Skip to content

feat: add config trace command for detailed configuration source inspection#127

Merged
l50 merged 3 commits intomainfrom
feat/config-trace
Apr 20, 2026
Merged

feat: add config trace command for detailed configuration source inspection#127
l50 merged 3 commits intomainfrom
feat/config-trace

Conversation

@l50
Copy link
Copy Markdown
Contributor

@l50 l50 commented Apr 19, 2026

Key Changes:

  • Introduced config trace CLI command to display config values and their sources
  • Added config tracing utilities to identify value origins (flag, env, file, default)
  • Implemented debug logging for Ansible runner options (extra-vars, env)
  • Provided comprehensive tests for config tracing logic

Added:

  • config trace command shows each configuration key's value and its source,
    including breakdowns for Ansible environment variables, extra-vars, and
    overlaps with ansible.cfg
  • TraceConfig utility in internal config package to resolve and list each
    config key's effective value and provenance (flag, env var, config file,
    auto-detected, or default)
  • Unit tests for config tracing and source resolution logic ensure accurate
    reporting and key coverage

Changed:

  • Ansible playbook runner now logs all extra-vars and environment variables
    passed to ansible-playbook for easier debugging and traceability

…ve debugging

**Added:**

- Introduced `config trace` command to display each config key's effective value
  and origin, including CLI flags, env vars, config files, or defaults
- Added structured config tracing utility with `TraceConfig` and supporting
  types and helpers for source resolution - `internal/config/trace.go`
- Provided detailed output for Ansible environment variables, extra-vars, and
  ansible.cfg overlaps to aid debugging - `config_cmd.go`
- Implemented tests for config tracing, source resolution, and flag conversion
  logic - `internal/config/trace_test.go`

**Changed:**

- Enhanced Ansible runner to log extra-vars and environment variables passed to
  `ansible-playbook` at debug level for improved traceability - `runner.go`
- Updated CLI config command initialization to register new `config trace`
  subcommand - `config_cmd.go`
@l50 l50 enabled auto-merge April 19, 2026 21:23
@l50 l50 disabled auto-merge April 19, 2026 21:23
l50 added 2 commits April 19, 2026 15:32
…ests

**Changed:**

- Enhance robustness in `TestResolveSource` by checking and failing the test if
  `os.Unsetenv` returns an error when unsetting "DREADGOAD_REGION". This makes
  test failures clearer when environment cleanup fails.
@l50 l50 merged commit 6901766 into main Apr 20, 2026
8 checks passed
@l50 l50 deleted the feat/config-trace branch April 20, 2026 02:24
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