Skip to content

prepare/artifact: extend verify to user-defined prepare/install phases ordered before the verify phase #4781

@vaibhavdaren

Description

@vaibhavdaren

Background

The prepare/artifact plugin supports a verify: true option that injects a verification phase (PrepareVerifyInstallation) to check that packages required by tests were actually installed from the configured artifact providers.

Currently, verification only covers the install phases injected by tmt itself (essential-requires, requires, recommends). User-defined prepare/install phases are excluded. This was a deliberate conservative choice to avoid imposing unexpected behavior on users who didn't ask for it.

The gap

A user can specify test dependencies either via require:/recommend: keys or via an explicit prepare/install phase — both achieve the same result. With the current implementation, the two approaches have diverging verification behavior: tmt-injected phases are verified, user-defined ones are not. This is a silent difference that may confuse users who expect consistent behavior.

Proposed approach

Extend verification to user-defined prepare/install phases, but gated on phase ordering: only include a phase if its order is less than the verify phase's order (PHASE_ORDER_PREPARE_VERIFY_INSTALLATION = 79).

This gives users a natural opt-out: set order: 80 (or higher) on a prepare/install phase to have it run after verification and be excluded from it. It also matches the general tmt convention that phase ordering controls execution semantics.

Phase order reference

Phase Order
essential-requires (tmt-injected) 30
prepare/install default 50
requires (tmt-injected) 70
recommends (tmt-injected) 75
verify-installation 79

With this change, a user-defined prepare/install at the default order of 50 would be included in verification automatically. To opt out, the user sets order: 80+.

Open question

Is the opt-out mechanism (order: 80+) discoverable enough, or do we need an explicit verify: false flag on prepare/install to let users opt out without changing ordering semantics?

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    plugin | artifactRelated to the `prepare/artifact` plugin.plugin | installThe prepare plugin for installing packagesstatus | blockedThe merging of PR is blocked on some other issuestep | prepareStuff related to the prepare step

    Type

    No type

    Projects

    Status

    backlog

    Status

    triaged

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions