Auto-verify artifact packages against require/recommend#4726
Conversation
There was a problem hiding this comment.
Code Review
The pull request introduces an automatic verification phase for artifact packages, ensuring that packages listed in require/recommend are installed from the tmt-artifact-shared repository when the artifact plugin is enabled with verify=True. This is a valuable addition for ensuring test environment integrity. The implementation correctly handles the intersection of artifact metadata and test requirements, and prioritizes explicit verify-installation configurations over auto-detected ones. The use of Final for constants in tmt/steps/prepare/artifact/__init__.py is a good practice.
Queues are "burried" inside `go()` methods, but if we want to support addition of new tasks from outside of the step, the queue needs to become step-level instance attribute so it can be modified from outside of `go()`. Related to #4726
Adding concept of ordering to queue tasks. Most of the time, tasks will inherit their order from phases they represent. This will allow reordering of queue after adding new tasks while the queue is already running - today, the queue is sorted at the beginning, because steps already add tasks in the order of phases they represent. Related to #4726.
Add automatic verification of packages installed from artifact repositories against test require/recommend and explicit prepare install phases. This ensures packages were installed from the expected artifact sources rather than from default system repositories. The verification runs as an auto-injected verify-installation phase that computes the intersection of artifact package names and test dependencies. Set 'verify: false' on the artifact phase to opt out. Changes: - Move auto-verify logic into artifact plugin for better cohesion - Remove unnecessary threading.Lock from PrepareArtifact - Add schema and release note documentation - Add unit and integration tests Fixes: #4726
Add automatic verification of packages installed from artifact repositories against test require/recommend and explicit prepare install phases. This ensures packages were installed from the expected artifact sources rather than from default system repositories. The verification runs as an auto-injected verify-installation phase that computes the intersection of artifact package names and test dependencies. Each artifact phase populates the shared verify phase with packages from its own providers. Tests can opt-out by setting 'verify: false' on the artifact phase. Changes: - Move auto-verify logic into artifact plugin for better cohesion - Add _populate_verify_from_providers() to compute package intersections - Add _inject_artifact_verify_phase() to auto-inject verification phase - Add 'verify' option to artifact schema (default: true) - Add schema support for package-to-repo mapping in verify-installation - Add unit tests for verify population and phase injection - Add integration tests for auto-verify and opt-out behavior - Add release notes documentation Fixes: #4726
Add automatic verification of packages installed from artifact repositories against test require/recommend and explicit prepare install phases. This ensures packages were installed from the expected artifact sources rather than from default system repositories. The verification runs as an auto-injected verify-installation phase that computes the intersection of artifact package names and test dependencies. Each artifact phase populates the shared verify phase with packages from its own providers. Tests can opt-out by setting 'verify: false' on the artifact phase. Changes: - Move auto-verify logic into artifact plugin for better cohesion - Add _populate_verify_from_providers() to compute package intersections - Add _inject_artifact_verify_phase() to auto-inject verification phase - Add 'verify' option to artifact schema (default: true) - Add schema support for package-to-repo mapping in verify-installation - Add unit tests for verify population and phase injection - Add integration tests for auto-verify and opt-out behavior - Add release notes documentation Fixes: #4726
Add automatic verification of packages installed from artifact repositories against test require/recommend and explicit prepare install phases. This ensures packages were installed from the expected artifact sources rather than from default system repositories. The verification runs as an auto-injected verify-installation phase that computes the intersection of artifact package names and test dependencies. Each artifact phase populates the shared verify phase with packages from its own providers. Tests can opt-out by setting 'verify: false' on the artifact phase. Changes: - Move auto-verify logic into artifact plugin for better cohesion - Add _populate_verify_from_providers() to compute package intersections - Add _inject_artifact_verify_phase() to auto-inject verification phase - Add 'verify' option to artifact schema (default: true) - Add schema support for package-to-repo mapping in verify-installation - Add unit tests for verify population and phase injection - Add integration tests for auto-verify and opt-out behavior - Add release notes documentation Fixes: #4726
Add automatic verification of packages installed from artifact repositories against test require/recommend and explicit prepare install phases. This ensures packages were installed from the expected artifact sources rather than from default system repositories. The verification runs as an auto-injected verify-installation phase that computes the intersection of artifact package names and test dependencies. Each artifact phase populates the shared verify phase with packages from its own providers. Tests can opt-out by setting 'verify: false' on the artifact phase. Changes: - Move auto-verify logic into artifact plugin for better cohesion - Add _populate_verify_from_providers() to compute package intersections - Add _inject_artifact_verify_phase() to auto-inject verification phase - Add 'verify' option to artifact schema (default: true) - Add schema support for package-to-repo mapping in verify-installation - Add unit tests for verify population and phase injection - Add integration tests for auto-verify and opt-out behavior - Add release notes documentation Fixes: #4726
Add automatic verification of packages installed from artifact repositories against test require/recommend and explicit prepare install phases. This ensures packages were installed from the expected artifact sources rather than from default system repositories. The verification runs as an auto-injected verify-installation phase that computes the intersection of artifact package names and test dependencies. Each artifact phase populates the shared verify phase with packages from its own providers. Tests can opt-out by setting 'auto_verify: false' on the artifact phase. Changes: - Move auto-verify logic into artifact plugin for better cohesion - Add _populate_verify_from_providers() to compute package intersections - Add _inject_artifact_verify_phase() to auto-inject verification phase - Add 'auto_verify' option to artifact schema (default: true) - Add schema support for package-to-repo mapping in verify-installation - Add integration tests for auto-verify and opt-out behavior - Add release notes documentation Fixes: #4726
Add automatic verification of packages installed from artifact repositories against test require/recommend and explicit prepare install phases. This ensures packages were installed from the expected artifact sources rather than from default system repositories. The verification runs as an auto-injected verify-installation phase that computes the intersection of artifact package names and test dependencies. Each artifact phase populates the shared verify phase with packages from its own providers. Tests can opt-out by setting 'auto_verify: false' on the artifact phase. Changes: - Move auto-verify logic into artifact plugin for better cohesion - Add _populate_verify_from_providers() to compute package intersections - Add _inject_artifact_verify_phase() to auto-inject verification phase - Add 'auto_verify' option to artifact schema (default: true) - Add schema support for package-to-repo mapping in verify-installation - Add integration tests for auto-verify and opt-out behavior - Add release notes documentation Fixes: #4726
971462b to
3c77c8e
Compare
Add automatic verification of packages installed from artifact repositories against test require/recommend and explicit prepare install phases. This ensures packages were installed from the expected artifact sources rather than from default system repositories. The verification runs as an auto-injected verify-installation phase that computes the intersection of artifact package names and test dependencies. Each artifact phase populates the shared verify phase with packages from its own providers. Tests can opt-out by setting 'auto_verify: false' on the artifact phase. Changes: - Move auto-verify logic into artifact plugin for better cohesion - Add _populate_verify_from_providers() to compute package intersections - Add _inject_artifact_verify_phase() to auto-inject verification phase - Add 'auto_verify' option to artifact schema (default: true) - Add schema support for package-to-repo mapping in verify-installation - Add integration tests for auto-verify and opt-out behavior - Add release notes documentation Fixes: #4726
Add automatic verification of packages installed from artifact repositories against test require/recommend and explicit prepare install phases. This ensures packages were installed from the expected artifact sources rather than from default system repositories. The verification runs as an auto-injected verify-installation phase that computes the intersection of artifact package names and test dependencies. Each artifact phase populates the shared verify phase with packages from its own providers. Tests can opt-out by setting 'auto_verify: false' on the artifact phase. Changes: - Move auto-verify logic into artifact plugin for better cohesion - Add _populate_verify_from_providers() to compute package intersections - Add _inject_artifact_verify_phase() to auto-inject verification phase - Add 'auto_verify' option to artifact schema (default: true) - Add schema support for package-to-repo mapping in verify-installation - Add integration tests for auto-verify and opt-out behavior - Add release notes documentation Fixes: #4726
3c77c8e to
801cd29
Compare
|
/packit retest-failed |
b5a717d to
4734a84
Compare
LecrisUT
left a comment
There was a problem hiding this comment.
LGTM, other than my unresolved comments
psss
left a comment
There was a problem hiding this comment.
One simplification suggestion for the test and failing repository-file scenario.
|
/packit retest-failed |
|
All the tests passed :) ^_^. Rebasing for the final merge |
Integrate artifact verification into the prepare artifact plugin. When verify=True (the default), packages installed from artifact repositories are automatically verified against test require/recommend and explicit prepare install phases. This ensures packages were installed from the expected artifact sources rather than from default system repositories. The verification runs as an auto-injected verify-installation phase that computes the intersection of artifact package names and test dependencies. Each artifact phase populates the shared verify phase with packages from its own providers. Tests can opt-out by setting 'verify: false' on the artifact phase. Key implementation details: - Auto-verify injection happens in PrepareArtifact.go() using the new step-add-phase-to-queue infrastructure (self.step.add_phase()) - Verify phase is dynamically added to the running queue - Multiple artifact phases with same where= group share one verify phase - Package-to-repo mapping includes handling for both download providers (koji.build, copr.build) and repository providers (repository-file, etc.) Changes: - Add 'verify' option to artifact schema (default: true) - Add PrepareArtifact._inject_verify_phase() method - Add schema support for package-to-repo mapping in verify-installation - Add integration tests for auto-verify behavior - Update existing verify-installation tests - Add release notes documentation
When the artifact plugin is present with verify=True (default), a verify-installation phase is automatically injected at order=79. It intersects require/recommend packages for the current guest with packages listed in artifacts.yaml, and verifies that the overlapping packages were installed from the tmt-artifact-shared repository.
Related to #4646