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

fix(profInfo): Fix secure property names being returned for wrong profile #2016

Merged
merged 1 commit into from
Jan 12, 2024

Conversation

t1m0thyj
Copy link
Member

What It Does
Fixes a small bug in ConfigSecure.securePropsForProfile where listing secure property names for "abcdef" profile also included property names for "abc" profile

Also moves top-level methods in ConfigUtils.ts inside a class to conform to best practices (thanks @zFernand0 for the suggestion).

How to Test

const { Config } = require("@zowe/imperative");
(async () => {
    const config = await Config.load("zowe", { projectDir: <projectDir> });
    for (const profName of ["zosmf", "zosmf-apiml", "base"]) {
        console.log(profName, config.api.secure.securePropsForProfile(profName));
    }
})();

Review Checklist
I certify that I have:

Additional Comments

Copy link

codecov bot commented Jan 11, 2024

Codecov Report

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

Comparison is base (461c540) 91.03% compared to head (66929ba) 91.02%.
Report is 1 commits behind head on master.

Files Patch % Lines
...imperative/src/config/cmd/secure/secure.handler.ts 66.66% 1 Missing ⚠️
...e/src/imperative/src/config/cmd/set/set.handler.ts 66.66% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2016      +/-   ##
==========================================
- Coverage   91.03%   91.02%   -0.01%     
==========================================
  Files         636      636              
  Lines       18731    18737       +6     
  Branches     3907     3908       +1     
==========================================
+ Hits        17051    17055       +4     
- Misses       1679     1681       +2     
  Partials        1        1              

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

Copy link
Member

@zFernand0 zFernand0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I learned that using .startsWith may not always be a good practice 😋
LGTM! 😋

@@ -14,7 +14,7 @@ export * from "./src/ConfigAutoStore";
export * from "./src/ConfigConstants";
export * from "./src/ConfigSchema";
export * from "./src/ConfigBuilder";
export * as ConfigUtils from "./src/ConfigUtils";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is the way in which we will have to eventually deal with the Imperative package.
Little by little, and as non-breaking changes. 😋
Thanks for moving the functions into a class 😋

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for addressing these edge cases for the ProfileInfo APIs

Copy link

Copy link
Member

@traeok traeok left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested and LGTM! Thanks @t1m0thyj

@t1m0thyj t1m0thyj merged commit 0845cc0 into master Jan 12, 2024
20 checks passed
@t1m0thyj t1m0thyj deleted the fix/config-secure-props branch January 12, 2024 19:08
@t1m0thyj t1m0thyj added the release-current Indicates that there is no new functionality being delivered label Jan 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release-current Indicates that there is no new functionality being delivered
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants