feat(cli): add history command to show changes made to components#212
Merged
Conversation
If a single component is specified, the history command will show the full details of the changes made to that component, including commit details if '-O json' is used.
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a new azldev component history subcommand to report per-component change activity (TOML commit counts, customization items, and lock fingerprint-change history), with MCP tool exposure and scenario-level coverage.
Changes:
- Introduces
azldev component historycommand implementation, including JSON output shape and a single-component “card” view. - Adds git helper to count commits touching a specific file efficiently via
git log. - Adds a scenario smoke test and updates the MCP server mode snapshot to include the new tool.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| scenario/component_history_test.go | New scenario smoke test for component history JSON output and filtering behavior. |
| scenario/snapshots/TestMCPServerMode_1.snap.json | Snapshot updated to include the new MCP tool definition for component-history. |
| internal/utils/git/log.go | New helper for fast per-file commit counting via git log. |
| internal/app/azldev/core/sources/synthistory.go | Adds JSON tags for commit metadata structs used in history output. |
| internal/app/azldev/cmds/component/history.go | New component history command, options, output types, and parallelized metric computation. |
| internal/app/azldev/cmds/component/component.go | Wires the new history subcommand into the component command tree. |
Extract the rendering, customization-collection, and git-metrics logic out of the ~1100-line history.go into history_render.go, history_customizations.go, and history_gitmetrics.go. All files remain in package component; no behavior change.
Member
|
@dmcilvaney Is your plan to port this atop #217? |
Contributor
Author
We could do that, but it wasn't needed for my use-case. |
Comment on lines
+173
to
+177
| // TomlCommits is the number of commits touching the component's source | ||
| // TOML file. When shared-mode = "omit" and the component shares its TOML | ||
| // with another component, the count is suppressed to zero (with | ||
| // SharedToml=true) -- unless the component was named explicitly, which | ||
| // always reports the real count. |
Comment on lines
+461
to
+463
| return fmt.Errorf( | ||
| "invalid --shared value %#q (want one of: %s, %s)", | ||
| mode, sharedTomlModeShow, sharedTomlModeOmit) |
liunan-ms
reviewed
Jul 6, 2026
liunan-ms
reviewed
Jul 6, 2026
liunan-ms
left a comment
Contributor
There was a problem hiding this comment.
The history command would be very helpful! I just have a question about reading raw config or resolved config for customizations.
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.
If a single component is specified, the history command will show the full details of the changes made to that component, including commit details if '-O json' is used.