feat(lock): compute and store input fingerprints during component update - #123
Conversation
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
There was a problem hiding this comment.
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-fingerprintduring lock save, and markChanged=truewhen the fingerprint differs even if the upstream commit is unchanged. - Add helper logic to resolve per-component distro
release-verfor 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. |
8736c35 to
5b63146
Compare
| env.FS(), | ||
| *results[idx].config, | ||
| releaseVer, | ||
| fingerprint.IdentityOptions{ |
There was a problem hiding this comment.
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.
9abfdfb
into
microsoft:main
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