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(extender): Expose and reuse login and logout methods #2606

Merged
merged 22 commits into from
Jan 16, 2024
Merged

Conversation

zFernand0
Copy link
Member

Proposed changes

Expose the login and logout methods to extenders

Release Notes

Milestone: 2.14.0

Changelog: Exposed the login and logout methods to extenders

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

There is a dependency on the PR below:

Signed-off-by: zFernand0 <37381190+zFernand0@users.noreply.github.com>
 into feat-2493

Signed-off-by: zFernand0 <37381190+zFernand0@users.noreply.github.com>
Signed-off-by: zFernand0 <37381190+zFernand0@users.noreply.github.com>
Copy link

codecov bot commented Dec 12, 2023

Codecov Report

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

Comparison is base (fa19be7) 93.32% compared to head (40c6f13) 93.30%.

Files Patch % Lines
packages/zowe-explorer/src/Profiles.ts 75.00% 5 Missing ⚠️
...owe-explorer-api/src/vscode/ZoweVsCodeExtension.ts 95.08% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2606      +/-   ##
==========================================
- Coverage   93.32%   93.30%   -0.02%     
==========================================
  Files         102      102              
  Lines       10501    10546      +45     
  Branches     2250     2278      +28     
==========================================
+ Hits         9800     9840      +40     
- Misses        700      705       +5     
  Partials        1        1              

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

@zFernand0 zFernand0 marked this pull request as ready for review December 12, 2023 16:11
zFernand0 and others added 7 commits December 13, 2023 15:41
Signed-off-by: zFernand0 <37381190+zFernand0@users.noreply.github.com>
 into feat-2493

Signed-off-by: zFernand0 <37381190+zFernand0@users.noreply.github.com>
Signed-off-by: zFernand0 <37381190+zFernand0@users.noreply.github.com>
Signed-off-by: zFernand0 <37381190+zFernand0@users.noreply.github.com>
Signed-off-by: zFernand0 <37381190+zFernand0@users.noreply.github.com>
Signed-off-by: zFernand0 <37381190+zFernand0@users.noreply.github.com>
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.

Hey @zFernand0, thanks for this new extender functionality. As regression testing with an extender that logs into it own rest api worked fine but when I tried with zosmf / apiml combo I got this error that I don't see with released ZE using same profile
Screen Shot 2023-12-15 at 9 45 51 AM

@JillieBeanSim
Copy link
Contributor

JillieBeanSim commented Jan 4, 2024

further info for recreation steps of getting the error:

have team config with zosmf & base profile similar to below:
"apimlzosmf": {
"type": "zosmf",
"properties": {
"port": 7554,
"basePath": "ibmzosmf/api/v1"
},
"secure": []
},
"base": {
"type": "base",
"properties": {
"host": "host.com",
"rejectUnauthorized": false
},
"secure": []
}

On this branch I get the error above logging in, but works fine using the released ZE from marketplace saving the tokenType & tokenValue to the base profile.

 into feat-2493

Signed-off-by: zFernand0 <37381190+zFernand0@users.noreply.github.com>
@zFernand0
Copy link
Member Author

Hey @zFernand0, thanks for this new extender functionality. As regression testing with an extender that logs into it own rest api worked fine but when I tried with zosmf / apiml combo I got this error that I don't see with released ZE using same profile Screen Shot 2023-12-15 at 9 45 51 AM

This PR will fix the issue 😋

 into feat-2493

Signed-off-by: zFernand0 <37381190+zFernand0@users.noreply.github.com>
@JillieBeanSim
Copy link
Contributor

thanks @zFernand0, can re-request review once pulling in those dep updates.

@zFernand0 zFernand0 linked an issue Jan 11, 2024 that may be closed by this pull request
@zFernand0
Copy link
Member Author

zFernand0 commented Jan 11, 2024

Note:

@zFernand0
Copy link
Member Author

The Lint failures seem unrelated since those were working before updating from main

Signed-off-by: zFernand0 <37381190+zFernand0@users.noreply.github.com>
Signed-off-by: zFernand0 <37381190+zFernand0@users.noreply.github.com>
@zFernand0 zFernand0 added this to the v2.14.0 milestone Jan 11, 2024
@zFernand0 zFernand0 requested a review from traeok January 11, 2024 15:10
@zFernand0 zFernand0 dismissed JillieBeanSim’s stale review January 11, 2024 15:23

Updated CLI version 😋

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.

Logic looks good! Going to test shortly. Thanks @zFernand0!
In the meantime, I think I found the source of the lint stage failure - I added comments for those lines.

packages/zowe-explorer/CHANGELOG.md Outdated Show resolved Hide resolved
packages/zowe-explorer-api/CHANGELOG.md Outdated Show resolved Hide resolved
Signed-off-by: zFernand0 <37381190+zFernand0@users.noreply.github.com>
 into feat-2493

Signed-off-by: zFernand0 <37381190+zFernand0@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.

Looks pretty good, thanks @zFernand0 😺

When testing this PR, I noticed there is text pre-filled in the input boxes for user/password. I think we want to retain the previous behavior of placeholder values that are "grayed out".

Before
image
image

After
image
image
(here I have not entered a password yet, but it is trying to show "Password" which renders as dots)

packages/zowe-explorer-api/src/profiles/ProfilesCache.ts Outdated Show resolved Hide resolved
packages/zowe-explorer/src/Profiles.ts Outdated Show resolved Hide resolved
…pport

Signed-off-by: zFernand0 <37381190+zFernand0@users.noreply.github.com>
 into feat-2493

Signed-off-by: zFernand0 <37381190+zFernand0@users.noreply.github.com>
Signed-off-by: zFernand0 <37381190+zFernand0@users.noreply.github.com>
Signed-off-by: zFernand0 <37381190+zFernand0@users.noreply.github.com>
@zFernand0 zFernand0 requested review from t1m0thyj and traeok January 16, 2024 15:44
Signed-off-by: zFernand0 <37381190+zFernand0@users.noreply.github.com>
@zFernand0 zFernand0 dismissed t1m0thyj’s stale review January 16, 2024 15:59

Unexpected behavior was corrected 😋

@JTonda JTonda requested a review from awharn January 16, 2024 16:14
Signed-off-by: Billie Simmons <49491949+JillieBeanSim@users.noreply.github.com>
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions

7.8% Duplication on New Code (required ≤ 3%)

See analysis details on SonarCloud

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 @zFernand0 for this update

@zFernand0
Copy link
Member Author

LGTM! thanks zFernand0 for this update

Thank you, @JillieBeanSim for updating the package i18n 😋

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.

LGTM! Thanks @zFernand0

@zFernand0
Copy link
Member Author

The code duplication seems to be on new tests added.
Thanks for reviewing! 😋
Merging!

@zFernand0 zFernand0 merged commit d870b3b into main Jan 16, 2024
24 of 25 checks passed
@zFernand0 zFernand0 deleted the feat-2493 branch January 16, 2024 21:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants