zowe / zowe-explorer-vscode

Visual Studio Code Extension for Zowe, which lets users interact with z/OS Data Sets, Unix System Services, and Jobs on a remote mainframe instance. Powered by Zowe SDKs.
Eclipse Public License 2.0
162 stars 90 forks source link

Numerous bugs/regression when updating from Zowe Explorer v2.18.0 -> Zowe Explorer v3 for extenders #3089

Open FrankSu1996 opened 1 week ago

FrankSu1996 commented 1 week ago

Describe the bug Once a Team config is created using the Add Profile to ... View UI, the team config file is missing base and rse profiles, and subsequent clicks on the treeview "+" icon issues a vscode error message like: Error running command zowe.uss.addSession: command 'zowe.uss.addSession' not found. This is likely caused by the extension that contributes zowe.uss.addSession.

To Reproduce

  1. Click on the "+" icon in any of the Zowe Explorer treeviews, and create a team configuration file.
  2. Click on the "+" icon again.

Expected behavior The created team configuration file is missing base/rse profiles, and subsequent clicks to the "+" icon will issue a vscode error message. Only restarting the workbench will remove the error message.

I've also noticed that project level configs are not created as zowe.config.user.json anymore, instead it is now zowe.config.json. This seems to mess with edit functionality, as the edit team config also will not open the correct team config if both global/project are present.

Desktop (please complete the following information):

FrankSu1996 commented 1 week ago

https://github.com/user-attachments/assets/9c90f65f-14b5-429e-acbd-dc08a8c5118d

JillieBeanSim commented 1 week ago

Hey @FrankSu1996 a fix was issued for the inclusion of base profile in the creation of team config, the pre-release version with date 202404242037 is pretty old. Please try again and can verify fix in a newer pre-release. The project level file name changes was done to be more consistent with Zowe CLI, more work was also done via CLI and our project with handling global vs project level profiles as well. Please share any feedback after testing a newer version. Thanks!

For RSE profiles a Zowe v3 compatible version of IBM Z Open Editor would be needed for the profile types registration and inclusion in the team configuration creation.

FrankSu1996 commented 1 week ago

I tried with version v3.0.0-next.202409091409. Although I see the base profiles now, I do not see our extended profile. Did the way extenders register with zowe-explorer-api change?

image

This is how we currently register, and we do so with no errors. Note that if I call ProfilesCache.getConfigArray(), it will include our profile type still.

JillieBeanSim commented 6 days ago

Hey @FrankSu1996 I know some extenders pass their profile type into the ...getExplorerExtenderApi().reloadProfiles(); and this calls profilesCache.refresh(). I am not sure if the following call to your refreshProfilesCache() method is duplicating the efforts done by it previous call.

FrankSu1996 commented 5 days ago

After doing some more testing, I've isolated multiple issues as a result of upgrading from Zowe Explorer/zowe-explorer-api v2.18.0 to the latest v3.0.0-next.202409091409. Nothing in our extension code has changed. Here are the regressions and bugs I have experienced:

  1. using the ZE views to create a team config file does not include extender profiles, despite ProfilesCache.getConfigArray() returning the extender profile metadata.
  2. Project team config file is now named zowe.config.json instead of zowe.config.user.json. I looked at Profiles.createZoweSchema() from the Zowe Explorer source on github for the latest v3 tag, and could not understand how it got changed. Also, the ZE UI action to edit a team config file fails for project config if there are both project and global configs present. The rename might be why.
  3. The prompt that v1 profiles are present and to convert to v2 always appears on every workbench startup, even though I do not have any v1 profiles present. Pressting "Convert Existing Profiles" fails and issues an error message
  4. On VsCode startup having ZE v3 installed, my workbench always seems to reload at least once. Maybe due to point 3?
  5. There is a regression on a previous bug fix where the ProfilesCache from zowe-explorer-api returns a stale profile when team configs are deleted.

Again, with Zowe Explorer/zowe-explorer-api v2.18.0, none of these above issues occur. Since zowe-explorer-api merely re-exports whatever Zowe Explorer exports as API, we cannot prevent users from updating to ZE v3, and thus breaking extenders as it is currently. The best we can do is issue an error message and not register with ZE v3.