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: Prompt for credentials when 401 in editor, fix profile propagation #3302

Merged
merged 32 commits into from
Nov 14, 2024

Conversation

traeok
Copy link
Member

@traeok traeok commented Nov 7, 2024

Proposed changes

Fixes #3197, #3289

How to test

  • Checkout this branch in the repo with VS Code opened
  • pnpm install && pnpm build
  • After the build has finished, click on the Run & Debug panel on the VS Code Side Bar
  • Select "Run VS Code Extension" from the tasks list at the top and select the Play ▶ button
  • Once opened, make sure that you have (or set) valid credentials on a profile in ZE
  • Execute a search on that profile and expand a folder so that a file/PDS member/spool item is visible
  • Before opening the file, right click on your profile -> "Manage Profile" -> "Update Credentials"
  • Enter in invalid credentials. I recommend using a fake username to prevent lockouts
  • Once finished, try to open the file. Notice the error in the editor appears but you are prompted to update your credentials.
  • Enter in the valid credentials
  • Once done, click "Try again" in the editor to fetch & open the file

Release Notes

Milestone: 3.0.3?

Changelog:

  • Fixed issue where users were not prompted to enter credentials if a 401 error was encountered when opening files, data sets or spools in the editor. #3197
  • Fixed issue where profile credential updates or token changes were not reflected within the filesystem. #3289

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: Trae Yelovich <trae.yelovich@broadcom.com>
Signed-off-by: Trae Yelovich <trae.yelovich@broadcom.com>
Signed-off-by: Trae Yelovich <trae.yelovich@broadcom.com>
Signed-off-by: Trae Yelovich <trae.yelovich@broadcom.com>
Signed-off-by: Trae Yelovich <trae.yelovich@broadcom.com>
Signed-off-by: Trae Yelovich <trae.yelovich@broadcom.com>
Signed-off-by: Trae Yelovich <trae.yelovich@broadcom.com>
Signed-off-by: Trae Yelovich <trae.yelovich@broadcom.com>
Signed-off-by: Trae Yelovich <trae.yelovich@broadcom.com>
Signed-off-by: Trae Yelovich <trae.yelovich@broadcom.com>
Signed-off-by: Trae Yelovich <trae.yelovich@broadcom.com>
Copy link

codecov bot commented Nov 7, 2024

Codecov Report

Attention: Patch coverage is 91.20879% with 8 lines in your changes missing coverage. Please review.

Project coverage is 92.98%. Comparing base (6784053) to head (01b749e).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
...ckages/zowe-explorer/src/configuration/Profiles.ts 60.00% 4 Missing ⚠️
...ckages/zowe-explorer/src/trees/ZoweTreeProvider.ts 90.47% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3302      +/-   ##
==========================================
+ Coverage   92.97%   92.98%   +0.01%     
==========================================
  Files         116      116              
  Lines       12020    12051      +31     
  Branches     2639     2751     +112     
==========================================
+ Hits        11175    11206      +31     
  Misses        843      843              
  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>
Signed-off-by: Trae Yelovich <trae.yelovich@broadcom.com>
Signed-off-by: Trae Yelovich <trae.yelovich@broadcom.com>
Signed-off-by: Trae Yelovich <trae.yelovich@broadcom.com>
Signed-off-by: Trae Yelovich <trae.yelovich@broadcom.com>
@traeok traeok changed the title fix: Prompt for credentials when 401 in editor fix: Prompt for credentials when 401 in editor, fix profile propagation Nov 8, 2024
Signed-off-by: Trae Yelovich <trae.yelovich@broadcom.com>
Signed-off-by: Trae Yelovich <trae.yelovich@broadcom.com>
Signed-off-by: Trae Yelovich <trae.yelovich@broadcom.com>
@traeok traeok marked this pull request as ready for review November 11, 2024 16:50
Copy link

github-actions bot commented Nov 11, 2024

📅 Suggested merge-by date: 11/27/2024

anaxceron
anaxceron previously approved these changes Nov 12, 2024
@traeok
Copy link
Member Author

traeok commented Nov 12, 2024

Need to resolve some failing tests after changing UX behavior, will mark as ready soon

@traeok traeok marked this pull request as draft November 12, 2024 16:06
Signed-off-by: Trae Yelovich <trae.yelovich@broadcom.com>
Signed-off-by: Trae Yelovich <trae.yelovich@broadcom.com>
Signed-off-by: Trae Yelovich <trae.yelovich@broadcom.com>
Signed-off-by: Trae Yelovich <trae.yelovich@broadcom.com>
Signed-off-by: Trae Yelovich <trae.yelovich@broadcom.com>
Signed-off-by: Trae Yelovich <trae.yelovich@broadcom.com>
Signed-off-by: Trae Yelovich <trae.yelovich@broadcom.com>
Signed-off-by: Trae Yelovich <trae.yelovich@broadcom.com>
Signed-off-by: Trae Yelovich <trae.yelovich@broadcom.com>
@traeok traeok marked this pull request as ready for review November 13, 2024 13:29
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 @traeok, I'm not sure what changed but not seeing the pop up like before when clicking file after incorrect creds initiated just the error in file editor.

@traeok
Copy link
Member Author

traeok commented Nov 13, 2024

Hey @traeok, I'm not sure what changed but not seeing the pop up like before when clicking file after incorrect creds initiated just the error in file editor.

Hi @JillieBeanSim, thanks for quickly re-reviewing - if possible, can you provide steps to reproduce this scenario? When testing the steps in the PR, I can't reproduce this with data sets, USS or jobs.

@JillieBeanSim
Copy link
Contributor

JillieBeanSim commented Nov 13, 2024

Hey @traeok, I'm not sure what changed but not seeing the pop up like before when clicking file after incorrect creds initiated just the error in file editor.

Hi @JillieBeanSim, thanks for quickly re-reviewing - if possible, can you provide steps to reproduce this scenario? When testing the steps in the PR, I can't reproduce this with data sets, USS or jobs.

Hey @traeok

  1. did filter search MVS with successful creds and expand a data set with members
  2. right click profile, prof management, update creds to ones expected to fail
  3. click on data set member in expanded tree
  4. see error in text editor but no pop up since changes pushed

this scenario worked when I previously approved

@traeok
Copy link
Member Author

traeok commented Nov 13, 2024

  1. did filter search MVS with successful creds and expand a data set with members
  2. right click profile, prof management, update creds to ones expected to fail
  3. click on data set member in expanded tree
  4. see error in text editor but no pop up since changes pushed

this scenario worked when I previously approved

Hmm... I'll have to do some more testing locally. If I follow these same steps, the prompt appears on my machine. Maybe its an OS-specific issue? Other reviewers might be able to confirm this behavior, but the source of the issue is unclear since I can't reproduce with the same steps 😓

The error will still appear in the text editor until the user clicks "Try again", but the pop up for updating credentials should appear as soon as the error appears in the editor.

@JillieBeanSim
Copy link
Contributor

  1. did filter search MVS with successful creds and expand a data set with members
  2. right click profile, prof management, update creds to ones expected to fail
  3. click on data set member in expanded tree
  4. see error in text editor but no pop up since changes pushed

this scenario worked when I previously approved

Hmm... I'll have to do some more testing locally. If I follow these same steps, the prompt appears on my machine. Maybe its an OS-specific issue? Other reviewers might be able to confirm this behavior, but the source of the issue is unclear since I can't reproduce with the same steps 😓

The error will still appear in the text editor until the user clicks "Try again", but the pop up for updating credentials should appear as soon as the error appears in the editor.

yes it worked that way when I tested and approved previously but not getting the pop up after pulling the latest.

Signed-off-by: Trae Yelovich <trae.yelovich@broadcom.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.

thanks for addressing my comments, all works great now! Thanks @traeok

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 the detailed testing instructions 🙏
This PR makes recovery much more straightforward 🙏

I guess I kind of expected a "credentials successfully updated" message after entering my valid creds, but clicking "Try again" worked just fine 😋

Copy link
Member

Choose a reason for hiding this comment

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

Thanks for refactoring and reducing some duplication 🙏

@zFernand0 zFernand0 merged commit 16963db into main Nov 14, 2024
25 checks passed
@zFernand0 zFernand0 deleted the fix/prompt-in-editor branch November 14, 2024 13:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Closed
4 participants