oamg / leapp-repository

Leapp repositories containing actors for the Leapp framework (https://github.com/oamg/leapp). Currently provides leapp repositories for in-place upgrades of RHEL systems.
Apache License 2.0
48 stars 144 forks source link

Default channel to GA if not specified otherwise #1205

Closed matejmatuska closed 4 months ago

matejmatuska commented 4 months ago

Originally we tried to map by default repositories from particular channels on the source system to their equivalents on the target system. IOW:

However, it has been revealed this logic should not apply on minor releases for which these non-ga (premium) repositories do not exist. So doing upgrade e.g. to 8.9, 8.10 , 9.3 for which specific eus, etc.. repositories are not defined lead to 404 error.

Discussing this deeply between stakeholders, it has been decided to drop this logic and target always to "ga" repositories unless the leapp is executed with instructions to choose a different channel (using envars, --channel .. option). To prevent this issue.

It's still possible to require mistakenly e.g. "eus" channel for the target release for which the related repositories are not defined. e.g.:

# leapp upgrade --channel eus --target 8.10

In such a case, the previous errors (404 Not found) can be hit again. But it will not happen by default. In this case, we expect and request people to understand what they want.

(@pirat89: updated description)

jira: RHEL-24720

github-actions[bot] commented 4 months ago

Thank you for contributing to the Leapp project!

Please note that every PR needs to comply with the Leapp Guidelines and must pass all tests in order to be mergeable. If you want to request a review or rebuild a package in copr, you can use following commands as a comment:

Packit will automatically schedule regression tests for this PR's build and latest upstream leapp build. If you need a different version of leapp, e.g. from PR#42, use /packit test oamg/leapp#42 Note that first time contributors cannot run tests automatically - they will be started by a reviewer.

It is possible to schedule specific on-demand tests as well. Currently 2 test sets are supported, beaker-minimal and kernel-rt, both can be used to be run on all upgrade paths or just a couple of specific ones. To launch on-demand tests with packit:

See other labels for particular jobs defined in the .packit.yaml file.

Please open ticket in case you experience technical problem with the CI. (RH internal only)

Note: In case there are problems with tests not being triggered automatically on new PR/commit or pending for a long time, please contact leapp-infra.

pirat89 commented 4 months ago

@alexxa ping it's here :)

matejmatuska commented 4 months ago

Tested on a RHEL7.9 system with following repos enabled:

[root@kvm-01-guest05 ~]# yum repolist
---8<----
copr:copr.fedorainfracloud.org:group_oamg:leapp/x86_64        Copr repo for leapp owned by @oamg                                           183
rhel-7-server-eus-rpms/7.7/x86_64                             Red Hat Enterprise Linux 7 Server - Extended Update Support (RPMs)        28,120
rhel-7-server-extras-rpms/x86_64                              Red Hat Enterprise Linux 7 Server - Extras (RPMs)                          1,476

Without this patch:

[root@kvm-01-guest05 ~]# leapp preupgrade --debug --target 8.8
[root@kvm-01-guest05 ~]# ./leapp-inspector messages --recursive-expand --type TargetRepositories
######################################################################
                          PRODUCED MESSAGES
######################################################################
Stamp: 2024-04-23T11:21:51.120382Z
Actor: setuptargetrepos
Phase: FactsCollection
Type: TargetRepositories
Message_data:
{
    "custom_repos": [],
    "rhel_repos": [
        {
            "repoid": "rhel-8-for-x86_64-appstream-eus-rpms"
        },
        {
            "repoid": "rhel-8-for-x86_64-baseos-eus-rpms"
        }
    ]
}
######################################################################

With this patch:

[root@kvm-01-guest05 ~]# leapp preupgrade --debug --target 8.8
[root@kvm-01-guest05 ~]# ./leapp-inspector messages --recursive-expand --type TargetRepositories
######################################################################
                          PRODUCED MESSAGES
######################################################################
Stamp: 2024-04-23T12:48:20.387474Z
Actor: setuptargetrepos
Phase: FactsCollection
Type: TargetRepositories
Message_data:
{
    "custom_repos": [],
    "rhel_repos": [
        {
            "repoid": "rhel-8-for-x86_64-appstream-rpms"
        },
        {
            "repoid": "rhel-8-for-x86_64-baseos-rpms"
        }
    ]
}
######################################################################
[root@kvm-01-guest05 ~]# leapp preupgrade --debug --target 8.8 --channel eus
[root@kvm-01-guest05 ~]# ./leapp-inspector messages --recursive-expand --type TargetRepositories
######################################################################
                          PRODUCED MESSAGES
######################################################################
Stamp: 2024-04-23T12:55:32.659926Z
Actor: setuptargetrepos
Phase: FactsCollection
Type: TargetRepositories
Message_data:
{
    "custom_repos": [],
    "rhel_repos": [
        {
            "repoid": "rhel-8-for-x86_64-appstream-eus-rpms"
        },
        {
            "repoid": "rhel-8-for-x86_64-baseos-eus-rpms"
        }
    ]
}
######################################################################
[root@kvm-01-guest05 ~]# LEAPP_TARGET_PRODUCT_CHANNEL=eus leapp preupgrade --debug --target 8.8
[root@kvm-01-guest05 ~]# ./leapp-inspector messages --recursive-expand --type TargetRepositories
######################################################################
                          PRODUCED MESSAGES
######################################################################
Stamp: 2024-04-23T12:41:42.707573Z
Actor: setuptargetrepos
Phase: FactsCollection
Type: TargetRepositories
Message_data:
{
    "custom_repos": [],
    "rhel_repos": [
        {
            "repoid": "rhel-8-for-x86_64-appstream-eus-rpms"
        },
        {
            "repoid": "rhel-8-for-x86_64-baseos-eus-rpms"
        }
    ]
}
######################################################################
[root@kvm-01-guest05 ~]# LEAPP_TARGET_PRODUCT_CHANNEL=eus leapp preupgrade --debug --target 8.8 --channel ga
[root@kvm-01-guest05 ~]# ./leapp-inspector messages --recursive-expand --type TargetRepositories
######################################################################
                          PRODUCED MESSAGES
######################################################################
Stamp: 2024-04-23T13:16:12.297526Z
Actor: setuptargetrepos
Phase: FactsCollection
Type: TargetRepositories
Message_data:
{
    "custom_repos": [],
    "rhel_repos": [
        {
            "repoid": "rhel-8-for-x86_64-appstream-rpms"
        },
        {
            "repoid": "rhel-8-for-x86_64-baseos-rpms"
        }
    ]
}
######################################################################

The devel variable has precedence over both non-devel variable and CLI arg, as expected and also as documented in upstream docs.

[root@kvm-01-guest05 ~]# LEAPP_UNSUPPORTED=1 LEAPP_DEVEL_TARGET_PRODUCT_TYPE=ga LEAPP_TARGET_PRODUCT_CHANNEL=eus leapp preupgrade --debug --target 8.8 --channel eus
[root@kvm-01-guest05 ~]# ./leapp-inspector messages --recursive-expand --type TargetRepositories
######################################################################
                          PRODUCED MESSAGES
######################################################################
Stamp: 2024-04-23T13:08:23.098105Z
Actor: setuptargetrepos
Phase: FactsCollection
Type: TargetRepositories
Message_data:
{
    "custom_repos": [],
    "rhel_repos": [
        {
            "repoid": "rhel-8-for-x86_64-appstream-rpms"
        },
        {
            "repoid": "rhel-8-for-x86_64-baseos-rpms"
        }
    ]
}
######################################################################
matejmatuska commented 4 months ago

Only squashed fixup commit, no need to re-test.