-
Notifications
You must be signed in to change notification settings - Fork 93
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(v3): Support logging in to multiple API ML instances #3019
Conversation
Signed-off-by: Timothy Johnson <[email protected]>
Signed-off-by: Timothy Johnson <[email protected]>
Signed-off-by: Timothy Johnson <[email protected]>
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## next #3019 +/- ##
==========================================
+ Coverage 92.88% 92.89% +0.01%
==========================================
Files 111 111
Lines 11159 11180 +21
Branches 2355 2449 +94
==========================================
+ Hits 10365 10386 +21
Misses 792 792
Partials 2 2 ☔ View full report in Codecov by Sentry. |
Signed-off-by: Timothy Johnson <[email protected]>
Signed-off-by: Timothy Johnson <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good so far, thanks Timothy! Had a couple questions regarding an arrow function and assignment of a parameter
Signed-off-by: Timothy Johnson <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! 😋
Left some comments/question to help me understand a bit better 😓
Signed-off-by: Timothy Johnson <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes LGTM - thanks Timothy for the enhancement!
Signed-off-by: Timothy Johnson <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How does this handle multiple levels of nesting? If a token is stored in level 1, and you do a login using level 3, does the token remain at level 1, or get moved to level 2?
Signed-off-by: Timothy Johnson <[email protected]>
Signed-off-by: Timothy Johnson <[email protected]>
Co-authored-by: Karan Patel <[email protected]> Signed-off-by: Timothy Johnson <[email protected]>
Signed-off-by: Timothy Johnson <[email protected]>
Quality Gate failedFailed conditions |
Good catch - the token was getting moved to level 2. This should be fixed in 4708616 so the token now remains at its original level. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! 😋
Left a few small questions, but nothing that should prevent this from being merged 😋
Great job! 🥳
* Retrieves the base profile from Imperative to use for log in/out. If a | ||
* nested profile name is specified (e.g. "lpar.zosmf"), then its parent | ||
* profile is returned unless token is already stored in the base profile. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we add this new behavior to the changelog as a new breaking change?
const config = mProfileInfo.getTeamConfig(); | ||
if ( | ||
profileName?.includes(".") && | ||
(baseProfileAttrs == null || !config.api.secure.securePropsForProfile(baseProfileAttrs.profName).includes("tokenValue")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Question about this line here.
In order for this function to return the default base profile (old behavior), the token only needs to be in the secure array of the base profile and not actually stored in the vault. Is that assumption correct?
Follow up question, Does that means that this function will return the default base profile even if I already have a token stored in the parent profile?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good questions, sorry I didn't see this until after the PR was merged. Your assumption is correct 😁
For the 2nd question, that's right. I think the reason was for backwards compatibility - however we probably want to give precedence to whichever profile has tokenValue already defined 😋
love the addition of this feature, the support for multiple API ML instances was a big hit when revealed for the CLI v3 at SHARE and is great to have this day 1 of ZE v3 too 😄 |
if other comments don't stop the merge, I think we can merge now but would like a CHANGELOG entry @t1m0thyj. can you share one here and it can be copied to the pre-release PR when staging release? this way we don't have to go through the approval process again 😄 |
Proposed changes
Resolves #2264 and ports #3002 to vNext branch
Also moves tests from the
packages/zowe-explorer/__tests__/__unit__/misc
folder intoProfiles.unit.test.ts
andZoweDatasetNode.unit.test.ts
where they seem to naturally fitTODO:
Publish new vNext pre-release(will do after types: Add missing return types, see #2952 #3021)Release Notes
Milestone: V3
Changelog: Added support for logging in to multiple API ML instances per team config file
Types of changes
Checklist
General
yarn workspace vscode-extension-for-zowe vscode:prepublish
pnpm --filter vscode-extension-for-zowe vscode:prepublish
Code coverage
Deployment
Further comments
The GIF below shows an example of multiple z/OSMF profiles using API ML on different LPARs in a single team config: