Skip to content

feat(config): Add fingerprint ignore tags to some config fields#46

Draft
dmcilvaney wants to merge 1 commit intomicrosoft:mainfrom
dmcilvaney:damcilva/component_change_detection_parts/4
Draft

feat(config): Add fingerprint ignore tags to some config fields#46
dmcilvaney wants to merge 1 commit intomicrosoft:mainfrom
dmcilvaney:damcilva/component_change_detection_parts/4

Conversation

@dmcilvaney
Copy link
Copy Markdown
Contributor

No description provided.

Copilot AI review requested due to automatic review settings March 31, 2026 00:52
Copy link
Copy Markdown

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

This PR introduces a fingerprint:"-" struct tag on selected internal/projectconfig fields to mark them as excluded from “component fingerprinting”, and adds a test to ensure the exclusion list stays consistent over time.

Changes:

  • Add fingerprint:"-" tags to multiple config fields that are intended to be treated as non-build-input metadata.
  • Add a reflection-based unit test to detect accidental additions/removals of fingerprint:"-" exclusions.

Reviewed changes

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

Show a summary per file
File Description
internal/projectconfig/overlay.go Excludes ComponentOverlay.Description from the fingerprint via tag.
internal/projectconfig/build.go Excludes check/failure/hints “reason/policy” fields from the fingerprint via tag.
internal/projectconfig/component.go Excludes bookkeeping/back-reference fields and SourceFileReference.Origin from the fingerprint via tag.
internal/projectconfig/distro.go Excludes DistroReference.Snapshot from the fingerprint via tag.
internal/projectconfig/fingerprint_test.go Adds a test that asserts the expected set of fingerprint exclusions.


// Origin for this source file. When omitted, the file is resolved via the lookaside cache.
Origin Origin `toml:"origin,omitempty" json:"origin,omitempty"`
Origin Origin `toml:"origin,omitempty" json:"origin,omitempty" fingerprint:"-"`
Copy link

Copilot AI Mar 31, 2026

Choose a reason for hiding this comment

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

Excluding SourceFileReference.Origin from the fingerprint assumes the source file’s content is fully captured by Filename + Hash/HashType, but hash/hash-type are optional and downloads proceed without validation when they’re empty (see downloadAndValidate in internal/providers/sourceproviders/sourcemanager.go). If the fingerprint is used to decide whether sources/build outputs are up-to-date, consider including Origin when hash info is missing, or enforce that hash + hash-type are required for source-files entries so changes in origin can’t silently change inputs without changing the fingerprint.

Suggested change
Origin Origin `toml:"origin,omitempty" json:"origin,omitempty" fingerprint:"-"`
Origin Origin `toml:"origin,omitempty" json:"origin,omitempty"`

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Good point.

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.

Will add a check to the calculation step that errors on this case

Version string `toml:"version,omitempty" json:"version,omitempty" jsonschema:"title=Version,description=Version of the referenced distro"`
// Snapshot date/time for source code if specified components will use source as it existed at this time.
Snapshot string `toml:"snapshot,omitempty" json:"snapshot,omitempty" jsonschema:"format=date-time,title=Snapshot,description=If specified use source code as it existed at this date/time"`
Snapshot string `toml:"snapshot,omitempty" json:"snapshot,omitempty" jsonschema:"format=date-time,title=Snapshot,description=If specified use source code as it existed at this date/time" fingerprint:"-"`
Copy link

Copilot AI Mar 31, 2026

Choose a reason for hiding this comment

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

DistroReference.Snapshot directly affects which upstream commit is checked out when upstream-commit isn’t set (see checkoutTargetCommit in internal/providers/sourceproviders/fedorasourceprovider.go). Ignoring snapshot in the fingerprint can therefore miss real input changes when the snapshot time changes. If you intend to keep snapshot out of the fingerprint, the resolved commit hash used for the checkout should be captured elsewhere and included in the fingerprint/state instead.

Suggested change
Snapshot string `toml:"snapshot,omitempty" json:"snapshot,omitempty" jsonschema:"format=date-time,title=Snapshot,description=If specified use source code as it existed at this date/time" fingerprint:"-"`
Snapshot string `toml:"snapshot,omitempty" json:"snapshot,omitempty" jsonschema:"format=date-time,title=Snapshot,description=If specified use source code as it existed at this date/time"`

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Agreed.

@dmcilvaney dmcilvaney marked this pull request as draft March 31, 2026 01:41
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