Skip to content

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

Open
dmcilvaney wants to merge 12 commits into
microsoft:mainfrom
dmcilvaney:damcilva/add_history_tool
Open

feat(cli): add history command to show changes made to components#212
dmcilvaney wants to merge 12 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
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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.
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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 +365 to +368
// filterChangesSince returns the subset of changes with a timestamp >= since.
// When since is zero, the input slice is returned unchanged. The returned
// slice retains the input ordering (oldest first, per
// [sources.FindFingerprintChanges]).
Comment on lines +92 to +98
func precomputeTomlMetricsForStubs(
workerEnv *azldev.Env,
env *azldev.Env,
ctx *historyContext,
stubs []historyStub,
since time.Time,
) (map[string]tomlMetrics, error) {
Copilot AI review requested due to automatic review settings May 29, 2026 18:15
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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.

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.

2 participants