Bug 2057183 - OperatorHub: Missing "valid subscriptions" filter
Summary: OperatorHub: Missing "valid subscriptions" filter
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Management Console
Version: 4.11
Hardware: Unspecified
OS: Unspecified
unspecified
urgent
Target Milestone: ---
: 4.11.0
Assignee: Jon Jackson
QA Contact: Xiyun Zhao
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-02-22 21:48 UTC by tony.wu
Modified: 2022-08-10 10:51 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2022-08-10 10:50:45 UTC
Target Upstream Version:
Embargoed:
jonjacks: needinfo-


Attachments (Terms of Use)
valid-sub-fieldset___mockup_with_detailed_redlines (498.85 KB, image/png)
2022-02-22 21:48 UTC, tony.wu
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Github openshift console pull 11219 0 None open Bug 2057183: Add validSubscription filter to OperatorHub 2022-03-22 21:00:18 UTC
Github openshift console pull 11287 0 None open Bug 2057183: Only show operator detail page "Valid Subscriptions" item when it's not empty 2022-04-05 17:12:37 UTC
Red Hat Product Errata RHSA-2022:5069 0 None None None 2022-08-10 10:51:02 UTC

Description tony.wu 2022-02-22 21:48:51 UTC
Created attachment 1862749 [details]
valid-sub-fieldset___mockup_with_detailed_redlines

Created attachment 1862749 [details]
valid-sub-fieldset___mockup_with_detailed_redlines

Description of problem:
The checkbox filters (fieldset) on the OperatorHub UI are missing for Operators with "valid subscriptions" CSV annotation
(while the "valid subscriptions" are displayed correctly on the details panel of the OperatorHub UI)

e.g. 
An Operator CSV is annotated as:
--
operators.openshift.io/valid-subscription: '["OpenShift Kubernetes Engine", "OpenShift Container Platform”]’


Version-Release number of selected component (if applicable):
4.6 to 4.11


How reproducible:
100%


Steps to Reproduce:
1. Create a custom Operator catalog with Operators include `valid-subscription` CSV annotation 
2. Go to OperatorHub UI
3. Check "Valid Subscriptions" filter


Actual results:
"Valid Subscriptions" filter is missing


Expected results:
"Valid Subscriptions" filter should be present.

e.g.
for “OpenShift Virtualization Operator”, it’ll be annotated '["OpenShift Kubernetes Engine", "OpenShift Container Platform"]'  in CSV
for “Red Hat OpenShift Pipelines Operator”, it’ll be annotated just '["OpenShift Container Platform"]' in CSV

UI will identify if the valid sub-array includes the valid license string (e.g. through Array.includes("OpenShift Container Platform"))
and then just displayed the label as three buckets:

- OpenShift Kubernetes Engine
“item-count”: Number of Operator includes “OpenShift Kubernetes Engine (OKE)” in "valid subscription" annotation

- OpenShift Container Platform
“item-count”: Number of Operator includes “OpenShift Container Platform (OCP)” in "valid subscription" annotation

- Requires separate subscription
“item-count”: Number of Operator includes other than “OKE”/“OCP” in "valid subscription" annotation


Please check out the attached mockup ("valid-sub-fieldset_v2") and see the redlines for more details.



Additional info:

Comment 2 Xiyun Zhao 2022-03-02 13:08:17 UTC
Hi @tony.wu,
After deep investigation. I think the mentioned issue is a new requirement, the expected results are not supported on current version yet.
I'd like to involve developer for a double confirm 

Hi @jonjacks,
All reported issue has been reproduced on OCP4.10 and 4.9. 
But there is a comment confirmed that the feature of 'Valid Subscriptions filter type shown on Operators Hub page' has been removed(Reference as below), so I think the reported issue is not supported on current release version. 
https://polarion.engineering.redhat.com/polarion/#/project/OSE/workitem?id=OCP-29198
Could you please help to double confirm:
1. Whether the comment shown on the test case is effective or not.
2. Is there any new feature to support the function of 'Valid Subscriptions filter type shown on Operators Hub page'?
3. If this is a new requirement, is there any process needs to be trigger for this bug?
Here are the reference for the original feature:
https://issues.redhat.com/browse/CONSOLE-2124
https://github.com/openshift/console/pull/4794

Please let me know if you need any other information.

Comment 3 tony.wu 2022-03-02 15:19:03 UTC
@

Comment 4 tony.wu 2022-03-02 15:23:52 UTC
Hi @xiyuzhao, 

As mentioned in https://issues.redhat.com/browse/CONSOLE-2124:
--
Problem
* As a user, I want to be able to filter Operators in the Operator hub based off certain badges.
* As a user, I would like to see all badges related to an Operator on the install and details pages.

Acceptance Criteria
* Operators using the provided `operators.openshift.io/capability` annotations (below) will display the appropriate badge.
* Operators using the provided `operators.openshift.io/valid-licenses` annotations (below) will display the appropriate badge.
* Operators should be able to be filtered via the above badges listed under the filters sidebar.


We've chatted about this with the console PM @amobrem and Architect @spadgett and they thought if it’s an existing capability or feature that’s missing, it’s reasonable to call it a bug.

Hence why this BZ is created for tracking.

Comment 8 Xiyun Zhao 2022-04-01 09:37:44 UTC
Hi @Jon Jackson, Please help to check the issue as below shown 
Description:
When no annotations are added for the operator, the badge of 'Valid Subscriptions' will still show on Operator details modal page

Reproduce step:
1. Login OCP, navigate to OperatorHub page, select 'Anzo Unstructured Operator' as sample which is not having annotation that about 'valid subscription', click and navigate to the operator modal page
2. Check if Valid Subscriptions badge is not shown on the details page(Attached:Valid_Subscription_should_not_show)

Actual Result:
2. The valid subscriptions badge is shown on the operator details page

Expected Result:
2. When no annotations are added for the operator, 'valid subscriptions' badge should not show on operator details page

Comment 10 Jon Jackson 2022-04-01 13:59:36 UTC
Hi @xiyuzhao@redhat.com!xiyuzhao@redhat.

Comment 11 Jon Jackson 2022-04-01 14:06:28 UTC
Can you confirm that the above is not existing behavior? I didn't make any changes to the way this field is rendered on the details modal.

Comment 12 Xiyun Zhao 2022-04-02 02:15:41 UTC
Hi Jon,
After checking the feature design. I think the annotation for 'valid subscription' would have the same behavior of 'infrastructure-features' on Operator install and details pages, which is the badge would not show on page when annotation is null.
Also, compare with the behavior of OCP 4.10, when valid subscription annotation is null, the badge of valid subscription would not show on operator modal page. (Attached file: Compare_with_OCP4.10)
I could open a new BZ for tracking this issue, if you confirmed that it is not caused by this change

Comment 14 Jon Jackson 2022-04-05 17:13:51 UTC
Hi Xiyun, I confirmed that this issue was caused by this change and opened a follow-on PR to fix it.

Comment 17 Xiyun Zhao 2022-04-08 08:31:52 UTC
This bug has been verified on payload 4.11.0-0.nightly-2022-04-07-053433

Verification steps:
1. Create a custom Operator catalog with Operators include `valid-subscription` CSV annotation
   eg: From case OCP-29198
     # cat > console2124-catalogsource.yaml  << EOF
       apiVersion: operators.coreos.com/v1alpha1
       kind: CatalogSource
       metadata:
         name: custom-console2124
         namespace: openshift-marketplace
       spec:
         sourceType: grpc
         image: quay.io/yapei/console-2124:0409
         displayName: Custom Console Testing
         publisher: yapei
       EOF
    # oc create -f console2124-catalogsource.yaml 
2. Navigate to Operator -> OperatorHub page
3. Check "Valid Subscriptions" filter on Operator Hub page
4. Go back to OperatorHub page, select 'Anzo Unstructured Operator' as sample which is not having annotation that about 'valid subscription', click and navigate to the operator install details page
5. Check if Valid Subscriptions badge is not shown on the details page

Result:
3. "Valid Subscriptions" filter would be list on the left panel of the page with correct Operator 
   User is able to filter the operator by clicking the option that list under 'valid subscriptions'
   Only one filter listed if two catalog sources have same annotation in build, no conflict issue found
5. When no annotations are added for the operator, 'valid subscriptions' badge would not show on operator install details page
   The corresponding filter name would be list under 'valid subscription' badge on operator install details page when the operator is belongs to one filter

Comment 19 errata-xmlrpc 2022-08-10 10:50:45 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 (Important: OpenShift Container Platform 4.11.0 bug fix and security update), 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-2022:5069


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