You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Verify CLI stack binaries match runtime images - #64
A release handover can contain CLI stack archives and runtime images from different builds. Archive format checks alone do not detect this desynchronization.
What
Add optional runtime image/path mappings to product CLI inventories and compare SHA-256 hashes of the extracted executable bytes. Runtime extraction explicitly selects and verifies each Linux platform without starting containers. Missing artifacts and mismatched binaries fail with image, path, platform, and checksum diagnostics.
Enable mappings for RHTAS 1.5 tools and the 1.4 inventory, including single-architecture tuftool. Preserve archive-only inventories, YAML replacement/disabling, and legacy client-server behavior. Document the new configuration.
Support tests, acceptance compilation, and repository lint pass. CLI checks pass against the supplied 1.5.0 snapshot and the 1.4.3 snapshot; an intentionally mismatched runtime executable fails as expected. The releases repository is unchanged.
• Compare packaged Linux executables with platform-specific runtime image binaries using SHA-256.
• Validate optional runtime mappings while preserving archive-only and inventory override behavior.
• Enable parity checks for RHTAS 1.5 and 1.4 inventories with diagnostic tests.
➕ Could operate without a Docker daemon using OCI registry APIs.
➖ Requires layer and whiteout reconstruction or an additional image library.
➖ Introduces more implementation complexity and dependency surface.
2. Build provenance comparison
➕ Can establish artifact origin without downloading every runtime executable.
➕ May reduce repeated multi-architecture image extraction work.
➖ Requires trustworthy provenance linking archives and runtime images.
➖ Does not directly prove that distributed executable bytes are identical.
Recommendation: Retain the PR's byte-level SHA-256 comparison through the existing Docker support layer. It directly verifies the required invariant, reuses established extraction behavior, supports foreign architectures without execution, and keeps runtime parity optional. Registry-native extraction could be considered later if daemon dependence or extraction cost becomes problematic.
Files changed (12) +494 / -91
Enhancement (4) +127 / -7
config.goAdd validated runtime mappings to CLI inventory entries+18/-4
Add validated runtime mappings to CLI inventory entries
• Extends stack binaries with optional runtime image and path metadata. Validation restricts mappings to Linux and requires a nonempty image key plus a canonical absolute executable path.
helper.goRun runtime parity during CLI stack validation+5/-0
Run runtime parity during CLI stack validation
• Retains the complete snapshot image map and invokes runtime comparison after archive extraction and executable format validation whenever a mapping is configured.
parity.goCompare archive and runtime executable hashes+50/-0
Compare archive and runtime executable hashes
• Adds platform-aware runtime executable extraction and SHA-256 comparison. Errors include stack and runtime image references, paths, platform, and both checksums when bytes differ.
image_utils.goExtract files from explicit image platforms+54/-3
Extract files from explicit image platforms
• Adds platform-aware image inspection and pulling, verifies the selected OS and architecture, and copies files through unstarted temporary containers. Existing extraction now returns initialization errors instead of panicking and closes Docker clients.
client_server_test.goReuse the shared SHA-256 file helper+7/-25
Reuse the shared SHA-256 file helper
• Replaces the acceptance test's private checksum implementation with the shared support utility. Removes duplicate hashing imports and code while preserving legacy client-server comparisons.
• Uses a mock Docker API to cover cached, foreign, replaced, unavailable, and incorrectly resolved platforms plus missing files. It also verifies explicit platform propagation and temporary container cleanup.
• Maps 28 Linux CLI archives across four architectures to their corresponding runtime images and executable paths. Non-Linux and unsupported distribution channels remain archive-only.
DescribeCLIStackImageTests now applies the default runtime mappings even when a snapshot contains
only CLI-stack images, so compareRuntimeBinary cannot resolve the first runtime image key. The
releases repository’s CLI-only 1.4 snapshot triggers the CLI-stack suite without a test override but
contains none of the required runtime images, causing its validation to fail.
Concrete release-validation failure from defaults applying runtime mappings to CLI-only snapshots.
ⓘ Recommendations generated based on similar findings in past PRs
Evidence
The PR adds a runtime dependency to each default Linux archive and attempts to resolve it from the
same snapshot. The releases workflow detects any cli-stack section, runs the CLI-stack suite, and
supplies no override when a testing resource is absent, while the standalone 1.4 snapshot contains
only stack-image references.
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution
## Issue description
The default CLI-stack inventory now requires runtime image keys, but CLI-only snapshots in the releases repository contain only stack images and are still selected for CLI-stack validation.
## Fix Focus Areas
- test/acceptance/rhtas/defaults.yaml[79-136]
- test/support/cli/helper.go[36-60]
## Recommended Fix
Coordinate with the releases repository so CLI-only snapshots include digest-pinned runtime image entries for every enabled parity mapping. If those snapshots must remain archive-only, provide a release-specific `testingResources/structural-tests.yaml` inventory that replaces the defaults with mappings that omit `runtime`.
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
StackConfig.validate accepts any canonical non-root absolute runtime path, including a directory
such as /usr/local/bin, without confirming that it denotes an executable file. When such a mapping
is used, the new runtime comparison reaches fileFromImage, whose tar extraction writes the first
regular entry it sees rather than verifying that the requested path itself was copied.
Plausible extraction correctness issue, but no closely matching precedent for validating executable
file types.
ⓘ Recommendations generated based on similar findings in past PRs
Evidence
The added validation only requires Linux, a nonblank image key, and a canonical absolute non-root
path; it has no file-type check. The new parity path calls the image extraction helper, and that
helper iterates the copied tar stream until it finds any regular entry, without matching the entry
name to the configured source path.
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution
Issue description
A runtime mapping can name a directory even though the configuration and documentation require an executable path. The extraction helper then accepts the first regular tar entry, so a misconfigured directory mapping can compare the archive executable with an unrelated file inside that directory.
Fix Focus Areas
- test/support/cli/config.go[95-99]
- test/support/image_utils.go[271-325]
Recommended Fix
After copying the configured runtime path, inspect the returned container path metadata and reject directories and non-regular entries before extracting or hashing. Keep the existing canonical-path validation, and add a test showing that a directory runtime mapping fails rather than comparing a descendant file.
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
Review mode: 🧠 Deep: This is a broad, behavior-changing parity feature spanning configuration, multi-platform image extraction, checksum validation, inventories, and acceptance/test paths, with many independent logic sites where subtle defects could be missed in one pass.
Tip of the day
💡 Did you know, you can route each action level your way: inline, summary, both, or drop
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
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.
Why
A release handover can contain CLI stack archives and runtime images from different builds. Archive format checks alone do not detect this desynchronization.
What
Add optional runtime image/path mappings to product CLI inventories and compare SHA-256 hashes of the extracted executable bytes. Runtime extraction explicitly selects and verifies each Linux platform without starting containers. Missing artifacts and mismatched binaries fail with image, path, platform, and checksum diagnostics.
Enable mappings for RHTAS 1.5 tools and the 1.4 inventory, including single-architecture tuftool. Preserve archive-only inventories, YAML replacement/disabling, and legacy client-server behavior. Document the new configuration.
Support tests, acceptance compilation, and repository lint pass. CLI checks pass against the supplied 1.5.0 snapshot and the 1.4.3 snapshot; an intentionally mismatched runtime executable fails as expected. The releases repository is unchanged.