Skip to content
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

feat(cfg): Schema management using ProfileInfo #2001

Merged
merged 65 commits into from
Jan 26, 2024

Conversation

traeok
Copy link
Member

@traeok traeok commented Jan 3, 2024

What It Does

This PR implements:

  • Schema management APIs in Imperative's ProfileInfo class, primarily to allow schema contributions from extenders and plug-ins of Zowe client applications. Also provides functionality for the following use cases:
    • Retrieve the schema for a specific profile type
    • Rebuild the entire schema using all available profile types, or rebuild the schema with types sourced from a specific application
    • Retrieve the list of sources for a specific profile type
    • Add a profile type to a layer in the configuration file (with defaults, if any exist)
  • The concept of schema versioning, enabling the following:
    • Replace a schema on-disk with a newer version, if provided
    • Recognize conflicts between schemas based on their versions
    • Warn users when a schema has been upgraded to a major version
    • Warn users if an extension/plug-in tries to register with an older major schema version than the one on-disk

How to Test

Create a test plug-in or extension that uses ProfileInfo and try one (or more) of the newly-implemented APIs:

  • addProfileToConfig
  • addProfileTypeToSchema
  • getProfileTypes
  • buildSchema
  • getSchemaForType

Alternatively, build and run tests, then do black-box testing to determine whether default behavior has remained the same. Testers should not notice any obvious differences when using the CLI build in this PR.

Review Checklist
I certify that I have:

Copy link

codecov bot commented Jan 3, 2024

Codecov Report

Attention: 14 lines in your changes are missing coverage. Please review.

Comparison is base (f937576) 91.03% compared to head (a05ecbf) 90.97%.

Files Patch % Lines
packages/imperative/src/config/src/ProfileInfo.ts 93.52% 9 Missing ⚠️
...ive/src/plugins/utilities/npm-interface/install.ts 90.47% 4 Missing ⚠️
...e/src/plugins/utilities/npm-interface/uninstall.ts 97.05% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2001      +/-   ##
==========================================
- Coverage   91.03%   90.97%   -0.06%     
==========================================
  Files         636      636              
  Lines       18739    18953     +214     
  Branches     3910     3973      +63     
==========================================
+ Hits        17059    17243     +184     
- Misses       1679     1709      +30     
  Partials        1        1              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@traeok traeok force-pushed the feat/cfg/schema-management branch from 708cfb2 to 2d767ce Compare January 3, 2024 19:25
@traeok traeok force-pushed the feat/cfg/schema-management branch from f6257c2 to c0f9047 Compare January 4, 2024 19:44
@traeok traeok force-pushed the feat/cfg/schema-management branch from c0f9047 to fba021a Compare January 4, 2024 20:22
@traeok traeok changed the title [WIP] feat(cfg): Schema management using ProfileInfo feat(cfg): Schema management using ProfileInfo Jan 5, 2024
@traeok traeok marked this pull request as ready for review January 5, 2024 17:19
@traeok
Copy link
Member Author

traeok commented Jan 5, 2024

I've marked this as ready for early reviews - going to do some manual testing to ensure some scenarios are handled, but figured anyone can start reviewing as the APIs are mostly finalized.

traeok and others added 19 commits January 12, 2024 14:31
Signed-off-by: Trae Yelovich <[email protected]>
feat(plugins): add/remove from schema during `zowe plugins install/uninstall`
Copy link

Quality Gate Passed Quality Gate passed

The SonarCloud Quality Gate passed, but some issues were introduced.

3 New issues
0 Security Hotspots
91.2% Coverage on New Code
0.0% Duplication on New Code

See analysis details on SonarCloud

@traeok traeok merged commit 88120da into master Jan 26, 2024
19 checks passed
@traeok traeok deleted the feat/cfg/schema-management branch January 26, 2024 16:24
@traeok traeok added the release-minor Indicates a minor feature has been added label Jan 26, 2024
Copy link

Release succeeded for the master branch. 🎉

The following packages have been published:

Powered by Octorelease 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release-minor Indicates a minor feature has been added released
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Manage schemas between Zowe client applications Enable extenders to record their use of profiles
4 participants