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

Parse and import both rpm and deb packages metadata #9101

Open
wants to merge 40 commits into
base: master
Choose a base branch
from

Conversation

waterflow80
Copy link
Collaborator

@waterflow80 waterflow80 commented Jul 25, 2024

What does this PR change?

Parse both rpm and deb packages/repositories' metadata files and import the data to the database.

GUI diff

No difference.

  • DONE

Documentation

  • No documentation needed: only internal and user invisible changes

  • DONE

Test coverage

  • No tests: still in progress

  • DONE

Links

Issue(s): #
Port(s): # add downstream PR(s), if any

  • DONE

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!

@waterflow80 waterflow80 force-pushed the parse-and-import-debian-packages-md branch 3 times, most recently from 9cf2fd5 to d12d51a Compare August 2, 2024 01:44
@waterflow80 waterflow80 changed the title Parse and import debian packages metadata Parse and import both rpm and deb packages metadata Aug 2, 2024
@waterflow80 waterflow80 force-pushed the parse-and-import-debian-packages-md branch from 4e0c10e to 9740fbe Compare August 2, 2024 16:09
Copy link
Contributor

github-actions bot commented Aug 2, 2024

👋 Hello! Thanks for contributing to our project.
Acceptance tests will take some time (aprox. 1h), please be patient ☕
You can see the progress at the end of this page and at https://github.com/uyuni-project/uyuni/pull/9101/checks
Once tests finish, if they fail, you can check 👀 the cucumber report. See the link at the output of the action.
You can also check the artifacts section, which contains the logs at https://github.com/uyuni-project/uyuni/pull/9101/checks.

If you are unsure the failing tests are related to your code, you can check the "reference jobs". These are jobs that run on a scheduled time with code from master. If they fail for the same reason as your build, it means the tests or the infrastructure are broken. If they do not fail, but yours do, it means it is related to your code.

Reference tests:

KNOWN ISSUES

Sometimes the build can fail when pulling new jar files from download.opensuse.org . This is a known limitation. Given this happens rarely, when it does, all you need to do is rerun the test. Sorry for the inconvenience.

For more tips on troubleshooting, see the troubleshooting guide.

Happy hacking!
⚠️ You should not merge if acceptance tests fail to pass. ⚠️

waterflow80 and others added 26 commits October 24, 2024 13:57
Parsed the debian's Translation file that contains the full
description of packages, grouped by description-md5, and
cache the parsed descriptions in a cache directory.
Using both packages_parser and translation_parser, return the
full packages' metadata, pacakge by package, using lazing
parsing

Also set the debian repository's information in a DebRepo
class
Given the channel label, fetch important repository's
information form the database, and store it in a temporary
object RepoDTO
Added the necessary command line arguments.

Identify the target repositories, prepare the datastructures,
and execute the lazy synchronization of repositories/packages.
Added a new dependency python-gnupg used to verify repo
signature.
Ignored two linting complains about rasing exceptions floowing the
approach in the old reposync.

We can enhance the code instead of doing this though.
This commit completes almost all the logic and use cases
of the new lazy reposync.

**Note** that this commit will be restructured and possibly
divided into smaller and more convenient commits.
This commit is for review purposes.
Seemingly this error happened because we reached the maximum number
of unclosed db connections. And thought that this might be due to
the fact that the close() method in the Database class was not
implemented, and the rhnSQL.closeDB() was not closing any connection.

However, we're still hesitating about whether this is the root cause
of the problem, because the old(current) reposync is was using it
without any error.
This is the latest and almost the final version of the
lzreposync service. (gpg sig check not complete)

It contains pretty much all the necessary tests,
including the ones for updates/patches import.

Some of the remaining 'todos' are either for code
enhancements or some unclear concepts that
will be discussed with the team.

Of course, this commit will be split into smaller
ones later after rebase.
- Removed some todos.
- Changed some sql queries with equivalent ones using
JOIN...ON.
- Some other minor cleanup
Optimized some code by changing classes and methods
in some logics with free functions.

Consolidated the debian repo parsing.
Completed the gpg signature check for rpm repositories,
mainly for the repomd.xml file.

This is done by downloading the signature file from the
remote rpm repo, and executing 'gpg verify' to verify the
repomd.xml file against its signature using the already
added gpg keys on the filesystem.

So, if you haven't already added the required gpg keyring
on your system, you'll not be able to verify the repo.

You should ideally run this version directly on the uyuni-
server, because the gpg keyring will probably be present
there.
makedirs() in uyuni.common.fileutils now accepts relative paths that
consist of only a directory name or paths with trailing slashes.
Completed the gpg signature check for debian repositories.

If you haven't already added the required gpg keyring
on your system, you'll not be able to verify the repo,
and you'll normally get a GeneralRepoException.

You should ideally run this version directly on the uyuni-
server, because the gpg keyring will probably be present
there.
@waterflow80 waterflow80 force-pushed the parse-and-import-debian-packages-md branch from a7270cd to c5bd19f Compare October 24, 2024 14:26
Mocked the SPACEWALK_GPG_HOMEDIR value to `~/.gnupg/`, which is the
default directory for gpg, in order to execute the gpg tests outside
the uyuni-server
@waterflow80 waterflow80 force-pushed the parse-and-import-debian-packages-md branch from c5bd19f to 574e43e Compare October 24, 2024 14:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment