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

Limit how many repo versions Pulp retains #1204

Merged
merged 1 commit into from
Apr 26, 2021

Conversation

daviddavis
Copy link
Contributor

fixes #8368

Please be sure you have read our documentation on creating PRs:
https://docs.pulpproject.org/contributing/pull-request-walkthrough.html

@pulpbot
Copy link
Member

pulpbot commented Mar 22, 2021

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

@daviddavis daviddavis force-pushed the issue8368 branch 3 times, most recently from c8164f3 to c886bcc Compare March 22, 2021 22:50
CHANGES/8368.feature Outdated Show resolved Hide resolved
pulpcore/app/models/repository.py Show resolved Hide resolved
@ipanova
Copy link
Member

ipanova commented Mar 26, 2021

@daviddavis since repo version 0 is special, we should always keep it and maybe exclude from the version count to keep, meaning if the user has set retain_versions=1 we will keep latest and 0. thoughts?

@daviddavis
Copy link
Contributor Author

@ipanova currently I am waiting on the outcome of https://pulp.plan.io/issues/8454.

@daviddavis daviddavis marked this pull request as draft March 26, 2021 14:20
@ipanova
Copy link
Member

ipanova commented Mar 26, 2021

@ipanova currently I am waiting on the outcome of https://pulp.plan.io/issues/8454.

oh ok, i missed this one

@daviddavis daviddavis force-pushed the issue8368 branch 2 times, most recently from ebcc3ba to d712380 Compare April 15, 2021 18:12
@daviddavis daviddavis marked this pull request as ready for review April 15, 2021 19:04
@mdellweg
Copy link
Member

Code looks good.
What i am pondering here is how does it handle versions that are published / attached to a distribution?
Is it playing nice with auto_publish when set to one?

@daviddavis
Copy link
Contributor Author

I'll add a test to cover the case of auto-publish/auto-distribute with retained_versions.

@daviddavis daviddavis marked this pull request as draft April 16, 2021 13:15
@daviddavis daviddavis force-pushed the issue8368 branch 4 times, most recently from 788a68e to 0c7d009 Compare April 19, 2021 15:00
@daviddavis daviddavis marked this pull request as ready for review April 19, 2021 15:00
@daviddavis daviddavis requested review from ipanova and mdellweg April 20, 2021 13:50
retained_versions = serializers.IntegerField(
help_text=_(
"Retain X versions of the repository. Default is null which retains all versions."
" This is provided as a tech preview in Pulp 3 and may change in the future."
Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

another idea would be a create a new workflow for repo versions where we could how to trigger it and when it gets triggered, specifically to clarify that versions are getting cleaned up even on the repo update call.

self.assertEqual(len(versions), 2)
self.assertEqual(self.repo.latest_version_href.split("/")[-2], "3")

def test_autodistribute(self):
Copy link
Member

Choose a reason for hiding this comment

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

👍

@daviddavis
Copy link
Contributor Author

I decided to go with some workflow docs, which means I need to update the CLI. Setting this back to draft while I do that.

@daviddavis daviddavis marked this pull request as ready for review April 26, 2021 15:45
@daviddavis daviddavis merged commit 0779b5d into pulp:master Apr 26, 2021
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.

6 participants