Bug 655128

Summary: [RFE] Add support for group/category yum metadata in a pulp repo with no packages
Product: [Retired] Pulp Reporter: John Matthews <jmatthew>
Component: z_otherAssignee: John Matthews <jmatthew>
Status: CLOSED CURRENTRELEASE QA Contact: Preethi Thomas <pthomas>
Severity: medium Docs Contact:
Priority: medium    
Version: unspecifiedCC: jason.dobies, skarmark, tsanders
Target Milestone: ---Keywords: FutureFeature, Triaged
Target Release: Sprint 26   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 673012    

Description John Matthews 2010-11-19 17:03:28 UTC
Description of problem:

Currently pulp relies on createrepo generating the initial repo metadata files, repomd.xml, etc.  Createrepo is typically run after a package is uploaded, or packages are synced to a repo.

This bug is to note the work we need to perform to support a repo remaining free of packages, yet it will contain group and category information.  For that to occur pulp needs to generate the initial metadata.

FOR QA:
The test for this bug is:
1) Create a repo with no feed
2) Do not upload any packages
3) Create a package group
4) Create a category
5) Create a consumer and bind to the new repo
6) On consumer verify with a grouplist you can see the created group

Look at the file comps.xml or comps.xml.gz and verify that you see the category info (this will be cached under /var/yum/cache on the client)

Comment 1 John Matthews 2011-08-05 18:09:48 UTC
QE:  I followed below steps to verify this has been fixed in pulp.
Fix was committed previously, unsure of exact commit.  Probably around time we added support of running createrepo on an empty repo, this was working.

sudo pulp-admin repo create --id grouprepo
sudo pulp-admin packagegroup create --repoid grouprepo --id testgroup1 -n testgroup1name
sudo pulp-admin packagegroup create_category -r grouprepo -n catname1 --categoryid cat1
sudo pulp-admin packagegroup add_group --categoryid cat1 --id testgroup1 -r grouprepo
sudo pulp-admin packagegroup add_package --repoid grouprepo --id testgroup1 -n zsh
sudo pulp-admin consumer bind --repoid grouprepo --id jwm_test
sudo pulp-admin consumer bind --repoid grouprepo --id jwm_test



$ sudo yum --disablerepo=* --enablerepo="grouprepo" grouplist
Installed Groups:
   testgroup1name
Available Groups:
   testgroup2name
Done



$ sudo yum --disablerepo=* --enablerepo="grouprepo" groupinfo testgroup1name
Group: testgroup1name
 Default Packages:
   zsh

Comment 2 Preethi Thomas 2011-08-31 17:03:01 UTC
[root@preethi]~# rpm -q pulp
pulp-0.0.228-1.fc15.noarch

[root@preethi ~]# pulp-admin repo create --id grouprepo
Successfully created repository [ grouprepo ]

[root@preethi ~]# pulp-admin packagegroup create --repoid grouprepo --id testgroup1 -n testgroup1name
Package group [testgroup1] created in repository [grouprepo]

[root@preethi ~]# pulp-admin packagegroup create_category -r grouprepo -n catname1 --categoryid cat1
Package group category [cat1] created in repository [grouprepo]


[root@preethi ~]# 
[root@preethi ~]# 
[root@preethi ~]# pulp-admin packagegroup add_group --categoryid cat1 --id testgroup1 -r grouprepo
Package group [testgroup1] added to category [cat1] in repository [grouprepo]

[root@preethi]~# pulp-admin packagegroup add_package --repoid grouprepo --id testgroup1  -n zsh
Following packages added to group [testgroup1] in repository [grouprepo]: 
 ['zsh']

[root@preethi]~# pulp-admin consumer bind --repoid grouprepo --id pulp-client
Successfully subscribed consumer [pulp-client] to repo [grouprepo]

[root@preethi]~# pulp-admin consumer bind --repoid grouprepo --id pulp-client
Repo [grouprepo] already bound to the consumer

[root@preethi]~# 

From the client

[root@pulp-client ~]# yum --disablerepo=* --enablerepo="grouprepo" grouplist
Loaded plugins: pulp-profile-update
Setting up Group Process
grouprepo                                                | 3.1 kB     00:00     
grouprepo/primary_db                                     | 1.1 kB     00:00     
grouprepo/group                                          |  648 B     00:00     
Installed Groups:
   testgroup1name
Done
[root@pulp-client ~]# yum --disablerepo=* --enablerepo="grouprepo" groupinfo testgroup1name
Loaded plugins: pulp-profile-update
Setting up Group Process

Group: testgroup1name
 Default Packages:
   zsh
[root@pulp-client ~]#

Comment 3 Preethi Thomas 2012-02-24 20:18:46 UTC
Pulp v1.0 is released
Closed Current Release.

Comment 4 Preethi Thomas 2012-02-24 20:19:39 UTC
Pulp v1.0 is released.