Red Hat Satellite engineering is moving the tracking of its product development work on Satellite to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "Satellite project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs will be migrated starting at the end of May. If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "Satellite project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/SAT-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1667129 - Providing custom=false to products controller does not filter out custom products
Summary: Providing custom=false to products controller does not filter out custom prod...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Repositories
Version: 6.3.0
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: 6.5.0
Assignee: John Mitsch
QA Contact: vijsingh
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-01-17 14:25 UTC by John Mitsch
Modified: 2019-11-05 22:43 UTC (History)
2 users (show)

Fixed In Version: tfm-rubygem-katello-3.10.0.14-1
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-05-14 12:39:53 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 25180 0 Normal Closed Providing custom=false to products controller does not filter out custom products 2020-10-06 19:22:22 UTC
Red Hat Product Errata RHSA-2019:1222 0 None None None 2019-05-14 12:40:02 UTC

Description John Mitsch 2019-01-17 14:25:44 UTC
If I provide custom=false I still get custom products, see:  https://github.com/Katello/katello/blob/b7dc5d44d9d2af3b64a0c063a67f1e810be891cb/app/controllers/katello/api/v2/products_controller.rb#L50

Steps to Reproduce

* Access products API with custom=false (or any other value for that matter) - /katello/api/v2/organizations/1/products/?custom=false 
* Notice that only custom products are returned regardless of the value supplied to custom

Comment 1 John Mitsch 2019-01-17 14:25:46 UTC
Created from redmine issue https://projects.theforeman.org/issues/25180

Comment 2 John Mitsch 2019-01-17 14:25:48 UTC
Upstream bug assigned to jomitsch

Comment 3 John Mitsch 2019-01-17 14:27:50 UTC
I cloned this from redmine since this issue affects the dropdown in the RH repos page products filter. Users with a lot of custom products will find that filter frustrating to use since the custom products won't show on that page.

Comment 6 Bryan Kearney 2019-01-21 21:07:15 UTC
Moving this bug to POST for triage into Satellite 6 since the upstream issue https://projects.theforeman.org/issues/25180 has been resolved.

Comment 9 John Mitsch 2019-01-30 13:52:52 UTC
The way it works is a little confusing at first, but this is how our booleans currently work in the Katello API:

There are two params, custom and redhat_only, they work with truthy values only

custom=true -> only return custom products
custom=false -> do nothing, return all products
redhat_only=true -> only return redhat products
redhat_only=false -> do nothing, return all products

To return only redhat products and no custom ones, use 'redhat_only=true'

This has been the pattern for booleans in our API, so we decided to continue with it and not introduce another pattern

Comment 11 vijsingh 2019-01-31 05:28:36 UTC
Verified:

@Satellite 6.5.0 Snap 13.0

steps/observation:

 There are two params, custom and redhat_only, they work with truthy values only

custom=true -> only return custom products
custom=false -> do nothing, return all products
redhat_only=true -> only return redhat products
redhat_only=false -> do nothing, return all products

Comment 14 errata-xmlrpc 2019-05-14 12:39:53 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2019:1222


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