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

Fix importing module metadata from REMI's repositories #9003

Merged
merged 1 commit into from
Jul 22, 2024

Conversation

cbbayburt
Copy link
Contributor

Some packages in REMI's 3rd party repositories include a '~' character as part of the version string. This patch fixes the module import during repo-sync to recognize this character.

Documentation

  • No documentation needed: Bugfix

Test coverage

  • Unit tests were added

Links

Fixes #8972

Changelogs

Make sure the changelogs entries you are adding are compliant with https://github.com/uyuni-project/uyuni/wiki/Contributing#changelogs and https://github.com/uyuni-project/uyuni/wiki/Contributing#uyuni-projectuyuni-repository

If you don't need a changelog check, please mark this checkbox:

  • No changelog needed

If you uncheck the checkbox after the PR is created, you will need to re-run changelog_test (see below)

Re-run a test

If you need to re-run a test, please mark the related checkbox, it will be unchecked automatically once it has re-run:

  • Re-run test "changelog_test"
  • Re-run test "backend_unittests_pgsql"
  • Re-run test "java_pgsql_tests"
  • Re-run test "schema_migration_test_pgsql"
  • Re-run test "susemanager_unittests"
  • Re-run test "javascript_lint"
  • Re-run test "spacecmd_unittests"

Before you merge

Check How to branch and merge properly!

@cbbayburt cbbayburt requested a review from a team as a code owner July 3, 2024 14:39
@cbbayburt cbbayburt requested review from ycedres and removed request for a team July 3, 2024 14:39
@cbbayburt cbbayburt added the merge-candidate Meaning it needs to be considered for merging when the master branch is frozen label Jul 3, 2024
@@ -286,7 +286,7 @@ def _parse_rpm_name(nevra):
pattern = re.compile(
r"(?P<name>[a-zA-Z0-9._+-]+)-"
r"(?P<epoch>\d+:)?"
r"(?P<version>[a-zA-Z0-9._-]+)-"
r"(?P<version>[a-zA-Z0-9._-~]+)-"
Copy link
Member

Choose a reason for hiding this comment

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

Is a hyphen/dash inside the version string valid? openSUSE's packaging documentation says it's not available, does that differ in the RH world?

RPM uses the dash to separate the package name, the package version and the distro-level re-issue ("release") counter. (rpm -qa for example emits coreutils-9.0-1.x86_64.) The dash itself is unavailable for use within the version or release substring, as are a few other characters like the asterisk. [...]

https://en.opensuse.org/openSUSE:Package_versioning_guidelines#Unusual_characters

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The real problem is that there's no actual standard between distros and like also mentioned there in the document, some distros are pretty liberal with this.

For "hyphens in version" case, Ubuntu/Debian is the offender. Here are some examples:

ipxe-qemu-256k-compat-efi-roms-1.0.0+git-20150424.a25a16d-0ubuntu4.all-deb.deb
ipxe-1.0.0+git-20190109.133f4c4-0ubuntu3.all-deb.deb
ipxe-qemu-1.0.0+git-20190109.133f4c4-0ubuntu3.all-deb.deb
grub-ipxe-1.0.0+git-20190109.133f4c4-0ubuntu3.all-deb.deb
lib32gcc1-10-20200411-0ubuntu1.amd64-deb.deb
libx32gcc1-10-20200411-0ubuntu1.amd64-deb.deb

I should probably add some more test cases reflecting this.

Copy link
Member

Choose a reason for hiding this comment

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

Is appstreams.py also used by Debian repos? I thought this was RPM-only.

Package version schemas definitely differ between packaging formats and we can't have one way to handle all of them. The same applies to version comparisons, where has their own rules.

Copy link
Contributor

Choose a reason for hiding this comment

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

libsolv has some version comparison algorithms from which maybe some reasonable expectations for a version string can be extracted:

https://github.com/openSUSE/libsolv/blob/master/src/evr.c

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I can have a look at it if it covers all the necessary formats. But in any case, further changes are not in scope for this fix and I don't want to risk any regressions without testing extensively. So I'm just going to merge this one as is.

@admd admd merged commit 5f401db into uyuni-project:master Jul 22, 2024
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merge-candidate Meaning it needs to be considered for merging when the master branch is frozen
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Problem importing modular packages from https://rpms.remirepo.net/
5 participants