Skip to content
This repository has been archived by the owner on Nov 13, 2023. It is now read-only.

ProfileInfo: Identify non-schema properties in the mergedArgs #1001

Merged
merged 8 commits into from
Jul 31, 2023

Conversation

ATorrise
Copy link
Contributor

@ATorrise ATorrise commented Jul 18, 2023

What It Does

How to Test

Review Checklist
I certify that I have:

Additional Comments

zFernand0 and others added 2 commits July 18, 2023 16:25
Signed-off-by: Amber Torrise <amber.torrise@broadcom.com>
Co-authored-by: zFernand0 <37381190+zFernand0@users.noreply.github.com>
Signed-off-by: zFernand0 <37381190+zFernand0@users.noreply.github.com>
Signed-off-by: Amber Torrise <at895452@broadcom.net>
Signed-off-by: Amber Torrise <at895452@broadcom.net>
Signed-off-by: zFernand0 <37381190+zFernand0@users.noreply.github.com>
Signed-off-by: Amber Torrise <at895452@broadcom.net>
@codecov
Copy link

codecov bot commented Jul 18, 2023

Codecov Report

Patch coverage: 100.00% and no project coverage change.

Comparison is base (4f8ca32) 89.76% compared to head (55ed192) 89.76%.
Report is 1 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1001   +/-   ##
=======================================
  Coverage   89.76%   89.76%           
=======================================
  Files         211      211           
  Lines       11533    11534    +1     
  Branches     2584     2584           
=======================================
+ Hits        10353    10354    +1     
  Misses       1180     1180           
Files Changed Coverage Δ
packages/config/src/ProfileInfo.ts 97.54% <100.00%> (+<0.01%) ⬆️

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

Signed-off-by: Amber Torrise <at895452@broadcom.net>
@zFernand0 zFernand0 changed the title Imp 899 ProfileInfo: Identify non-schema properties in the mergedArgs Jul 24, 2023
Signed-off-by: zFernand0 <37381190+zFernand0@users.noreply.github.com>
@zFernand0 zFernand0 marked this pull request as ready for review July 24, 2023 18:52
Signed-off-by: zFernand0 <37381190+zFernand0@users.noreply.github.com>
zFernand0 and others added 2 commits July 26, 2023 16:43
Signed-off-by: zFernand0 <37381190+zFernand0@users.noreply.github.com>
Signed-off-by: Amber Torrise <112635587+ATorrise@users.noreply.github.com>
Copy link
Member

@t1m0thyj t1m0thyj left a comment

Choose a reason for hiding this comment

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

This doesn't seem to be working for me locally.

Here's what I did:

  1. Run zowe config init to create a simple config in my project directory that defines host, user, password, etc.
  2. Run the following script to load the default zosmf profile and display all the loaded args:
const { ProfileInfo } = require("@zowe/imperative");
(async () => {
    // Load connection info from default z/OSMF profile
    const profInfo = new ProfileInfo("zowe");
    await profInfo.readProfilesFromDisk();
    const zosmfProfAttrs = profInfo.getDefaultProfile("zosmf");
    const zosmfMergedArgs = profInfo.mergeArgsForProfile(zosmfProfAttrs, { getSecureVals: true });
    console.dir(zosmfMergedArgs);
})();

The offSchema property is false for all the args. I expected it to be true for all of them since I didn't add any custom properties outside the ones defined in the schema.

packages/config/src/doc/IProfArgAttrs.ts Outdated Show resolved Hide resolved
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.

I was able to confirm that the implementation works 🥳

image

But, I agree with @t1m0thyj 's suggestion to rename the variable for clarity. Since it would just be a matter of flipping the boolean values for that variable, I'll approve it now, and will re-approve if my review becomes stale due to those changes 😋

Signed-off-by: Amber Torrise <112635587+ATorrise@users.noreply.github.com>
@sonarcloud
Copy link

sonarcloud bot commented Jul 31, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

100.0% 100.0% Coverage
0.0% 0.0% Duplication

@zFernand0 zFernand0 merged commit 71fc4b8 into master Jul 31, 2023
20 checks passed
@zFernand0 zFernand0 deleted the imp-899 branch July 31, 2023 17:56
@zFernand0 zFernand0 added the release-minor Indicates a minor feature has been added label Jul 31, 2023
@github-actions
Copy link

Release succeeded for the master branch. 🎉

The following packages have been published:

  • npm: @zowe/imperative@5.17.0

Powered by Octorelease 🚀

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

Successfully merging this pull request may close these issues.

ProfileInfo: Add support for any properties specified in zowe.config.json
5 participants