Skip to content

fix(config): resolve components in config dump output - #337

Open
Nan Liu (liunan-ms) wants to merge 1 commit into
mainfrom
fix/config-dump-resolved
Open

fix(config): resolve components in config dump output#337
Nan Liu (liunan-ms) wants to merge 1 commit into
mainfrom
fix/config-dump-resolved

Conversation

@liunan-ms

Copy link
Copy Markdown
Contributor

Summary

azldev config dump previously serialized the file-level merged config, so per-file overlays (overlay-files) and inherited default-component-config were invisible even though builds honor them (issue #264).

This change resolves each component through the resolver before serialization:

  • Component entries now include inherited defaults (project / distro / group) and overlays expanded from overlay-files.
  • Components discovered via group spec globs are included.
  • Runtime-only state (Locked, RenderedSpecDir) is stripped so it doesn't leak into the JSON dump.
  • The loaded config is not mutated.

The dump retains the default-component-config blocks alongside the resolved component entries, so it is an inspection snapshot and is not intended to be reloaded as project configuration (this is called out in the updated help and docs).

Docs

  • Updated config-system.md, config-file.md, and repos.md to describe the resolved snapshot and drop the round-trippability claim.
  • Corrected -O json-f json in examples (config dump uses its own -f/--format flag; -O never controlled its output).
  • Regenerated azldev_config_dump.md via mage docs.

Testing

  • mage all (unit + scenario + checks) passes.
  • New unit tests cover inherited defaults across all layers, overlay-file expansion, runtime-field exclusion, source-config immutability, and spec-discovered components.

Fixes #264

`azldev config dump` now resolves each component before serializing, so the
output includes inherited defaults and overlays expanded from `overlay-files`.
Runtime-only lock and rendered-spec-dir state are excluded. The dump retains the
default configuration blocks alongside resolved component entries, so it is an
inspection snapshot and is not intended to be reloaded as project
configuration.

Fixes #264
Copilot AI lite review requested due to automatic review settings September 3, 2026 00:22

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The resolver-based dump behavior matches the documented intent, avoids mutating loaded config, and is covered by targeted unit tests for the new resolution semantics.

Pull request overview

This PR updates azldev config dump to emit a resolved (post-component-resolver) configuration snapshot rather than the pre-resolver, file-merge view. This makes the command accurately reflect inherited default-component-config values and per-file overlay expansion (overlay-files), aligning the dump output with what build/render workflows actually use.

Changes:

  • Resolve all components via the component resolver before dumping, including spec-discovered components, and serialize the resolved view.
  • Strip resolver/runtime-only fields (Locked, RenderedSpecDir) from dumped component entries to avoid leaking runtime state.
  • Update command help and docs to clarify the output is an inspection snapshot (not intended to be reloaded), and fix examples to use -f json.
File summaries
File Description
internal/app/azldev/cmds/config/dump.go Switches dump output to a resolver-based “effective config” snapshot and strips runtime-only fields before serialization.
internal/app/azldev/cmds/config/dump_test.go Adds unit tests for resolved defaults/overlays, runtime-field exclusion, immutability, and spec-discovered components.
docs/user/reference/config/config-file.md Updates guidance and corrects the config dump JSON flag usage (-f json) while clarifying snapshot semantics.
docs/user/reference/cli/azldev_config_dump.md Regenerates CLI docs to match updated help text describing resolved snapshot output.
docs/user/explanation/repos.md Removes the round-trippability claim and fixes config dump example flag usage.
docs/user/explanation/config-system.md Clarifies that config dump includes component inheritance + overlay-file expansion and is not reloadable configuration.
Review details
  • Files reviewed: 6/6 changed files
  • Comments generated: 0
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@liunan-ms
Nan Liu (liunan-ms) marked this pull request as ready for review September 3, 2026 18:57
@liunan-ms Nan Liu (liunan-ms) added the state: needs review PRs that need review label Sep 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

state: needs review PRs that need review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

config dump omits per-file overlays and inherited default-component-config

2 participants