Enhanced comparison - introduced an equalityClass#368
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR replaces the binary Equal flag with a multi-level EqualityClass system to better classify image comparisons. The new system distinguishes between binary identical, semantically identical, semantically identical (unverified), and different images, with support for classifying differences as volatile (e.g., UUIDs that change on each build) or meaningful (e.g., kernel changes).
Changes:
- Introduced
EqualityClassenum with four states:binary_identical,semantically_identical,semantically_identical_unverified, anddifferent - Added optional
--hash-imagesflag to compute SHA256 digests (disabled by default for performance) - Updated comparison logic to tally volatile vs. meaningful diffs with detailed reasoning
Reviewed changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| internal/image/imageinspect/renderer_text.go | Updated text rendering to display equality class and hash information, added helper functions for rendering equality headers and reasons |
| internal/image/imageinspect/imageinspect_integration_test.go | Updated test calls to pass hash parameter to inspector |
| internal/image/imageinspect/imageinspect_core_test.go | Updated test calls to use new inspectCoreNoHash method |
| internal/image/imageinspect/imageinspect.go | Added SHA256 computation support and hash parameter to inspector |
| internal/image/imageinspect/compare_test.go | Updated test assertions to check Equality.Class instead of Equal boolean |
| internal/image/imageinspect/compare_efi.go | Added kernel cmdline normalization to handle UUID variations |
| internal/image/imageinspect/compare.go | Replaced Equal boolean with Equality struct, added diff tallying logic |
| internal/image/imageinspect/bootloader_efi.go | Minor comment formatting updates |
| cmd/os-image-composer/inspect_cmd_test.go | Updated test mocks to accept hash parameter |
| cmd/os-image-composer/inspect_cmd.go | Updated inspector initialization to pass hash parameter |
| cmd/os-image-composer/compare_cmd_test.go | Updated test mocks to accept hash parameter |
| cmd/os-image-composer/compare_cmd.go | Added --hash-images flag and updated JSON output to use equality class |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
arodage
reviewed
Jan 29, 2026
arodage
reviewed
Jan 29, 2026
arodage
approved these changes
Jan 29, 2026
Contributor
arodage
left a comment
There was a problem hiding this comment.
Minor comments. Otherwise LGTM.
yockgen
approved these changes
Jan 29, 2026
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.
Merge Checklist
All boxes should be checked before merging the PR
Description
Equalflag to introduce levels of equality with images(https://jira.devtools.intel.com/browse/ITEP-84987)
Any Newly Introduced Dependencies
How Has This Been Tested?
go-test