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 401 error when opening PDS members after cred change #3157

Merged
merged 34 commits into from
Oct 8, 2024

Conversation

t1m0thyj
Copy link
Member

@t1m0thyj t1m0thyj commented Sep 26, 2024

Proposed changes

ZE:

  • Fixed an issue where a 401 error could occur when opening PDS members after updating credentials. #3150
    • Also fixes issue where invalid credentials trigger double "Update Credentials" prompt in new session
    • Also fixes issue where expanding job node to show spool doesn't trigger "Update Credentials" prompt

ZE API:

  • Updated the ZoweTreeNode.setProfileToChoice function so that it propagates profile changes to its child nodes. #3150

Release Notes

Milestone: v3 GA (or v3.1 if needed)

Changelog: See Proposed changes

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • Enhancement (non-breaking change which adds or improves functionality)
  • Breaking change (a change that would cause existing functionality to not work as expected)
  • Documentation (Markdown, README updates)
  • Other (please specify above in "Proposed changes" section)

Checklist

General

  • I have read the CONTRIBUTOR GUIDANCE wiki
  • All PR dependencies have been merged and published (if applicable)
  • A GIF or screenshot is included in the PR for visual changes
  • The pre-publish command has been executed:
    • v2 and below: yarn workspace vscode-extension-for-zowe vscode:prepublish
    • v3: pnpm --filter vscode-extension-for-zowe vscode:prepublish

Code coverage

  • There is coverage for the code that I have added
  • I have added new test cases and they are passing
  • I have manually tested the changes

Deployment

  • I have added developer documentation (if applicable)
  • Documentation should be added to Zowe Docs
    • If you're an outside contributor, please post in the #zowe-doc Slack channel to coordinate documentation.
    • Otherwise, please check with the rest of the squad about any needed documentation before merging.
  • These changes may need ported to the appropriate branches (list here):

Signed-off-by: Timothy Johnson <timothy.johnson@broadcom.com>
Signed-off-by: Timothy Johnson <timothy.johnson@broadcom.com>
t1m0thyj and others added 4 commits September 27, 2024 08:12
Signed-off-by: Timothy Johnson <timothy.johnson@broadcom.com>
Signed-off-by: Timothy Johnson <timothy.johnson@broadcom.com>
Signed-off-by: Trae Yelovich <trae.yelovich@broadcom.com>
Copy link

codecov bot commented Sep 27, 2024

Codecov Report

Attention: Patch coverage is 94.31280% with 12 lines in your changes missing coverage. Please review.

Project coverage is 92.97%. Comparing base (e53dad0) to head (6809327).
Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
packages/zowe-explorer/src/trees/job/JobTree.ts 91.89% 3 Missing ⚠️
...ackages/zowe-explorer/src/trees/uss/ZoweUSSNode.ts 86.36% 2 Missing and 1 partial ⚠️
...ges/zowe-explorer/src/trees/dataset/DatasetTree.ts 88.88% 2 Missing ⚠️
...ckages/zowe-explorer/src/configuration/Profiles.ts 80.00% 1 Missing ⚠️
...zowe-explorer/src/trees/dataset/ZoweDatasetNode.ts 97.14% 1 Missing ⚠️
...kages/zowe-explorer/src/trees/shared/SharedInit.ts 95.65% 1 Missing ⚠️
packages/zowe-explorer/src/utils/AuthUtils.ts 93.33% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3157      +/-   ##
==========================================
+ Coverage   92.81%   92.97%   +0.16%     
==========================================
  Files         113      113              
  Lines       11661    11661              
  Branches     2500     2502       +2     
==========================================
+ Hits        10823    10842      +19     
+ Misses        836      817      -19     
  Partials        2        2              

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

Signed-off-by: Trae Yelovich <trae.yelovich@broadcom.com>
@pull-request-size pull-request-size bot added size/L and removed size/S labels Sep 27, 2024
Signed-off-by: Trae Yelovich <trae.yelovich@broadcom.com>
@traeok traeok self-assigned this Sep 27, 2024
@traeok traeok marked this pull request as ready for review September 27, 2024 16:07
Copy link

github-actions bot commented Sep 27, 2024

📅 Suggested merge-by date: 10/15/2024

zFernand0
zFernand0 previously approved these changes Sep 30, 2024
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.

LGTM! 😋

Copy link
Member

Choose a reason for hiding this comment

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

If other applications are running into this problem, they could use this technique as an example.
At least until the enhancement below is implemented:

Thanks @t1m0thyj 🥳

Signed-off-by: Billie Simmons <49491949+JillieBeanSim@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.

when testing update credentials I got pop errors and still see the issue with 401 in text editor
Screenshot 2024-09-30 at 10 25 07 AM

Signed-off-by: Timothy Johnson <timothy.johnson@broadcom.com>
Signed-off-by: Timothy Johnson <timothy.johnson@broadcom.com>
Copy link

sonarcloud bot commented Oct 7, 2024

Quality Gate Failed Quality Gate failed

Failed conditions
11.8% Duplication on New Code (required ≤ 3%)

See analysis details on SonarCloud

zFernand0
zFernand0 previously approved these changes Oct 7, 2024
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.

LGTM! 😋
left some small comments, but nothing urgent 😅

/**
* Use Dataset-specific tree node for children.
*/
children?: IZoweDatasetTreeNode[];
Copy link
Member

Choose a reason for hiding this comment

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

should we deprecate getChildren() of do we still need an async approach to get them? 😋

Same for USS

Copy link
Member Author

Choose a reason for hiding this comment

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

I believe we still need an async approach to fetch items from the mainframe when we want to update the tree 😋

packages/zowe-explorer/src/trees/shared/SharedInit.ts Outdated Show resolved Hide resolved
@JillieBeanSim
Copy link
Contributor

I am now getting stuck in a loop not able to update credentials when 401 detected, seeing the same with zosmf profiles.

Screen.Recording.2024-10-07.at.4.43.28.PM.mov

search was inplace, I made credentials invalid with right-click update creds options and see this when going to expand data set. expected to be prompted for valid creds but wasn't.

Signed-off-by: Timothy Johnson <timothy.johnson@broadcom.com>
Copy link
Member Author

@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.

Thanks @JillieBeanSim and @traeok for testing this PR! I believe both issues should be fixed now - the Update Credentials loop and children not refreshing.

Signed-off-by: Timothy Johnson <timothy.johnson@broadcom.com>
Signed-off-by: Timothy Johnson <timothy.johnson@broadcom.com>
Signed-off-by: Timothy Johnson <timothy.johnson@broadcom.com>
@t1m0thyj t1m0thyj force-pushed the fix/update-credentials-desync2 branch from 74b97fa to ad07311 Compare October 8, 2024 11:08
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.

Thanks for fixing previous issue with the prompt but I'm sorry to say that I am back to the original issue of the error in the text file 😢

Screen.Recording.2024-10-08.at.9.50.00.AM.mov

Signed-off-by: Timothy Johnson <timothy.johnson@broadcom.com>
@t1m0thyj
Copy link
Member Author

t1m0thyj commented Oct 8, 2024

Thanks for fixing previous issue with the prompt but I'm sorry to say that I am back to the original issue of the error in the text file 😢

This behavior happens in V3 because opening files in the editor is handled by the FileSystemProvider, so we'll have to add some logic to the FSP to handle 401 errors if we want it show pop ups instead. I've created a separate issue to track this: #3197

Since this PR fixes the original issue #3150 where credentials failed to update on member nodes, I'd like to get it included with v3.0.1 if possible 😋

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.

thanks @t1m0thyj for the fix

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.

LGTM! 😋
Thanks for addressing the feedback 😅

@zFernand0 zFernand0 merged commit 37a5102 into main Oct 8, 2024
23 checks passed
@zFernand0 zFernand0 deleted the fix/update-credentials-desync2 branch October 8, 2024 17:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Closed
Development

Successfully merging this pull request may close these issues.

401 error when opening PDS members after cred change, nested profiles
5 participants