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

setuptargetrepos actor code cleanup #301

Merged
merged 1 commit into from
Sep 23, 2019

Conversation

bocekm
Copy link
Member

@bocekm bocekm commented Aug 9, 2019

To changelog:
Remove RepositoriesSetupTasks which was kinda duplicate to the CustomTargetRepository.

Resolves #233.

@bocekm bocekm added the enhancement New feature or request label Aug 9, 2019
@bocekm bocekm requested a review from pirat89 August 9, 2019 20:47
@bocekm bocekm force-pushed the target_repos_actor_cleanup branch 3 times, most recently from 67e19f2 to 0e3c4c6 Compare August 12, 2019 19:44
@bocekm bocekm changed the title WIP: setuptargetrepos actor code cleanup setuptargetrepos actor code cleanup Aug 12, 2019
@bocekm bocekm requested a review from fernflower August 12, 2019 19:44
@bocekm bocekm requested a review from Rezney September 13, 2019 12:33
@bocekm bocekm force-pushed the target_repos_actor_cleanup branch 2 times, most recently from 3e6f9f7 to 3b0f280 Compare September 13, 2019 12:41
@bocekm
Copy link
Member Author

bocekm commented Sep 16, 2019

@asilveir, ready for re-review.

@bocekm
Copy link
Member Author

bocekm commented Sep 16, 2019

leapp-ci build

@bocekm
Copy link
Member Author

bocekm commented Sep 18, 2019

Rebased and conflicts resolved.

@alexandrepossebom
Copy link
Contributor

Tested and working.

@alexandrepossebom alexandrepossebom merged commit 47188e3 into oamg:master Sep 23, 2019
@@ -6,6 +6,7 @@ class RepositoriesSetupTasks(Model):
"""
Information about repositories that must be managed in order to complete upgrade process.

!!! THIS MODEL IS OBSOLETE. Use for example CustomTargetRepositories instead. !!!
Copy link
Member

@pirat89 pirat89 Sep 25, 2019

Choose a reason for hiding this comment

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

I do not like to see the model is kind of obsoleted. I can imagine in future that based on checks, there will be case a specific repository needs to be enabled / disabled (talking about RHEL repos).

I am fun of Tasks suffix as this is kind of self explaining name we could use across many problems we would like to handle on one place. But the approach is questionable. Let's see what will be the way in future.


enabled_repos = set()
def process(self):
self.get_custom_repos()
Copy link
Member

@pirat89 pirat89 Sep 25, 2019

Choose a reason for hiding this comment

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

Actually, it returns now rhel repositories. not custom:

p self.custom_repos
[<leapp.models.targetrepositories.CustomTargetRepository object at 0x7f115f1ed3d0>, <leapp.models.targetrepositories.CustomTargetRepository object at 0x7f115f1ed410>, <leapp.models.targetrepositories.CustomTargetRepository object at 0x7f115f1ed450>]
(Pdb) p self.custom_repos[0].name
None
(Pdb) p self.custom_repos[0].baseurl
None
(Pdb) p self.custom_repos[0].enabled
True
(Pdb) p self.custom_repos[0].repoid
u'rhel-8-for-x86_64-baseos-rpms'
(Pdb) p self.custom_repos[1].repoid
u'codeready-builder-for-rhel-8-x86_64-rpms'
(Pdb) p self.custom_repos[2].repoid
u'rhel-8-for-x86_64-appstream-rpms'
...

Expected only two customrepos (produced by custom actor) with APPSTREAM and BASEOS names.

@@ -406,4 +407,4 @@ def produce_messages(tasks):
to_remove=to_remove_pkgs))

if to_enable_repos:
api.produce(RepositoriesSetupTasks(to_enable=to_enable_repos))
api.produce(CustomTargetRepositories(repos=[CustomTargetRepository(repoid=repo) for repo in to_enable_repos]))
Copy link
Member

@pirat89 pirat89 Sep 25, 2019

Choose a reason for hiding this comment

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

that's the thing. You are presenting RH repos as custom which is wrong. You are changing here the meaning of CustomTargetRepositories model at all. (this is not the only issue in the PR as original msgs CustomTargetRepository messages are not processed.)

pirat89 added a commit to pirat89/leapp-repository that referenced this pull request Sep 25, 2019
This reverts commit 47188e3.

The commit brings several issues and I do not have power to fix it
now correctly. I am reverting so it can be fixed properly in future
without blocking the others now.
vinzenz pushed a commit that referenced this pull request Sep 25, 2019
This reverts commit 47188e3.

The commit brings several issues and I do not have power to fix it
now correctly. I am reverting so it can be fixed properly in future
without blocking the others now.
@bocekm bocekm deleted the target_repos_actor_cleanup branch March 10, 2020 09:54
@bocekm bocekm restored the target_repos_actor_cleanup branch March 10, 2020 10:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

setuptargetrepos: copy paste error?
3 participants