Skip to content

feat(cli): add history command to show changes made to components#212

Merged
dmcilvaney merged 14 commits into
microsoft:mainfrom
dmcilvaney:damcilva/add_history_tool
Jul 6, 2026
Merged

feat(cli): add history command to show changes made to components#212
dmcilvaney merged 14 commits into
microsoft:mainfrom
dmcilvaney:damcilva/add_history_tool

Conversation

@dmcilvaney

Copy link
Copy Markdown
Contributor

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.

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.
Copilot AI review requested due to automatic review settings May 27, 2026 20:53

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.

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 history command 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.

Comment thread internal/app/azldev/cmds/component/history.go
Comment thread internal/app/azldev/cmds/component/history.go Outdated
Comment thread internal/app/azldev/cmds/component/history.go Outdated

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.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

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.

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.

Pull request overview

Copilot reviewed 12 out of 12 changed files in this pull request and generated 2 comments.

Comment thread internal/app/azldev/cmds/component/history_gitmetrics.go Outdated
Comment thread internal/app/azldev/cmds/component/history_gitmetrics.go
Copilot AI review requested due to automatic review settings May 29, 2026 18:15

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.

Pull request overview

Copilot reviewed 12 out of 12 changed files in this pull request and generated no new comments.

@reubeno

reubeno commented Jun 9, 2026

Copy link
Copy Markdown
Member

@dmcilvaney Is your plan to port this atop #217?

@dmcilvaney

Copy link
Copy Markdown
Contributor Author

@dmcilvaney Is your plan to port this atop #217?

We could do that, but it wasn't needed for my use-case.

Copilot AI review requested due to automatic review settings July 6, 2026 19:15

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.

Pull request overview

Copilot reviewed 12 out of 12 changed files in this pull request and generated 2 comments.

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)
Comment thread internal/app/azldev/cmds/component/history.go

@liunan-ms liunan-ms 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.

The history command would be very helpful! I just have a question about reading raw config or resolved config for customizations.

@liunan-ms liunan-ms 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.

LGTM

@dmcilvaney dmcilvaney merged commit 8ffb780 into microsoft:main Jul 6, 2026
18 checks passed
@dmcilvaney dmcilvaney deleted the damcilva/add_history_tool branch July 6, 2026 22:53
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.

4 participants