Skip to content
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

convert dot-less CentOS versions to X.999 #1139

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

evgeni
Copy link
Member

@evgeni evgeni commented Nov 4, 2023

CentOS Stream doesn't do dot releases, so it always has the major version in the version_id field of os-release.
Our code, in multiple places, expects versions in the form X.Y and doesn't cope well when given only X.
The value "999" is taken arbitrarily, with the sole assumption that it will be always higher than any RHEL release, as CentOS Stream is ahead of RHEL.

See https://issues.redhat.com/browse/CS-1757 for further discussion and alternative numbering options.

Copy link

github-actions bot commented Nov 4, 2023

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:

  • review please @oamg/developers to notify leapp developers of the review request
  • /packit copr-build to submit a public copr build using packit

Packit will automatically schedule regression tests for this PR's build and latest upstream leapp build. If you need a different version of leapp from PR#42, use /packit test oamg/leapp#42

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:

  • /packit test --labels kernel-rt to schedule kernel-rt tests set for all upgrade paths
  • /packit test --labels beaker-minimal-8.9to9.3,kernel-rt-8.9to9.3 to schedule kernel-rt and beaker-minimal test sets for 8.9->9.3 upgrade path

[Deprecated] To launch on-demand regression testing public members of oamg organization can leave the following comment:

  • /rerun to schedule basic regression tests using this pr build and latest upstream leapp build as artifacts
  • /rerun 42 to schedule basic regression tests using this pr build and leapp*PR42* as artifacts
  • /rerun-sst to schedule sst tests using this pr build and latest upstream leapp build as artifacts
  • /rerun-sst 42 to schedule sst tests using this pr build and leapp*PR42* as artifacts

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.

@evgeni evgeni requested a review from a team November 4, 2023 15:16
release_id = data.get('ID', '').strip('"')
version_id = data.get('VERSION_ID', '').strip('"')
if release_id == 'centos' and '.' not in version_id:
version_id = "{}.999".format(version_id)
Copy link
Member

@fernflower fernflower Nov 6, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not too happy about 999 magic constant tbh :(
Is there a universe where version_id doesn't have 999 and leapp is still happy?

Copy link
Member

@pirat89 pirat89 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Honestly, I do not think this is the right solution for this. This should not be resolved by magical/crafted values that have nothing to do with the real system. This particular problem will need to be refink, together with the target os version - where this magic even cannot be used as it has effect on baseurls of target repositories if $releasever is present.

Please note that we do not have a capacity right now to think about the right solution, so it's possible we will need to postpone this for a time. But when we have a time, we could invite you to our team tech. mtg to discuss the solution if you are interested. Once we have an agreement how the solution should look like, we can specify in github issues to set properly the expectation about the solution.

@pirat89 pirat89 added the invalid This doesn't seem right label Nov 7, 2023
@evgeni
Copy link
Member Author

evgeni commented Nov 7, 2023

Yeah, I agree, this is not a nice solution (but it works 🙃)
When I tried making it "the other way" (= making the code accept a major-only version) I ended up with the fact that (8,) is sorted lower than (8,0) (or any other (8, X) and that confused other parts of the code that pick which packages are to be replaced etc.

I'll happily join the mtg to discuss this!

@andrewlukoshko
Copy link

Just in case here are the commits we made in ELevate project to fix this CentOS version issue:
AlmaLinux@f95a819
AlmaLinux@8ea0f2b
AlmaLinux@96dbd35

But this PR looks cleaner.

CentOS Stream doesn't do dot releases, so it always has the major
version in the version_id field of os-release.
Our code, in multiple places, expects versions in the form X.Y and
doesn't cope well when given only X.
The value "999" is taken arbitrarily, with the sole assumption that it
will be always higher than any RHEL release, as CentOS Stream is ahead
of RHEL.

See https://issues.redhat.com/browse/CS-1757 for further discussion and
alternative numbering options.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
invalid This doesn't seem right
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants