-
Notifications
You must be signed in to change notification settings - Fork 53
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
Remove features deprecated in 3.12 for 3.13 compatibility #563
Conversation
b935eea
to
51b8ae6
Compare
Attached issue: https://pulp.plan.io/issues/8589 |
849c16e
to
f61cc95
Compare
The test failures are because of a loosened restriction - "repository" and "repository_version" are now allowed to be used together. @fao89 Does the ansible plugin want to enforce this? Depending on the use case I think it could be reasonable for some plugins to want to do that. |
32aa98d
to
748d174
Compare
I can't think of a reason to enforce it, currently, we already try both https://github.com/pulp/pulp_ansible/blob/master/pulp_ansible/app/galaxy/v3/views.py#L57-L71 @daviddavis wdyt? |
pulp_ansible/app/viewsets.py
Outdated
update_collection_remote, | ||
lock, | ||
args=(pk,), | ||
args=(str(pk),), |
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 str() can be removed I think.
pulp_ansible/app/viewsets.py
Outdated
@@ -376,15 +380,15 @@ def _process_config(self, config): | |||
entry["source_repo_version"], RepositoryVersion | |||
) | |||
dest_repo = NamedModelViewSet().get_resource(entry["dest_repo"], AnsibleRepository) | |||
r["source_repo_version"] = source_version.pk | |||
r["dest_repo"] = dest_repo.pk | |||
r["source_repo_version"] = str(source_version.pk) |
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.
All the str() call can be removed actually. The next release this code will go into (pulp_ansible 0.8) will be compatible with pulpcore 3.13 which no longer requires these.
Using master (without this PR) I created a distribution, and here is what the database master/detail shows:
Then I upgrade to this PR, run the migrations and the db now looks like:
So that all looks successful! Also when starting the upgraded ansible, the CLI continues to list the distribution correctly:
So functionally speaking, this is all looking great. |
Apologies for not seeing this sooner. My understanding (which is perhaps outdated) is that you can either distribute the repository (which distributes the latest version) or a particular repo version. So I'm not sure I understand the use case where a user would set both? |
This is also my understanding. |
The semantics on publication-based plugins are:
The semantics on repository-version based plugins are:
What I'm asking is, in effect, if we want to keep these separate semantics, or if we want to make plugins like ansible use the same semantics as publication-based plugins, in which case it having both unlocked at the same time makes sense. |
@dralley I'm not fully understanding the suggestion. I can tell I'm not because I don't see an opportunity to change the semantics. Right now I think since the detail serializer doesn't have a publication field so I'm thinking all we can do is to keep the semantics of repository-version based plugins. At some point in the future we will probably make |
@bmbouter I'm not suggesting using publications, I'm suggesting using the same behavior. i.e. New version gets created, if |
803915f
to
5217936
Compare
I think this is waiting on pulpcore PR, is that right? If so, which one? |
I was told on IRC this was waiting on pulp/pulpcore#1335 |
5217936
to
9ac7d73
Compare
msg = _("no_change: Checking if remote changed since last sync.") | ||
noop = ProgressReport(message=msg, code="sync.no_change") |
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 didn't expect this, but I'm ok with it.
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.
As an explanation, since more than one logical "task" could be going on within a literal "task", we've been updating progress reports to be specific about what progress they are reporting.
A publish can now happen in the same task as a sync, so therefore we want to make the progress reporting conventions more specific.
But you're right, that isn't clear from just the PR description and the issue. Apologies, this is wrapping up a few different things at once.
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.
It's no problem. Thank you @dralley !
@@ -50,7 +50,7 @@ def synchronize(remote_pk, repository_pk, mirror=False): | |||
) | |||
first_stage = RoleFirstStage(remote) | |||
d_version = DeclarativeVersion(first_stage, repository, mirror=mirror) | |||
d_version.create() | |||
return d_version.create() |
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 didn't expect this, but I'm ok with it.
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.
Same here. It doesn't change anything since we're not using this result, but the convention is that we could be using this result.
@@ -76,7 +76,7 @@ async def run(self): | |||
""" | |||
Build and emit `DeclarativeContent` from the ansible metadata. | |||
""" | |||
with ProgressReport(message="Parsing Role Metadata", code="parsing.metadata") as pb: | |||
with ProgressReport(message="Parsing Role Metadata", code="sync.parsing.metadata") as pb: |
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.
also this, but I'm ok with it.
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.
Thank you @dralley !
This change is compatible with 3.12? If so, I can do the release tomorrow! |
It is because the new |
@fao89 Not 3.12.0, but yes 3.12.1. There was an oversight where we forgot to put |
closes: #8589
https://pulp.plan.io/issues/8589