-
Notifications
You must be signed in to change notification settings - Fork 100
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
zowe.schema.json is not updated automatically when extenders contribute a new service profile to zowe-explorer-api #2773
Comments
Thank you for creating a bug report. |
Hey @FrankSu1996, These issues should be resolved with v2.15.0 of Zowe Explorer 😋 |
Thanks, will try with v2.15.0 of Zowe Explorer. |
@zFernand0 where can I find a description of what the fix in 2.15 does? They key use case goes back to the reasons for Zowe switching to team.config files in the first place: an end user does not want to create it themselves, but just receive and use it from an admin. So the use case is
|
@phaumer This was introduced as a more comprehensive enhancement to fulfill request #2508 - see the 2nd entry in the "New features & enhancements" section of the v2.15 changelog. There were a few overarching issues that inspired the need for schema management between Zowe client applications:
As long as extenders are using v2.15 of the Zowe Explorer API, they should be able to successfully contribute to the schema without user intervention. |
Tested with zowe-explorer-api v2.15.0; the schema error sitll persists. My test:
The schema's failed to update, and did not include our service profile's metadata. Reloading VsCode did not work either. Creating a new team configuration file still works properly. |
@FrankSu1996 To verify, are you also using Zowe Explorer v2.15 for this test? We have added logic to ZE v2.15 during extender registration that will add the new profile types to the schema (if needed). However, without ZE v2.15 the API will not update the schema automatically during registration. If you want to update the schema manually using the API, we have a function in |
Yes, I am using Zowe explorer v2.15.0. I can see the new vscode warning messages about schema versions. |
Is there some sort of new API I need to call for the automated updating of the schema? Or do I just need to register with zowe-explorer-api as always using ApiExplorerExtender.initForZowe() and ProfilesCache.registerCustomProfilesType(). |
You should not have to call a new API as the schema updates are done in Note that we do not support automatically updating schemas at the project level because they are not easily managed - we only update the global schema. We discussed the potential to implement this as an enhancement, but it would have to be opt-in as we did not want to add files into a project directory to manage schema metadata. |
Using a global level team config also does not work. The warning messages do go away if I specify a version in our profile schema, but seems to have no impact on the schema update functionality. |
If possible, can you provide a screenshot of the warning message you've encountered? Based on our discussion so far, there are a couple possibilities in mind:
As a test for reference, I initialized a team config in sandbox using the Zowe CLI command |
Recording 2024-03-12 120000.zip I've attached a screen recording of what happens. Basically, we have an extension that contributes a In our extension code, we make the following api calls to zowe-explorer-api:
and only after those calls successfully complete do we log out "Successfully registered 'zOpenDebug' Zowe service profile type with zowe-explorer-api." as seen in the recording. |
Thanks for the recording @FrankSu1996, that helped to spot the problem. This is a bug with ProfileInfo and we will address this ASAP. Since you have a workspace folder opened containing a project-level config and schema, none of the schemas are updated on disk. This is unintended behavior and describes the bug mentioned above. However, if you close the workspace folder and try to install the extension, it should update the global schema with the profile metadata as expected. Since this is specific to ProfileInfo, which is a class in Imperative, I'm going to create an issue in the zowe-cli repo as a blocker for this one, and will follow up once the problem is resolved in Imperative. Thanks for your patience and feedback regarding the diagnosis of this issue. In the meantime, to avoid the "schema warning" messages from occurring in the future, I would recommend deleting the |
No problem, glad I could help Also, I realized that the reason why the schema wasn't getting updated for me (on top of the new issue you just opened) was that extenders.json had already cached zOpenDebug as a profileType, and if that's the case the schema update will not happen. I think this is a seperate issue, since users may install/uninstall an extension multiple times. In that case, if extenders.json is already caching the profileType, then subsequent installs will not update the schema for the user. When I did delete extenders.json, then installed our extension, the global zowe schema properly updated. |
Hi @FrankSu1996 - I just wanted to provide an update. I've resolved the issue you encountered in Imperative, and it's currently in the review/QA phase. Once the fix is released with the next version of Imperative, I'll prepare a patch version of Zowe Explorer (and its API package) with this fix. In addition, I've added an optional |
Closed as completed in #2786
|
Describe the bug
When extenders use zowe-explorer-api to contribute a new service profile, any currently present zowe.schema.json files (either workspace/global level) do not get updated to contain the new service profile's metadata. Currently, the only way to update the schema is by creating a new team configuration file using the Zowe Explorer views.
To Reproduce
Expected behavior
The newly added service profile should not introduce syntax errors in the team configuration file and should continue to function.
Actual behavior
The zowe team config file will not recognize the profile type since the zowe.schema.json is never updated, introducing syntax errors. ProfilesCache will also fail to load these newly defined profiles.
Screenshots
Desktop (please complete the following information):
Additional context
The text was updated successfully, but these errors were encountered: