Bug 2055980

Summary: [dynamic SDK][internal] console plugin SDK does not support table actions
Product: OpenShift Container Platform Reporter: Yaacov Zamir <yzamir>
Component: Management ConsoleAssignee: Jakub Hadvig <jhadvig>
Status: CLOSED ERRATA QA Contact: Xiyun Zhao <xiyuzhao>
Severity: high Docs Contact:
Priority: high    
Version: 4.11CC: aos-bugs, vszocs, xiyuzhao, yapei
Target Milestone: ---   
Target Release: 4.11.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-08-10 10:50:27 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Yaacov Zamir 2022-02-18 05:28:44 UTC
Description of problem:
When using actions plugins, table and details pages consume this actions via `LazyActionMenu` , without this component or an equivalent one a dynamic plugin can not take full advantage of the actions extension.

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


How reproducible:


Steps to Reproduce:
1. In a dynamic plugin, create an action extension with an action factory method for a CRD
2. In a custome list or details view of a CRD try to consume the actions link to the CRD
3.

Actual results:
Functionality missing

Expected results:
A component that renders the actions registered to the CRD object exit

Additional info:

Comment 3 Yadan Pei 2022-02-21 07:53:59 UTC
Hi Yaacov Zamir,

May I know how did you add customization extensions in console-extensions.json? For example, may I know the JSON object you've added? That would definitely help ~ 

something like this? 

  {
    "type": "console.navigation/href",
    "properties": {
      "id": "admin-dynamic-route-2",
      "perspective": "admin",
      "section": "admin-demo-section",
      "name": "%plugin__console-demo-plugin~Dynamic Nav 2%",
      "href": "/dynamic-route-2"
    }
  }

Comment 4 Yadan Pei 2022-03-03 08:09:41 UTC
Hi,

Is it possible that pointing me an example extension so that I can verify the bug? Thanks very much ~

Comment 5 Yadan Pei 2022-03-07 10:15:04 UTC
1. Install 'OpenShift Virtualization' 4.9.3 on a 4.11 cluster
oc get csv -n openshift-cnv
NAME                                      DISPLAY                    VERSION   REPLACES                                  PHASE
kubevirt-hyperconverged-operator.v4.9.3   OpenShift Virtualization   4.9.3     kubevirt-hyperconverged-operator.v4.9.2   Succeeded

2. Create OpenShift Virtualization Deployment instance 'kubevirt-hyperconverged'
oc get hyperconverged kubevirt-hyperconverged -n openshift-cnv
NAME                      AGE
kubevirt-hyperconverged   33m


3. Wait unitl 'Virtualization' nav menu appears, navigate to 'VirtualMachines', create some VMs and check the Kebab actions on VM list page and Actions menus on VM detail page, all actions are working as expected


However I tried the exact same steps on a 4.10 cluster and all actions are working well too.

Is there any user visible changes I can use to verify?

Comment 6 Yadan Pei 2022-03-07 10:17:57 UTC
I search `LazyActionMenu` in https://github.com/kubevirt-ui/kubevirt-plugin and found two entries

one is imported and used in src/views/virtualmachinesinstance/actions/VirtualMachinesInstanceActions.tsx
the other is imported and used in  src/views/virtualmachines/list/components/VirtualMachineActions/VirtualMachineActions.tsx 

so I tried with steps in comment 5 to verify from a user perspective, but it appears I didn't reproduce the issue on a cluster without the fix, so I maybe wrong

Comment 7 Xiyun Zhao 2022-03-22 16:55:56 UTC
This bug has been verified on the payload 4.11.0-0.nightly-2022-03-20-113855 and the newest console repo

This bug is about missing API, which is needs to verify that if the LazyAction Menu component is exposed via Console plugin SDK/internal package
Verification Step:
1. Git clone console repo to local, find ':azyActionMenu' component code
   $ cd frontend/packages/console-dynamic-plugin-sdk
   $ grep -rl 'LazyActionMenu' src
     src/api/internal-api.ts
2. Check if the component code of 'LazyActionMenu' is in ininternal-api.ts
3. yarn install in frontend
   $ cd ./frontend
   $ yarn install
4. Verify if the LazyActionMenu is being exported on file of internal-api.js
   $ vi frontend/packages/console-dynamic-plugin-sdk/dist/internal/lib/api/internal-api.js

Result:
1. Below list information can be found in internal-api.js file which verifies the LazyActionMenu component is indeed exposed via the internal SDK package
   export const LazyActionMenu = require('@console/shared/src/components/actions/LazyActionMenu').default;

Additional information:
https://github.com/openshift/console/blob/master/frontend/packages/console-dynamic-plugin-sdk/README.md
https://github.com/openshift/console/tree/master/frontend/packages/console-plugin-sdk
https://github.com/openshift/enhancements/blob/master/enhancements/console/dynamic-plugins.md

Comment 9 errata-xmlrpc 2022-08-10 10:50:27 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

Comment 10 Red Hat Bugzilla 2023-09-15 01:52:01 UTC
The needinfo request[s] on this closed bug have been removed as they have been unresolved for 365 days