Bug 670284 - [RFE] Add an option to package group queries to restrict to packages available on server.
Summary: [RFE] Add an option to package group queries to restrict to packages availabl...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Pulp
Classification: Retired
Component: z_other
Version: unspecified
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
: Sprint 23
Assignee: John Matthews
QA Contact: Preethi Thomas
URL:
Whiteboard:
Depends On:
Blocks: verified-to-close 673012
TreeView+ depends on / blocked
 
Reported: 2011-01-17 19:17 UTC by John Matthews
Modified: 2011-08-15 15:14 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Enhancement
Doc Text:
Clone Of:
Environment:
Last Closed: 2011-08-15 15:14:45 UTC
Embargoed:


Attachments (Terms of Use)

Description John Matthews 2011-01-17 19:17:54 UTC
Description of problem:

There is desire for running a package group query and having the returned results only reference packages that are available on the pulp server. 

This would be implemented as an option to a package group info listing. 

Required for integration w/ aeolus conductor

Comment 1 John Matthews 2011-01-18 13:29:34 UTC
Jan,

Would you please review this BZ and add any notes of what you require?

Thanks,
John

Comment 2 Jan Provaznik 2011-01-18 13:59:01 UTC
Hi, I think description is correct, implementation as an option sounds good. 

In Conductor we have sw selection UI similar to gpk-application, so when user selects group (group of groups in fact) in the left panel, conductor fetches packagegroups for this group. In retrieved package list are listed packages which are not in repository (for example package 'silo' in 'coreutils' group). When user selects this package, image building fails because of missing package.

Only workaround for now is to fetch all packages (very slow query) to filter only existing pkgs, so filtering on pulp side will be very helpful.

Comment 3 John Matthews 2011-05-11 12:50:55 UTC
We have modified the package group call on the repositories controller.  The call takes in 2 optional parameters "filter_missing_packages" and/or "filter_incomplete_groups".  


Webservice call:
title: Repository Package Groups
description: Get the package groups in the repositories.
method: GET
path: /repositories/<repository id>/packagegroups/
permission: READ
success response: 200 OK
failure response: 404 Not Found if the id does not match a repository
return: list of package group names
filters:
* filter_missing_packages, bool, True means to filter results to remove missing package names
* filter_incomplete_groups, bool, True means to filter results to remove groups with missing packages


"filter_missing_packages" will return the groups information minus any package names that are not part of this repository.

"filter_incomplete_groups" will return only those groups that all packages listed are in the repository.  (If a group has a package not in the repo, then this group will not be returned in the result).

 
Commit:
http://git.fedorahosted.org/g
it/?p=pulp.git;a=commitdiff;h=433ded7cc9b63e41aeee808eb3df422d2e2d2309

QE:
Example from pulp-admin using the "-f/--filter" option.

Create two groups.
On first group add a package that exists in the repo
On second group add a package that exists in the repo AND a package name that is made up (not part of the repo)

To test: "filter_missing_packages" you will need to look at 'packagegroup info' on a specific group
 sudo pulp-admin packagegroup info --repoid test_repo --id jwm_group -f

 This should only return package names that are part of the repo



To test: "filter_incomplete_groups" you would run:
 sudo pulp-admin packagegroup list --repoid test_repo -f
 This should only return the first packagegroup, the one that all package names listed are part of the repo.

AND:
  sudo pulp-admin packagegroup list --repoid test_repo
  This should return both packagegroups

Comment 4 Jeff Ortel 2011-05-12 18:45:40 UTC
build: 0.176

Comment 5 Preethi Thomas 2011-07-26 14:22:55 UTC
verified
[root@preethi ~]# rpm -q pulp
pulp-0.0.213-1.fc14.noarch

[root@preethi ~]# pulp-admin packagegroup add_package --id=grp1 -r pulp -n pulp
Following packages added to group [grp1] in repository [pulp]: 
 ['pulp']

[root@preethi ~]# 
[root@preethi ~]# 
[root@preethi ~]# pulp-admin packagegroup add_package --id=grp2 -r pulp -n pulp-client
Following packages added to group [grp2] in repository [pulp]: 
 ['pulp-client']

[root@preethi ~]# pulp-admin packagegroup add_package --id=grp2 -r pulp -n no-package
Following packages added to group [grp2] in repository [pulp]: 
 ['no-package']

[root@preethi ~]# pulp-admin packagegroup info --id=grp1 -r pulp -n pulpUsage: pulp-admin <options> packagegroup info <options>

pulp-admin: error: no such option: -n
[root@preethi ~]# pulp-admin packagegroup info --id=grp1 -r pulp -f
+------------------------------------------+
          Package Group Information
+------------------------------------------+

Name                	grp1                     
Id                  	grp1                     
Mandatory packages  	[]                       
Default packages    	['pulp']                 
Optional packages   	[]                       
Conditional packages	{}                       


[root@preethi ~]# pulp-admin packagegroup info  -r pulp -f
Usage: pulp-admin <options> packagegroup info <options>

pulp-admin: error: Option --id is required; please see --help
[root@preethi ~]# pulp-admin packagegroup list  -r pulp -f
+------------------------------------------+
              Repository: pulp
          Package Group Information
+------------------------------------------+
	 grp1

[root@preethi ~]# pulp-admin packagegroup list  -r pulp
+------------------------------------------+
              Repository: pulp
          Package Group Information
+------------------------------------------+
	 grp1
	 grp2

Comment 6 Preethi Thomas 2011-08-15 15:14:45 UTC
Closing with current community release

pulp-0.0.223


Note You need to log in before you can comment on or make changes to this bug.