-
Notifications
You must be signed in to change notification settings - Fork 163
Fix unsupported source version crash #1443
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Fix unsupported source version crash #1443
Conversation
Thank you for contributing to the Leapp project!Please note that every PR needs to comply with the leapp-repository contribution and development guidelines and must pass all tests in order to be mergeable.
Packit will automatically schedule regression tests for this PR's build and latest upstream leapp build.
Note that first time contributors cannot run tests automatically - they need to be started by a reviewer. It is possible to schedule specific on-demand tests as well. Currently 2 test sets are supported,
See other labels for particular jobs defined in the 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. |
40427ce to
0925960
Compare
|
Rebased after the mass change in upstream. |
9dfee8f to
d634f5a
Compare
|
Based on discussion with the team, we decided to not include the improvement at this time. I dropped the improvement commit and defined the original fallback mechanism for the Alma linux upgrade paths as well. This makes sure the error won't be hit for any distribution and the unsupported source version will result into an inhibitor informing the user about unsupported upgrade path. |
This patch fixes a crash when executing upgrade on a system with version that is not defined in the supported upgrade path map and when the fallback mechanism for this particular case fails as well. The upgrade process is now terminated with an error instead of a trace back. Jira: RHEL-120252
d634f5a to
e640511
Compare
|
Rebased. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested, works as expected, when the fallback paths are not defined for almalinux, the upgrade raises the error. When they are, the upgrade is inhibited due to unsupported version.
However please edit the commit message to include that almalinux paths have changed. The other suggestions are just nitpicks.
I can approve then, but probably not merge as we want to prioritize #1438 and merging this would create conflicts.
| details['detail'] = 'This is due to an unsupported system distribution.' | ||
| elif source_version not in raw_upgrade_paths: | ||
| details['detail'] = 'This is due to an unsupported source version of the system.' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not really a problem, but we usually call it details.
| details['detail'] = 'This is due to an unsupported system distribution.' | |
| elif source_version not in raw_upgrade_paths: | |
| details['detail'] = 'This is due to an unsupported source version of the system.' | |
| details['details'] = 'This is due to an unsupported system distribution.' | |
| elif source_version not in raw_upgrade_paths: | |
| details['details'] = 'This is due to an unsupported source version of the system.' |
This PR contains the solution to the root cause of the problem from ticket RHEL-120252 in the first commit. The second commit proposes an improvement to the fallback mechanism described below. Lets decide if this improvement should be included or not. If it is not included, the upgrade paths map should be updated for the Alma Linux with the original fallback definitions same as for RHEL.
I've tried to run preupgrade with the following changes on Alma Linux 9.6 and RHEL 9.6.
Commit#1: fix unsupported source version crash
This patch fixes a crash when executing upgrade on a system with version
that is not defined in the supported upgrade paths map and when the
fallback mechanism for this particular case fails as well. The upgrade
process is now terminated with an error instead of a trace back.
Commit#2: improve fallback mechanism for source version matching
When searching in the upgrade paths map by the system version, we had
implemented a fallback that allowed the upgrade process to find a target
version even if the minor version of the system did not match exactly
with the ones defined in the map.
The fallback mechanism was implemented using additional definitions in
the map which did not have a minor version explicitly defined and thus
would be only used as a fallback when the system version did not match
any minor version.
This patch changes this fallback mechanism to instead search in the map
by the latest minor version of the system's major version. The
additional records are removed from the map as well.
Jira: RHEL-120252