feat(component): Add component change detection#42
Draft
dmcilvaney wants to merge 12 commits intomicrosoft:mainfrom
Draft
feat(component): Add component change detection#42dmcilvaney wants to merge 12 commits intomicrosoft:mainfrom
dmcilvaney wants to merge 12 commits intomicrosoft:mainfrom
Conversation
There was a problem hiding this comment.
Pull request overview
Adds a component “identity fingerprint” mechanism to support CI change detection and build-queue determination, plus optional dist-git/synthetic-history creation during source preparation.
Changes:
- Introduce
azldev component identityandazldev component diff-identitycommands and wire them into the component command tree. - Add a new
internal/fingerprintpackage to compute deterministic component fingerprints from resolved config + source identity + overlays + distro context + “Affects:” commit count. - Extend source providers/source manager with source-identity resolution and a fetch option to preserve upstream
.gitfor synthetic history generation (--with-gitin build/prepare-sources).
Reviewed changes
Copilot reviewed 44 out of 45 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| scenario/internal/buildtest/buildtest.go | Formatting-only change to BuildTest construction. |
| scenario/component_identity_test.go | New scenario coverage for identity/diff-identity CLI behavior. |
| scenario/snapshots/TestMCPServerMode_1.snap.json | Snapshot update reflecting new MCP tool exposure for component identity. |
| scenario/snapshots/TestComponentIdentitySnapshots_identity_help_stdout_1.snap | New snapshot for component identity --help. |
| scenario/snapshots/TestComponentIdentitySnapshots_identity_help_stderr_1.snap | New stderr snapshot for component identity --help. |
| scenario/snapshots/TestComponentIdentitySnapshots_identity_help_1.snap.json | New exit-code snapshot for component identity --help. |
| scenario/snapshots/TestComponentIdentitySnapshots_diff-identity_help_stdout_1.snap | New snapshot for component diff-identity --help. |
| scenario/snapshots/TestComponentIdentitySnapshots_diff-identity_help_stderr_1.snap | New stderr snapshot for component diff-identity --help. |
| scenario/snapshots/TestComponentIdentitySnapshots_diff-identity_help_1.snap.json | New exit-code snapshot for component diff-identity --help. |
| internal/utils/git/git_test/git_mocks.go | Extend git provider mocks with LsRemoteHead. |
| internal/utils/git/git.go | Add GitProvider.LsRemoteHead (uses git ls-remote). |
| internal/providers/sourceproviders/sourceproviders_test/sourcemanager_mocks.go | Update mocks for new FetchComponent varargs + add ResolveSourceIdentity. |
| internal/providers/sourceproviders/sourcemanager.go | Add source identity resolution, fetch options, and provider interface updates. |
| internal/providers/sourceproviders/rpmcontentsprovider.go | Support new fetch option signature + add RPM-based source identity hashing. |
| internal/providers/sourceproviders/localidentity.go | New local spec-dir hashing identity provider. |
| internal/providers/sourceproviders/identityprovider_test.go | Unit tests for local/fedora/rpm identity providers. |
| internal/providers/sourceproviders/fedorasourceprovider.go | Add PreserveGitDir support and implement upstream source identity. |
| internal/projectconfig/overlay.go | Exclude overlay Description from fingerprinting via struct tag. |
| internal/projectconfig/fingerprint_test.go | Guard test ensuring fingerprint exclusions are explicitly tracked. |
| internal/projectconfig/configfile.go | Add ConfigFile.SourcePath() and ConfigFile.Dir() accessors. |
| internal/projectconfig/component.go | Exclude config metadata fields from fingerprint hashing. |
| internal/projectconfig/build.go | Exclude non-build-input fields (reasons/hints/failure policy) from fingerprint hashing. |
| internal/fingerprint/fingerprint_test.go | Unit tests covering fingerprint behavior and excluded fields. |
| internal/fingerprint/fingerprint.go | New fingerprint computation logic and input-combination scheme. |
| internal/fingerprint/doc.go | Package documentation for fingerprint module. |
| internal/app/azldev/core/sources/synthistory_test.go | Unit tests for affects-commit scanning and synthetic commit creation. |
| internal/app/azldev/core/sources/synthistory.go | New Affects-commit detection + synthetic history generation utilities. |
| internal/app/azldev/core/sources/sourceprep_test.go | Update mocks for new fetch options signature. |
| internal/app/azldev/core/sources/sourceprep.go | Add WithGitRepo option, preserve .git on fetch, generate synthetic history, refactor overlay application flow. |
| internal/app/azldev/core/componentbuilder/componentbuilder_test.go | Update mocks for new fetch options signature. |
| internal/app/azldev/cmds/component/preparesources.go | Add --with-git flag and plumb into source preparer. |
| internal/app/azldev/cmds/component/identity.go | New component identity command and parallel computation logic. |
| internal/app/azldev/cmds/component/diffsources.go | Whitespace-only change. |
| internal/app/azldev/cmds/component/diffidentity_test.go | Unit tests for identity diff computation. |
| internal/app/azldev/cmds/component/diffidentity.go | New component diff-identity command + identity file parsing + diffing. |
| internal/app/azldev/cmds/component/component.go | Register new identity/diff-identity subcommands. |
| internal/app/azldev/cmds/component/build.go | Add --with-git flag and plumb into source preparer. |
| go.mod | Add new dependencies (go-git, hashstructure). |
| go.sum | Dependency checksum updates for new modules. |
| docs/user/reference/cli/azldev_component_prepare-sources.md | Auto-generated CLI docs updated for --with-git. |
| docs/user/reference/cli/azldev_component_identity.md | Auto-generated CLI docs for new component identity. |
| docs/user/reference/cli/azldev_component_diff-identity.md | Auto-generated CLI docs for new component diff-identity. |
| docs/user/reference/cli/azldev_component_build.md | Auto-generated CLI docs updated for --with-git. |
| docs/user/reference/cli/azldev_component.md | Auto-generated CLI docs updated for new subcommands. |
| change-detection-prd.md | PRD describing the change-detection design and rationale. |
854ff0c to
8326413
Compare
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.
Uh oh!
There was an error while loading. Please reload this page.