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

Update credential management flow #2492

Merged
merged 28 commits into from
Oct 26, 2023
Merged

Conversation

rudyflores
Copy link
Contributor

@rudyflores rudyflores commented Oct 3, 2023

Proposed changes

Solves #2381

This is a restructure of our existing ProfilesUtils.ts static class, it will now cover the following cases we meant to address when integrating custom credential managers, this were cases such as:

Having .vsix of credential manager installed and imperative.json override not updated will now prompt the user to either change or stick to default @zowe/cli in their override setting

Screenshot 2023-10-03 at 2 42 05 PM

Having imperative.json override updated (Installed plugin from the CLI) and.vsix not installed will now prompt to install .vsix if missing

Screenshot 2023-10-03 at 2 40 25 PM

NOTE

This applies for any custom credential manager that is registered with imperative, not only the secrets for kubernetes plugin.

Release Notes

Milestone: v2.12.0

Changelog: Added better way of handling credential management by installing/changing missing VSIX or override setting on imperative.json.

Types of changes

What types of changes does your code introduce to Zowe Explorer?
Put an x in the boxes that apply

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Updates to Documentation or Tests (if none of the other choices apply)

Checklist

Put an x in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This checklist will be used as reference for both the contributor and the reviewer

  • I have read the CONTRIBUTOR GUIDANCE wiki
  • PR title follows Conventional Commits Guidelines
  • PR Description is included
  • gif or screenshot is included if visual changes are made
  • yarn workspace vscode-extension-for-zowe vscode:prepublish has been executed
  • All checks have passed (DCO, Jenkins and Code Coverage)
  • I have added unit test and it is passing
  • I have added integration test and it is passing
  • There is coverage for the code that I have added
  • I have tested it manually and there are no regressions found
  • I have added necessary documentation (if appropriate)
  • Any PR dependencies have been merged and published (if appropriate)

Further comments

Signed-off-by: Rudy Flores <[email protected]>
Signed-off-by: Rudy Flores <[email protected]>
@rudyflores rudyflores added this to the v2.12.0 milestone Oct 3, 2023
@rudyflores rudyflores self-assigned this Oct 3, 2023
Signed-off-by: Rudy Flores <[email protected]>
@codecov
Copy link

codecov bot commented Oct 3, 2023

Codecov Report

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

Files Coverage Δ
packages/zowe-explorer/src/extension.ts 100.00% <100.00%> (ø)
packages/zowe-explorer/src/globals.ts 97.24% <100.00%> (-1.37%) ⬇️
packages/zowe-explorer/src/shared/init.ts 94.73% <40.00%> (-1.96%) ⬇️
packages/zowe-explorer/src/utils/ProfilesUtils.ts 91.96% <96.51%> (+0.47%) ⬆️

📢 Thoughts on this report? Let us know!.

Signed-off-by: Rudy Flores <[email protected]>
@rudyflores rudyflores marked this pull request as ready for review October 3, 2023 20:57
Copy link
Contributor

@JillieBeanSim JillieBeanSim left a comment

Choose a reason for hiding this comment

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

I have a quick question about this work and it's location. Should this work and these checks be in the ZE API package making it reusable for us as well as extenders? I ask this because when thinking of extenders like the CICS extension, they may need to make considerations like this if handling profiles. Right now they possibly call the ProfilesCache.getProfileInfo() that makes call to credential manager which is different than what we have here.

@rudyflores
Copy link
Contributor Author

I have a quick question about this work and it's location. Should this work and these checks be in the ZE API package making it reusable for us as well as extenders? I ask this because when thinking of extenders like the CICS extension, they may need to make considerations like this if handling profiles. Right now they possibly call the ProfilesCache.getProfileInfo() that makes call to credential manager which is different than what we have here.

That's a fair point, I wouldn't be opposed to doing this change, the only thing we should confirm is the reason for having these function in ProfileUtils.ts to begin with, @zFernand0 @t1m0thyj any idea why we made this code in that location vs having it as code in the API originally?

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.

That's a fair point, I wouldn't be opposed to doing this change, the only thing we should confirm is the reason for having these function in ProfileUtils.ts to begin with, zFernand0 t1m0thyj any idea why we made this code in that location vs having it as code in the API originally?

I believe the reason for having this logic separated out into its own class with public static methods was that we possibly thought this could make our lives easier when maintaining this functionality (and also for making it available to extenders)

packages/zowe-explorer/src/utils/ProfilesUtils.ts Outdated Show resolved Hide resolved
Copy link
Contributor

@JillieBeanSim JillieBeanSim left a comment

Choose a reason for hiding this comment

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

see comment

packages/zowe-explorer/src/utils/ProfilesUtils.ts Outdated Show resolved Hide resolved
@JillieBeanSim
Copy link
Contributor

@rudyflores can you check the failing Theia tests please, it seems to fail consistently

rudyflores and others added 9 commits October 25, 2023 11:54
Signed-off-by: Billie Simmons <[email protected]>
Signed-off-by: Billie Simmons <[email protected]>
Signed-off-by: Rudy Flores <[email protected]>
Signed-off-by: Rudy Flores <[email protected]>
Remove extra call and register before for theia = false
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 did some testing and was able to reproduce both dialogs. Dialog options work as expected. Thanks @rudyflores!

I noticed one minor issue with the localized strings - looks like vscode-nls interpreted new lines from a couple of the strings and added it to the text. Other than that, LGTM

image

Signed-off-by: Rudy Flores <[email protected]>
@rudyflores rudyflores requested a review from traeok October 26, 2023 19:17
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.

Good catch by Trae on the strings, I honestly didn't notice that.

  • One slightly annoying thing is that you have to close/re-open (or > Developer: Reload Window) after selecting the Use Default button 😋
    • It's possible that the above behavior is because I'm in a remote ssh env 😋

traeok
traeok previously approved these changes Oct 26, 2023
Signed-off-by: Rudy Flores <[email protected]>
@rudyflores rudyflores dismissed stale reviews from zFernand0 and traeok via 30dceaa October 26, 2023 19:45
zFernand0
zFernand0 previously approved these changes Oct 26, 2023
Signed-off-by: Rudy Flores <[email protected]>
@sonarqubecloud
Copy link

SonarCloud Quality Gate failed.    Quality Gate failed

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

No Coverage information No Coverage information
8.8% 8.8% Duplication

idea Catch issues before they fail your Quality Gate with our IDE extension sonarlint SonarLint

Copy link
Contributor

@JillieBeanSim JillieBeanSim left a comment

Choose a reason for hiding this comment

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

LGTM! thanks @rudyflores

@JillieBeanSim JillieBeanSim merged commit 16f70e4 into main Oct 26, 2023
23 of 24 checks passed
@JillieBeanSim JillieBeanSim deleted the update-credential-management branch October 26, 2023 20:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants