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

Teach pulp-rpm-repository about retain-package-versions. #173

Merged
merged 1 commit into from
Mar 11, 2021

Conversation

ggainey
Copy link
Contributor

@ggainey ggainey commented Mar 10, 2021

closes #172

Copy link
Member

@mdellweg mdellweg left a comment

Choose a reason for hiding this comment

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

Is this a rather recently added feature in pulp_rpm?
If yes, do you think we can guard it's use by has_plugin?

edit: Probybly needs_plugin being lazy is the better choice.

Comment on lines -9 to +11
pulp rpm remote destroy --name "cli_test_rpm_remote" || true
pulp rpm repository destroy --name "cli_test_rpm_repository" || true
pulp rpm distribution destroy --name "cli_test_rpm_distro" || true
pulp rpm repository destroy --name "cli_test_rpm_repository" || true
pulp rpm remote destroy --name "cli_test_rpm_remote" || true
Copy link
Member

Choose a reason for hiding this comment

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

Cleanup in reverse order?
Fine for me! 👍

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Just making the cleanup() match the order at test-end :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Is this a rather recently added feature in pulp_rpm?
If yes, do you think we can guard it's use by has_plugin?

edit: Probybly needs_plugin being lazy is the better choice.

The feature has been in pulp_rpm since June , released in pulp_rpm 3.5 - does it really need a guard?

Copy link
Member

Choose a reason for hiding this comment

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

June is older than any CLI-Release. I believe we agreed to support about 5 releases back. So assuming your test would fail on earlier versions of pulp_rpm (which it doesn't in the cli) i think we are safe.

@@ -40,6 +40,10 @@ expect_succ curl "$curl_opt" --head --fail "$PULP_BASE_URL/pulp/content/cli_test
expect_succ pulp rpm repository version list --repository "cli_test_rpm_repository"
expect_succ pulp rpm repository version repair --repository "cli_test_rpm_repository" --version 1

expect_succ pulp rpm repository update --name "cli_test_rpm_repository" --retain-package-versions 2
expect_succ pulp rpm repository show --name "cli_test_rpm_repository"
test "$(echo "$OUTPUT" | jq -r '.retain_package_versions')" = "2"
Copy link
Member

Choose a reason for hiding this comment

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

To disable that function, do you nullify it, or will it be set to 0, -1, ...?
Can you add a test for that?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Set to 0 turns it off - will add a test, good call.

Copy link
Member

Choose a reason for hiding this comment

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

In that case (also being an integer) we probably don't need a test. For nullifying there can be interesting side effects.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

repushed a change constraining retain-package-versions to integer

@ggainey ggainey merged commit 02b74dd into pulp:develop Mar 11, 2021
@mdellweg mdellweg added this to the 0.7.0 milestone Mar 11, 2021
@ggainey ggainey deleted the retain_old branch June 18, 2024 12:57
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.

Feature: expose retain-package-versions to pulp/rpm/repository
2 participants