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

Add new command modulesync #444

Merged
merged 1 commit into from Dec 8, 2021

Conversation

j-mracek
Copy link
Member

@j-mracek j-mracek commented Oct 8, 2021

It will download module metadata from all enabled repositories,
module artifacts and profiles of matching modules. Then it creates
a repository.

Requires: rpm-software-management/dnf#1794
For RHEL8 it requires: rpm-software-management/libdnf#1381

@pep8speaks
Copy link

pep8speaks commented Nov 2, 2021

Hello @j-mracek! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:

There are currently no PEP 8 issues detected in this Pull Request. Cheers! 🍻

Comment last updated at 2021-12-08 13:45:36 UTC

@m-blaha
Copy link
Member

m-blaha commented Nov 9, 2021

I'm not sure how useful is tracking the tool development in separate commits. I think squashing all of them into one commit which introduces the new plugin is cleaner.
But feel free to ignore this rant, it isn't that important.

dnf-plugins-core.spec Show resolved Hide resolved

`modulesync` downloads packages from modules according to provided arguments and creates a repository with modular data
in working directory. Im modular environment it is recommend to use the command in combination with other dnf commands
which downloads RPM packages. See examples
Copy link
Member

Choose a reason for hiding this comment

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

I'm a bit confused here. Could you elaborate in more details the use case when user needs to download rpm packages separately (using dnf download or such) and then run modulesync to generate modular metadata? I thought that modulesync will download rpm packages from given modules.

Copy link
Member Author

Choose a reason for hiding this comment

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

In case that a package has modular label in rpm header it cannot be used in new repository without modular metadata. module sync will create a repository including modular metadata.

Copy link
Member

Choose a reason for hiding this comment

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

But modulesync also downloads the rpm package itself, doesn't it? What I do not understand is the need of dnf download before dnf modulesync. I really think this deserves more detailed documentation in the man pages.

Copy link
Member Author

Choose a reason for hiding this comment

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

Good point

@inknos inknos self-assigned this Nov 9, 2021
@j-mracek
Copy link
Member Author

I'm not sure how useful is tracking the tool development in separate commits. I think squashing all of them into one commit which introduces the new plugin is cleaner. But feel free to ignore this rant, it isn't that important.

I can do it.

@j-mracek j-mracek force-pushed the sync-tool branch 2 times, most recently from 865a7eb to 4523ed0 Compare November 11, 2021 14:53
doc/modulesync.rst Outdated Show resolved Hide resolved
doc/modulesync.rst Outdated Show resolved Hide resolved
doc/modulesync.rst Outdated Show resolved Hide resolved
@inknos
Copy link
Contributor

inknos commented Nov 16, 2021

Please, could you update the commit message with =changelog= and specify the msg, type and bug fileds?

Comment on lines 1 to 17
# Copyright (C) 2021 Red Hat, Inc.
#
# This copyrighted material is made available to anyone wishing to use,
# modify, copy, or redistribute it subject to the terms and conditions of
# the GNU General Public License v.2, or (at your option) any later version.
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY expressed or implied, including the implied warranties of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
# Public License for more details. You should have received a copy of the
# GNU General Public License along with this program; if not, write to the
# Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
# 02110-1301, USA. Any Red Hat trademarks that are incorporated in the
# source code or documentation are not subject to the GNU General Public
# License and may only be used or replicated with the express permission of
# Red Hat, Inc.
#

Copy link
Member

Choose a reason for hiding this comment

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

Copyright here is not correctly formated - resulting in inclusion of copyright into the man page itself. Correct format of the comment in rst file is:

..
  Copyright (C) 2021  Red Hat, Inc.

  This copyrighted...

-----------

`modulesync` downloads packages from modules according to provided arguments and creates a repository with modular data
in working directory. Im environment with modules it is recommend to use the command for redistribution of packages,
Copy link
Member

Choose a reason for hiding this comment

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

typo: In environment


`modulesync` downloads packages from modules according to provided arguments and creates a repository with modular data
in working directory. Im environment with modules it is recommend to use the command for redistribution of packages,
because DNF prevents from getting modular packages without modular metadata on the system (Fail-safe mechanism).
Copy link
Member

Choose a reason for hiding this comment

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

because DNF does not allow installation of modular packages without modular metadata...?
I'm not sure what getting word here is supposed to mean.

Comment on lines 76 to 78
``dnf download nodejs``
``dnf modulesync``
Copy link
Member

@m-blaha m-blaha Dec 8, 2021

Choose a reason for hiding this comment

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

Multiline examples are incorrectly formatted. In the man page they are rendered as one line e.g.:

       dnf download nodejs dnf modulesync
          The first download command ...

``dnf --destdir=/tmp/my-temp modulesync nodejs:14/minimal --resolve``
Download package required for installation of `minimal` profile from module `nodejs` and stream `14` into directory
`/tmp/my-temp` and all required dependencies. Then it will create a repository in `/tmp/my-temp` directory with
packages previously downloaded packages and modular metadata from all available repositories.
Copy link
Member

Choose a reason for hiding this comment

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

duplicated packages word

``dnf modulesync --destdir=/tmp/my-temp``
The first `dnf module install` command downloads package from required for installation of `minimal` profile from module
`nodejs` and stream `14` into directory `/tmp/my-temp`. The second command `dnf modulesync` will create
a repository in `/tmp/my-temp` directory with packages previously downloaded packages and modular metadata from all
Copy link
Member

Choose a reason for hiding this comment

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

Again duplicated packages word.

Copy link
Member

@m-blaha m-blaha left a comment

Choose a reason for hiding this comment

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

I found some remaining issues with man pages / documentation. Also the modulesync should be included in index.rst file.

@j-mracek j-mracek force-pushed the sync-tool branch 2 times, most recently from af84b0d to faab2fe Compare December 8, 2021 12:57

return result_query

def _get_providers_of_requires(self, to_test, done=None, req_dict={}):
Copy link
Member

Choose a reason for hiding this comment

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

using mutable default parameter values (here req_dict={}) is strongly discouraged and has significant side effects (see https://florimond.dev/en/posts/2018/08/python-mutable-defaults-are-the-source-of-all-evil/). Unless you have a reason, please use req_dict=None.

Copy link
Member Author

Choose a reason for hiding this comment

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

Good point.

Copy link
Member Author

Choose a reason for hiding this comment

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

Fixed

It will download module metadata from all enabled repositories,
module artifacts and profiles of matching modules. Then it creates
a repository.

= changelog =
msg:           Add a new subpackage with modulesync command. The command
downloads packages from modules and/or creates a repository with modular
data.
type:          enhancement
resolves:      https://bugzilla.redhat.com/show_bug.cgi?id=1868047
@m-blaha m-blaha merged commit 4c31b66 into rpm-software-management:master Dec 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants