Bug 2046531

Summary: Remove schema subdir from dynamic plugin sdk
Product: OpenShift Container Platform Reporter: Joe Caiani <jcaiani>
Component: Management ConsoleAssignee: Jakub Hadvig <jhadvig>
Status: CLOSED DEFERRED QA Contact: Xiyun Zhao <xiyuzhao>
Severity: low Docs Contact:
Priority: unspecified    
Version: 4.10CC: yapei
Target Milestone: ---   
Target Release: ---   
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: 2023-03-09 01:11:59 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 Joe Caiani 2022-01-26 21:44:36 UTC
Description of problem:

When switching from release 4.9 -> 4.10+ the error: Error: Cannot find module '/Users/jcaiani/src/github.com/openshift/console/frontend/packages/console-dynamic-plugin-sdk/schema/console-extensions.json' appears.

To avoid this error, yarn clean should remove the schema directory from the path above. 

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


How reproducible:


Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:

Comment 3 Xiyun Zhao 2022-03-09 11:18:42 UTC
This bug is failed to verified on payload 4.11.0-0.nightly-2022-03-04-063157 on branch of release 4.10

@tgrein, 
could you help to check the error on the result section?
Verification Steps:
1. Execute below command one by one:
   $ git clone git:openshift/console.git
   $ cd console
   $ git checkout remotes/origin/release-4.9
   $ ./build.sh
   $ git checkout remotes/origin/release-4.10
   $ ./clean.sh
   $ ./build.sh
2. 1) Verify if the build can be built successfully on 4.9 and 4.10 release
   2) After running ./clean.sh on OCP 4.10, verified if the schema folder is removed from below path 
      $ ls frontend/packages/console-dynamic-plugin-sdk/
   3) Verify if after build successfully on OCP 4.10, a new schema folder can be found on path frontend/packages/console-dynamic-plugin-sdk/generated/
3. Checkout to release OCP-4.9 again, execute below command
   $ git checkout remotes/origin/release-4.9
   $ ./clean.sh
   $ ./build.sh
4. 1) Verify if the build can be built successfully on 4.9
   2) After running ./clean.sh on OCP 4.10, verified if the schema folder is removed from below path
      $ ls frontend/packages/console-dynamic-plugin-sdk/generated/
   3) Verify if a new schema folder is under path frontend/packages/console-dynamic-plugin-sdk/generated/

Result:
2.2 Error as below will show after running ./build.sh on OCP4.10
    ERROR in /console/frontend/packages/rhoas-plugin/console-extensions.json (1615 errors)
    obj[0].type should be equal to constant
    obj[0].properties should NOT have additional properties
    obj[0].properties should NOT have additional properties
    obj[0].properties should NOT have additional properties
    obj[0].properties should NOT have additional properties
    obj[0].properties should have required property 'handler'
2.3 The schema folder is still existing on path frontend/packages/console-dynamic-plugin-sdk/
     $ll frontend/packages/console-dynamic-plugin-sdk/
     total 48
     drwxr-xr-x.  7 root root   90 Mar  9 17:43 dist
     drwxr-xr-x.  4 root root   31 Mar  9 17:43 generated
     -rw-r--r--.  1 root root  144 Dec 13 15:44 OWNERS
     -rw-r--r--.  1 root root 1140 Mar  9 17:17 package.json
     -rw-r--r--.  1 root root 8773 Mar  9 17:17 README.md
     drwxr-xr-x.  2 root root  172 Dec 15 22:07 schema
     drwxr-xr-x.  5 root root  210 Mar  9 17:17 scripts
     drwxr-xr-x. 13 root root 4096 Mar  9 17:17 src

Comment 4 Tim Grein 2022-03-16 13:10:33 UTC
I think this problem is related to something else, because the directory won't get deleted if the build fails due to other reasons (this looks like it's related to something else). 
Could you try:
./clean.sh && ./build.sh on 4.9 and then on 4.10 again to check if this will appear again?

Comment 5 Xiyun Zhao 2022-03-18 09:09:01 UTC
Hi @Tim Grein
Actually there is another issue when clean&build console on OCP 4.9 on local on Fedoro35, I pasted all information on the link http://pastebin.test.redhat.com/1038096 

And upon issue is still exist in other environment

Comment 9 Shiftzilla 2023-03-09 01:11:59 UTC
OpenShift has moved to Jira for its defect tracking! This bug can now be found in the OCPBUGS project in Jira.

https://issues.redhat.com/browse/OCPBUGS-9097