Skip to content

feat(lock): compute and store input fingerprints during component update - #123

Merged
Daniel McIlvaney (dmcilvaney) merged 2 commits into
microsoft:mainfrom
dmcilvaney:damcilva/add_commit_lock_file_parts/6_fingerprint_integration
Apr 28, 2026
Merged

feat(lock): compute and store input fingerprints during component update#123
Daniel McIlvaney (dmcilvaney) merged 2 commits into
microsoft:mainfrom
dmcilvaney:damcilva/add_commit_lock_file_parts/6_fingerprint_integration

Conversation

@dmcilvaney

Copy link
Copy Markdown
Contributor

Wire fingerprint.ComputeIdentity into the update command's save path. After resolving upstream commits, the fingerprint is recomputed from the resolved component config, lock state (ManualBump, UpstreamCommit), and distro release version, then stored as input-fingerprint in the lock file. In this initial version the fingerprint is recomputed for every resolved component on every update, not just when the upstream commit changes:

Commit changed: Changed=true (as before)
Commit same but fingerprint differs: Changed=true (new)
Both same: skip, no write

Wire fingerprint.ComputeIdentity into the update command's save path.
After resolving upstream commits, the fingerprint is recomputed from the
resolved component config, lock state (ManualBump, UpstreamCommit), and
distro release version, then stored as input-fingerprint in the lock file.

The fingerprint is recomputed for every resolved component on every
update, not just when the upstream commit changes. This ensures config
and overlay edits are detected:
- Commit changed: Changed=true (as before)
- Commit same but fingerprint differs: Changed=true (new)
- Both same: skip, no write
Copilot AI review requested due to automatic review settings April 28, 2026 01:21

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

This PR wires fingerprint.ComputeIdentity into azldev component update so that per-component lock files store an input-fingerprint derived from resolved component config, lock state (e.g., manual-bump, upstream-commit), and the distro release-ver. The update flow treats a component as “changed” if either the upstream commit changes or the recomputed fingerprint differs from what’s in the existing lock.

Changes:

  • Recompute and persist input-fingerprint during lock save, and mark Changed=true when the fingerprint differs even if the upstream commit is unchanged.
  • Add helper logic to resolve per-component distro release-ver for fingerprint computation.
  • Add/expand tests covering fingerprint write/idempotency and the “fingerprint-only diff implies changed” behavior.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 5 comments.

File Description
internal/app/azldev/core/testutils/testenv.go Adds a ReleaseVer to the test distro version so fingerprints can include releasever in tests.
internal/app/azldev/cmds/component/update.go Computes fingerprints during save, updates “changed” semantics, and resolves release-ver per component.
internal/app/azldev/cmds/component/update_test.go Adds end-to-end-ish update tests with mocked git and lockfile assertions.
internal/app/azldev/cmds/component/update_internal_test.go Adds unit tests for saveComponentLocks fingerprint behavior and lifecycle scenarios.

Comment thread internal/app/azldev/cmds/component/update_test.go Outdated
Comment thread internal/app/azldev/cmds/component/update_test.go
Comment thread internal/app/azldev/cmds/component/update.go
Comment thread internal/app/azldev/cmds/component/update_internal_test.go Outdated
Comment thread internal/app/azldev/cmds/component/update_test.go
@dmcilvaney
Daniel McIlvaney (dmcilvaney) force-pushed the damcilva/add_commit_lock_file_parts/6_fingerprint_integration branch from 8736c35 to 5b63146 Compare April 28, 2026 01:36
env.FS(),
*results[idx].config,
releaseVer,
fingerprint.IdentityOptions{

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This is slightly awkward, need to modify the fingerprint library (the values are meant to be opaque as described right now, but this uses them explicitly as a commit). Will fix later.

@dmcilvaney
Daniel McIlvaney (dmcilvaney) merged commit 9abfdfb into microsoft:main Apr 28, 2026
14 checks passed
@dmcilvaney
Daniel McIlvaney (dmcilvaney) deleted the damcilva/add_commit_lock_file_parts/6_fingerprint_integration branch April 28, 2026 20:52
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.

3 participants