feat: add config trace command for detailed configuration source inspection#127
Merged
feat: add config trace command for detailed configuration source inspection#127
Conversation
…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`
…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.
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.
Key Changes:
config traceCLI command to display config values and their sourcesAdded:
config tracecommand shows each configuration key's value and its source,including breakdowns for Ansible environment variables, extra-vars, and
overlaps with
ansible.cfgTraceConfigutility in internal config package to resolve and list eachconfig key's effective value and provenance (flag, env var, config file,
auto-detected, or default)
reporting and key coverage
Changed:
passed to
ansible-playbookfor easier debugging and traceability