zowe / zowe-cli

Zowe CLI
Eclipse Public License 2.0
108 stars 85 forks source link

fix(ProfileInfo): update global schema even if project config is present #2087

Closed traeok closed 3 months ago

traeok commented 3 months ago

What It Does

Resolves #2086

How to Test

This one is a bit difficult to test on the CLI side because it relies on information from the source that initialized the ProfileInfo instance.

  1. Create an instance of ProfileInfo and call readProfilesFromDisk, specifying both a global dir and project dir
  2. While in a directory containing a project-level config and schema, call ProfileInfo.addProfileTypeToSchema to add a new profile type to the global schema
  3. Notice that the global schema will still be updated even though you are in a directory with a project-level config.

You can also test this through Zowe Explorer, but it requires a bit more setup:

Review Checklist I certify that I have:

codecov[bot] commented 3 months ago

Codecov Report

Attention: Patch coverage is 95.00000% with 2 lines in your changes are missing coverage. Please review.

Project coverage is 91.07%. Comparing base (6778da5) to head (5200c18). Report is 1 commits behind head on master.

Files Patch % Lines
packages/imperative/src/config/src/ProfileInfo.ts 95.00% 2 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #2087 +/- ## ======================================= Coverage 91.07% 91.07% ======================================= Files 636 636 Lines 18976 18990 +14 Branches 3978 3916 -62 ======================================= + Hits 17282 17295 +13 - Misses 1693 1694 +1 Partials 1 1 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

traeok commented 3 months ago

My latest commit c488fab refactors the addProfileTypeToSchema logic to add an optional parameter called updateProjectSchema. We will not leverage this parameter when registering Zowe Explorer extenders - but, if extenders want to update a project-level schema, they can now do so by calling the API themselves. However, it will not be managed by a file such as extenders.json until we add support for automatic updates of project-level schemas.

traeok commented 3 months ago

Should be ready for reviews now - I had to enhance one of the return checks to support updating the global schema while a project dir is open.

sonarcloud[bot] commented 3 months ago

Quality Gate Passed Quality Gate passed

Issues
1 New issue
0 Accepted issues

Measures
0 Security Hotspots
89.3% Coverage on New Code
0.0% Duplication on New Code

See analysis details on SonarCloud

github-actions[bot] commented 3 months ago

Release succeeded for the master branch. :tada:

The following packages have been published:

Powered by Octorelease :rocket: