From d9af1f2a19ec3352a4eff596bcb13e7ad073d763 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrea=20Waltlov=C3=A1?= Date: Sun, 26 Nov 2023 19:31:44 +0100 Subject: [PATCH 45/60] Utilize get_target_major_version in no enabled target repositories report (#1151) * Utilize get_target_major_version in no enabled target repositories report so the shortened URL in the report points to the right documentation based based on the target OS major version. * Add expected docs URLs to comments for easier grep Signed-off-by: Andrea Waltlova --- .../libraries/userspacegen.py | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/repos/system_upgrade/common/actors/targetuserspacecreator/libraries/userspacegen.py b/repos/system_upgrade/common/actors/targetuserspacecreator/libraries/userspacegen.py index d605ba0e..c1d34f18 100644 --- a/repos/system_upgrade/common/actors/targetuserspacecreator/libraries/userspacegen.py +++ b/repos/system_upgrade/common/actors/targetuserspacecreator/libraries/userspacegen.py @@ -678,8 +678,10 @@ def _get_rhsm_available_repoids(context): ).format(target_major_version)), reporting.ExternalLink( - # TODO: How to handle different documentation links for each version? - url='https://red.ht/preparing-for-upgrade-to-rhel8', + # https://red.ht/preparing-for-upgrade-to-rhel8 + # https://red.ht/preparing-for-upgrade-to-rhel9 + # https://red.ht/preparing-for-upgrade-to-rhel10 + url='https://red.ht/preparing-for-upgrade-to-rhel{}'.format(target_major_version), title='Preparing for the upgrade') ]) raise StopActorExecution() @@ -812,6 +814,7 @@ def gather_target_repositories(context, indata): missing_custom_repoids.append(custom_repo.repoid) api.current_logger().debug("Gathered target repositories: {}".format(', '.join(target_repoids))) if not target_repoids: + target_major_version = get_target_major_version() reporting.create_report([ reporting.Title('There are no enabled target repositories'), reporting.Summary( @@ -833,8 +836,10 @@ def gather_target_repositories(context, indata): ' Finally, verify that the "/etc/leapp/files/repomap.json" file is up-to-date.' ).format(version=api.current_actor().configuration.version.target)), reporting.ExternalLink( - # TODO: How to handle different documentation links for each version? - url='https://red.ht/preparing-for-upgrade-to-rhel8', + # https://red.ht/preparing-for-upgrade-to-rhel8 + # https://red.ht/preparing-for-upgrade-to-rhel9 + # https://red.ht/preparing-for-upgrade-to-rhel10 + url='https://red.ht/preparing-for-upgrade-to-rhel{}'.format(target_major_version), title='Preparing for the upgrade'), reporting.RelatedResource("file", "/etc/leapp/files/repomap.json"), reporting.RelatedResource("file", "/etc/yum.repos.d/") @@ -854,7 +859,7 @@ def gather_target_repositories(context, indata): reporting.Groups([reporting.Groups.INHIBITOR]), reporting.Severity(reporting.Severity.HIGH), reporting.ExternalLink( - # TODO: How to handle different documentation links for each version? + # NOTE: Article covers both RHEL 7 to RHEL 8 and RHEL 8 to RHEL 9 url='https://access.redhat.com/articles/4977891', title='Customizing your Red Hat Enterprise Linux in-place upgrade'), reporting.Remediation(hint=( -- 2.43.0