-
Notifications
You must be signed in to change notification settings - Fork 148
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
targetuserspacecreator: Refactor gathering of repositories #973
base: main
Are you sure you want to change the base?
Conversation
Your git-forge project |
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.
To launch regression testing public members of oamg organization can leave the following comment:
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 consider rerunning the CI by commenting leapp-ci build (might require several comments). If the problem persists, contact leapp-infra. |
8f27e71
to
6e293b3
Compare
/rerun |
Copr build succeeded: https://copr.fedorainfracloud.org/coprs/build/4998669 |
Testing Farm request for RHEL-8.6-rhui/4998669 regression testing has been created. |
Testing Farm request for RHEL-8.7.0-Nightly/4998669 regression testing has been created. |
Testing Farm request for RHEL-8.6.0-Nightly/4998669 regression testing has been created. |
Testing Farm request for RHEL-7.9-ZStream/4998669 regression testing has been created. |
Testing Farm request for RHEL-7.9-rhui/4998669 regression testing has been created. |
Testing Farm request for RHEL-7.9-ZStream/4998669 regression testing has been created. |
6e293b3
to
aeeed23
Compare
96b2ac7
to
f904598
Compare
f904598
to
bf6e1ab
Compare
fd79fd1
to
c1ae302
Compare
c1ae302
to
4958ac3
Compare
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.
I've given the patch a first pass, and one more pass will likely follow. Separating the manipulation of repositories into a compact class allowing to query the needed information is a very elegant concept. As the introduced class is likely to stick, I would argue to change the names of its fields to be more descriptive. For example, the _RequestedRepoids.mapped
field has a name suggesting almost nothing about its semantics.
repos/system_upgrade/common/actors/targetuserspacecreator/libraries/repoinfo.py
Outdated
Show resolved
Hide resolved
def duplicated_repoids(self): | ||
return {k: v for k, v in self.mapped.items() if len(v) > 1} |
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.
The property name suggests that it contains a collection of repoids that are duplicated, whereas a dictionary is returned. Every use of this property access to the values of the property requests only its keys().
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.
Well it is right now, the point is that you can now report which repo files do contain the duplications. But this would be a follow up improvement. And it is a collection, key = repoid, value = list of repos with the same repo id)
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.
list of repos here means the list of repository files
repos/system_upgrade/common/actors/targetuserspacecreator/libraries/repoinfo.py
Outdated
Show resolved
Hide resolved
repos/system_upgrade/common/actors/targetuserspacecreator/libraries/repoinfo.py
Outdated
Show resolved
Hide resolved
repos/system_upgrade/common/actors/targetuserspacecreator/libraries/userspacegen.py
Outdated
Show resolved
Hide resolved
This patch unifies the collection of repositories. Signed-off-by: Vinzenz Feenstra <[email protected]>
4958ac3
to
c18e9c6
Compare
@@ -26,7 +26,7 @@ def asbool(x): | |||
return RepositoryData(**prepared) | |||
|
|||
|
|||
def parse_repofile(repofile): | |||
def parse_repofile(repofile, rfile=None, kind='custom'): |
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.
extend the docstring to cover new params
/packit build |
@vinzenz do you think you could finish this one during this week or want a help? :) |
@@ -169,13 +168,6 @@ def get_available_repo_ids(context): | |||
) | |||
|
|||
repofiles = repofileutils.get_parsed_repofiles(context) |
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.
this call leads to the situation when all discovered repositories have the custom
kind set, so repositories inside RHSMInfo
msg are marked as custom
. Discussed with @vinzenz , he will check whether the logic of selecting (custom, rhsm, rhui) kind could be moved into the library instead of having it in the private library of the actor.
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.
see the comments above. also unit-tests needs to be fixed.
This patch unifies the collection of repositories.
Signed-off-by: Vinzenz Feenstra [email protected]