Project

General

Profile

Actions

Bug #34626

closed

hammer repository create ignores --retain-package-versions-count option

Added by Samir Jha over 2 years ago. Updated over 2 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Repositories
Target version:
Difficulty:
trivial
Triaged:
Yes
Fixed in Releases:
Found in Releases:

Description

See Creating a repo via hammer with --retain-package-versions-count, the option is effectively ignored.

Further, such a repo cant be updated via WebUI wrt this setting (explanation below).

Version-Release number of selected component (if applicable):
Sat 7.0 snap 9

How reproducible:
100%

Steps to Reproduce:
1. in hammer shell:
product create --organization-id 1 --name test_product
repository create --retain-package-versions-count 1 --name testrepo_1 --product test_product --organization-id 1 --content-type yum
repository create --retain-package-versions-count -3 --name testrepo_-3 --product test_product --organization-id 1 --content-type yum

2. Open the repos in WebUI and check "Retain package versions:" settings.
3. Check the databases for the settings:

su - postgres -c "psql foreman -c \"select id,name,retain_package_versions_count from katello_root_repositories where name ilike '%testrepo%';\""

su - postgres -c "psql pulpcore -c \"select cr.name,rrr.retain_package_versions from rpm_rpmrepository as rrr inner join core_repository as cr on cr.pulp_id = rrr.repository_ptr_id where name ilike '%testrepo%';\""

Actual results:
1. hammer allows creating the repos (even with negative count provided, see relevant https://bugzilla.redhat.com/show_bug.cgi?id=2054121 )

2. WebUI does not show the "Retain package versions:" option for the hammer-created repo (while it does show it properly for a repo created via WebUI)

3. foreman/katello DB does store the retain_package_versions_count provided via hammer, BUT pulpcore stores ZERO value every time.

(I think the inconsistency between DBs causes the 2. and also is a good symptom where the bug lies)

Expected results:
2. WebUI to show "Retain package versions:" option for the hammer-created repo as well.
3. Both DBs to store proper values of the setting.

Additional info:

Actions #1

Updated by Samir Jha over 2 years ago

  • Bugzilla link set to 2054123
Actions #2

Updated by The Foreman Bot over 2 years ago

  • Status changed from New to Ready For Testing
  • Assignee set to Samir Jha
  • Pull request https://github.com/Katello/katello/pull/10020 added
Actions #3

Updated by Partha Aji over 2 years ago

  • Target version set to Katello 4.5.0
  • Triaged changed from No to Yes
Actions #4

Updated by The Foreman Bot over 2 years ago

  • Fixed in Releases Katello 4.5.0 added
Actions #5

Updated by Samir Jha over 2 years ago

  • Status changed from Ready For Testing to Closed
Actions #6

Updated by Ian Ballou over 2 years ago

  • Target version changed from Katello 4.5.0 to Katello 4.3.2
  • Triaged changed from Yes to No

Having additive be the default policy is not very helpful, so I'm suggesting that we backport this change.

Actions #7

Updated by Chris Roberts over 2 years ago

  • Difficulty set to trivial
  • Triaged changed from No to Yes
Actions

Also available in: Atom PDF