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

Sync collection deprecation status #358

Closed
wants to merge 1 commit into from
Closed

Sync collection deprecation status #358

wants to merge 1 commit into from

Conversation

fao89
Copy link
Member

@fao89 fao89 commented Sep 15, 2020

@pulpbot
Copy link
Member

pulpbot commented Sep 15, 2020

Attached issue: https://pulp.plan.io/issues/7504

@bmbouter
Copy link
Member

@fao89 is there any public API that we can sync against that has this data today (for test assertion?)

collection, created = Collection.objects.get_or_create(
namespace=info["namespace"], name=info["name"]
namespace=info["namespace"], name=info["name"], deprecated=deprecated
Copy link
Member

Choose a reason for hiding this comment

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

This code is right, but this _pre_save stage only saves when the unit is created the first time. This means that a situation like

  1. Pulp sync's a collection and deprecated=False
  2. time passes and the deprecation flag is marked as True
  3. This code will never execute to change deprecated=False because the unit is already in Pulp

The issue is that content is immutable in Pulp and this content type is expecting mutability.

Copy link
Member Author

Choose a reason for hiding this comment

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

I can do a if..else to check if it is the first time creation

Copy link
Member

Choose a reason for hiding this comment

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

This issue description is the first problem, it's signalling a deeper issue an if/else won't fix. For example, if we did get it "updating" an existing unit with the deprecated flag once changed, that would be changed for every repository everywhere, which versions are intended to be immutable.

@fao89
Copy link
Member Author

fao89 commented Sep 25, 2020

closing in favor of: #366

@fao89 fao89 closed this Sep 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants