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(3.0.3): Prompt in editor for 401 error, fix profile propagation #3318

Merged
merged 9 commits into from
Nov 15, 2024

Conversation

traeok
Copy link
Member

@traeok traeok commented Nov 14, 2024

Proposed changes

Port of #3302 for the 3.0.3 release.

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>
Copy link

codecov bot commented Nov 14, 2024

Codecov Report

Attention: Patch coverage is 92.18750% with 5 lines in your changes missing coverage. Please review.

Project coverage is 93.04%. Comparing base (98a4d51) to head (4934d65).
Report is 1 commits behind head on port-fixes-4303.

Files with missing lines Patch % Lines
packages/zowe-explorer/src/utils/AuthUtils.ts 90.62% 3 Missing ⚠️
...we-explorer/src/trees/dataset/DatasetFSProvider.ts 50.00% 2 Missing ⚠️
Additional details and impacted files
@@                 Coverage Diff                 @@
##           port-fixes-4303    #3318      +/-   ##
===================================================
+ Coverage            93.03%   93.04%   +0.01%     
===================================================
  Files                  113      113              
  Lines                11789    11809      +20     
  Branches              2522     2680     +158     
===================================================
+ Hits                 10968    10988      +20     
  Misses                 819      819              
  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>
@traeok traeok added this to the v3.0.3 milestone Nov 14, 2024
@traeok traeok marked this pull request as ready for review November 14, 2024 15:45
Copy link

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

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 thanks for porting these changes. I do see some issues in this branch. In MVS I don't get the pop up and in USS the file is holding outdated info with old credentials. Using same testing scenario shared in original PR

zFernand0
zFernand0 previously approved these changes Nov 14, 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.

I'm not opposed to adding these as part of the 3.0.3 fixes, but I'd like to be respectful for those who've already completed their testing on the 3.0.3 PR 😋

In either case, I'm happy with these changes!

Thanks for porting! 😋


I'm seeing some files needed to be changed by prettier and pnpm --filter vscode-extension-for-zowe vscode:prepublish

modified:   packages/zowe-explorer/__tests__/__unit__/utils/AuthUtils.unit.test.ts
modified:   packages/zowe-explorer/l10n/bundle.l10n.json
modified:   packages/zowe-explorer/l10n/poeditor.json

Hey @traeok thanks for porting these changes. I do see some issues in this branch. In MVS I don't get the pop up and in USS the file is holding outdated info with old credentials. Using same testing scenario shared in original PR

And yeah, I'm also seeing this on MVS (though I didn't in the original PR 😢

@zFernand0 zFernand0 dismissed their stale review November 14, 2024 15:56

Will re-test Billie's scenario. 😋

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

TL;DR: LGTM! 😋

Apologies for going back and forth on having the promptForAuthError in the stat v. the readFile methods.

In MVS I don't get the pop up and in USS the file is holding outdated info with old credentials. Using same testing scenario shared in original PR

As it stand, these changes make the behavior more consistent since I only see the above behavior in somewhat of an edge case. This scenario may have uncovered a long-standing issue that we've had for quite some time and it's just becoming more visible since Zowe Explorer is more reactive thanks to the file system provider implementation.

Here are some steps to reproduce the problem of not getting a pop-up on the MVS tree. These same steps can be used to reproduce the issue in USS.

  1. Open a PDS member (and keep the PDS expanded)
  2. Update credentials (via right-click menu) to a dummy/bad user
  3. Open another member in the same PDS (notice the pop-up) and DO NOT update your creds
  4. Open the same member from step one (notice no pop-up)

Long story short, there may be other areas for improvement related to 401 handling. However, I do believe this PR is an overall improvement on what we have out in the field today 😋

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 @traeok this is working great now ❤️

@JillieBeanSim JillieBeanSim merged commit a1f44ac into port-fixes-4303 Nov 15, 2024
18 of 19 checks passed
@JillieBeanSim JillieBeanSim deleted the fix/3.0.3/prompt-in-editor branch November 15, 2024 18:35
zFernand0 added a commit that referenced this pull request Nov 16, 2024
* DatasetFSprovider fetchDataset() - fix behavior with non-existent datasets and members (#3255)

* Fix PDS members in fetchDataset

Signed-off-by: Benjamin Santos <benjamin.santos@ibm.com>

* Update DatasetFSProvider.unit.test.ts

Signed-off-by: Benjamin Santos <benjamin.santos@ibm.com>

* Update CHANGELOG.md

Signed-off-by: Benjamin Santos <benjamin.santos@ibm.com>

* Merge branch 'main' into datasetfsprovider-remote-lookup-fix

Signed-off-by: Benjamin Santos <benjamin.santos@ibm.com>

* move changelog update

Signed-off-by: Benjamin Santos <benjamin.santos@ibm.com>

* improve logic

Signed-off-by: Benjamin Santos <benjamin.santos@ibm.com>

* add ? after checking dsorg

Signed-off-by: Benjamin Santos <benjamin.santos@ibm.com>

* do not fetch attributes for members

Signed-off-by: Benjamin Santos <benjamin.santos@ibm.com>

---------

Signed-off-by: Benjamin Santos <benjamin.santos@ibm.com>

* fix: use `vscode.workspace.fs` for `delete` and `rename` (#3261)

* fix: use vscode.workspace.fs to rename URIs

Signed-off-by: Trae Yelovich <trae.yelovich@broadcom.com>

* chore: update ZE changelog

Signed-off-by: Trae Yelovich <trae.yelovich@broadcom.com>

* update mocks, remaining use of delete/rename

Signed-off-by: Trae Yelovich <trae.yelovich@broadcom.com>

---------

Signed-off-by: Trae Yelovich <trae.yelovich@broadcom.com>

* Fix: To resolve error message upon switching the authentication methods (#3275)

* To handle missing args in basicAuthClearSecureArray

Signed-off-by: Santhoshi Boyina <Santhoshi.Boyina1@ibm.com>

* To handle missing args in tokenAuthClearSecureArray

Signed-off-by: Santhoshi Boyina <Santhoshi.Boyina1@ibm.com>

* To add unit test case for missing arg's in basicAuthClearSecureArray

Signed-off-by: Santhoshi Boyina <Santhoshi.Boyina1@ibm.com>

* To add unit test case for missing arg's in tokenAuthClearSecureArray

Signed-off-by: Santhoshi Boyina <Santhoshi.Boyina1@ibm.com>

* To run pre-publish command

Signed-off-by: Santhoshi Boyina <Santhoshi.Boyina1@ibm.com>

* To update changelog

Signed-off-by: Santhoshi Boyina <Santhoshi.Boyina1@ibm.com>

* To modify tokenAuthClearSecureArray() function

Signed-off-by: Santhoshi Boyina <Santhoshi.Boyina1@ibm.com>

* To add additional test cases for tokenAuthClearSecureArray()

Signed-off-by: Santhoshi Boyina <Santhoshi.Boyina1@ibm.com>

---------

Signed-off-by: Santhoshi Boyina <Santhoshi.Boyina1@ibm.com>

* fix: "Show Config" button in error dialog does not work during initialization (#3274)

* fix: check if profileInfo is nullish during v1 migration

Signed-off-by: Trae Yelovich <trae.yelovich@broadcom.com>

* chore: update ZE changelog

Signed-off-by: Trae Yelovich <trae.yelovich@broadcom.com>

* tests: integration test for broken config

Signed-off-by: Trae Yelovich <trae.yelovich@broadcom.com>

* add unit test for nullish profileinfo

Signed-off-by: Trae Yelovich <trae.yelovich@broadcom.com>

* fix transient failures in UpdateCredentials scenario

Signed-off-by: Trae Yelovich <trae.yelovich@broadcom.com>

* remove extra join import in wdio conf

Signed-off-by: Trae Yelovich <trae.yelovich@broadcom.com>

* make integration test more reliable

Signed-off-by: Trae Yelovich <trae.yelovich@broadcom.com>

* move getprofileinfo call into try/catch during profiles init

Signed-off-by: Trae Yelovich <trae.yelovich@broadcom.com>

* test: open notification center to check for dialog

Signed-off-by: Trae Yelovich <trae.yelovich@broadcom.com>

* add license header to test; add another null check

Signed-off-by: Trae Yelovich <trae.yelovich@broadcom.com>

* add typedoc to ProfilesUtils.getProfileInfo

Signed-off-by: Trae Yelovich <trae.yelovich@broadcom.com>

* setupDefaultCredentialManager: log err msgs, update typedoc

Signed-off-by: Trae Yelovich <trae.yelovich@broadcom.com>

* test: promptUserWithNoConfigs, nullish profileInfo case

Signed-off-by: Trae Yelovich <trae.yelovich@broadcom.com>

* refactor typedoc for setupDefaultCredentialManager

Signed-off-by: Trae Yelovich <trae.yelovich@broadcom.com>

---------

Signed-off-by: Trae Yelovich <trae.yelovich@broadcom.com>

* fix(ds): Call remoteLookupForResource when entry doesn't exist locally (#3268)

Signed-off-by: Trae Yelovich <trae.yelovich@broadcom.com>
Signed-off-by: Billie Simmons <BillieJean.Simmons@ibm.com>
Co-authored-by: Billie Simmons <BillieJean.Simmons@ibm.com>

* fix: Only show "No configs detected" prompt if ZE opened (#3281)

* fix: show 'No config detected' prompt once when ZE opened

Signed-off-by: Trae Yelovich <trae.yelovich@broadcom.com>

* chore: update ZE changelog

Signed-off-by: Trae Yelovich <trae.yelovich@broadcom.com>

* resolve failing tests

Signed-off-by: Trae Yelovich <trae.yelovich@broadcom.com>

* refactor: move event into static fn, add coverage

Signed-off-by: Trae Yelovich <trae.yelovich@broadcom.com>

* update changelog

Signed-off-by: Trae Yelovich <trae.yelovich@broadcom.com>

* patch coverage for ProfilesUtils.promptUserWithNoConfigs

Signed-off-by: Trae Yelovich <trae.yelovich@broadcom.com>

* move variable definition

Signed-off-by: Trae Yelovich <trae.yelovich@broadcom.com>

---------

Signed-off-by: Trae Yelovich <trae.yelovich@broadcom.com>
Signed-off-by: Billie Simmons <BillieJean.Simmons@ibm.com>
Co-authored-by: Billie Simmons <BillieJean.Simmons@ibm.com>
Signed-off-by: Billie Simmons <49491949+JillieBeanSim@users.noreply.github.com>

* fix(v3): Pass `responseTimeout` in z/OSMF MVS and USS API calls (#3292)

* fix: pass responseTimeout to API functions

Signed-off-by: Trae Yelovich <trae.yelovich@broadcom.com>

* refactor: remove fallback for spreading newOptions

Signed-off-by: Trae Yelovich <trae.yelovich@broadcom.com>

* refactor: use optional chaining; work on resolving tests

Signed-off-by: Trae Yelovich <trae.yelovich@broadcom.com>

* refactor: pass profile props to tests, fix types

Signed-off-by: Trae Yelovich <trae.yelovich@broadcom.com>

* tests: resolve failing cases in ZE

Signed-off-by: Trae Yelovich <trae.yelovich@broadcom.com>

* chore: update changelog entry for ZE API

Signed-off-by: Trae Yelovich <trae.yelovich@broadcom.com>

* refactor: remove fallback for spreading undefined options

Signed-off-by: Trae Yelovich <trae.yelovich@broadcom.com>

* fix: add missing functions to MvsApi test list

Signed-off-by: Trae Yelovich <trae.yelovich@broadcom.com>

---------

Signed-off-by: Trae Yelovich <trae.yelovich@broadcom.com>

* run package

Signed-off-by: Billie Simmons <49491949+JillieBeanSim@users.noreply.github.com>

* chore: remediation commit

Signed-off-by: Fernando Rijo Cedeno <37381190+zFernand0@users.noreply.github.com>

Third-Party DCO Remediation Commit for benjamin-t-santos <115251181+benjamin-t-santos@users.noreply.github.com>

On behalf of benjamin-t-santos <115251181+benjamin-t-santos@users.noreply.github.com>, I, Fernando Rijo Cedeno <37381190+zFernand0@users.noreply.github.com>, hereby add my Signed-off-by to this commit: 8957a64

Signed-off-by: Fernando Rijo Cedeno <37381190+zFernand0@users.noreply.github.com>

Third-Party DCO Remediation Commit for SanthoshiBoyina1 <142206957+SanthoshiBoyina1@users.noreply.github.com>

On behalf of SanthoshiBoyina1 <142206957+SanthoshiBoyina1@users.noreply.github.com>, I, Fernando Rijo Cedeno <37381190+zFernand0@users.noreply.github.com>, hereby add my Signed-off-by to this commit: 86a82f6

Signed-off-by: Fernando Rijo Cedeno <37381190+zFernand0@users.noreply.github.com>

Signed-off-by: Fernando Rijo Cedeno <37381190+zFernand0@users.noreply.github.com>

* DatasetFSProvider.readFile() makes at most one API call (#3279)

* fix(ds): Call remoteLookupForResource when entry doesn't exist locally

Signed-off-by: Trae Yelovich <trae.yelovich@broadcom.com>

* readFile() uses one MVS API call

Signed-off-by: Benjamin Santos <benjamin.santos@ibm.com>

* update unit tests, fix logic of calls

Signed-off-by: Benjamin Santos <benjamin.santos@ibm.com>

* fix lint error

Signed-off-by: Benjamin Santos <benjamin.santos@ibm.com>

* Update CHANGELOG.md

Signed-off-by: Benjamin Santos <benjamin.santos@ibm.com>

---------

Signed-off-by: Trae Yelovich <trae.yelovich@broadcom.com>
Signed-off-by: Benjamin Santos <benjamin.santos@ibm.com>
Signed-off-by: benjamin-t-santos <115251181+benjamin-t-santos@users.noreply.github.com>
Co-authored-by: Trae Yelovich <trae.yelovich@broadcom.com>
Signed-off-by: Billie Simmons <49491949+JillieBeanSim@users.noreply.github.com>

* Change default credentials manager check and not-found dialog (#3297)

* updates to webpack and package.json for dev mode

Signed-off-by: Billie Simmons <49491949+JillieBeanSim@users.noreply.github.com>

* Remove endless startup loop when default CM cannot be loaded

Signed-off-by: Peter Haumer <4391934+phaumer@users.noreply.github.com>

* Initial set of test updates

Signed-off-by: Peter Haumer <4391934+phaumer@users.noreply.github.com>

* Merge branch 'main' into change-credentials-manager-check

Signed-off-by: Peter Haumer <4391934+phaumer@users.noreply.github.com>

* Convenience launch to only run currently open test

Signed-off-by: Peter Haumer <4391934+phaumer@users.noreply.github.com>

* Fixed ProfileUtils tests

Signed-off-by: Peter Haumer <4391934+phaumer@users.noreply.github.com>

* Clean up package files

Signed-off-by: Peter Haumer <4391934+phaumer@users.noreply.github.com>

* Updated changelog

Signed-off-by: Peter Haumer <4391934+phaumer@users.noreply.github.com>

* Reworded info message

Signed-off-by: Peter Haumer <4391934+phaumer@users.noreply.github.com>

* Update CHANGELOG.md

Signed-off-by: Fernando Rijo Cedeno <37381190+zFernand0@users.noreply.github.com>

* Added detail to info message

Signed-off-by: Peter Haumer <4391934+phaumer@users.noreply.github.com>

* Updated resource files

Signed-off-by: Peter Haumer <4391934+phaumer@users.noreply.github.com>

---------

Signed-off-by: Billie Simmons <49491949+JillieBeanSim@users.noreply.github.com>
Signed-off-by: Peter Haumer <4391934+phaumer@users.noreply.github.com>
Signed-off-by: Fernando Rijo Cedeno <37381190+zFernand0@users.noreply.github.com>
Co-authored-by: Billie Simmons <49491949+JillieBeanSim@users.noreply.github.com>
Co-authored-by: Fernando Rijo Cedeno <37381190+zFernand0@users.noreply.github.com>
Signed-off-by: Billie Simmons <49491949+JillieBeanSim@users.noreply.github.com>

* fix(3.0.3): Prompt in editor for 401 error, fix profile propagation (#3318)

* fix: profile change propagation, prompt on auth error

Signed-off-by: Trae Yelovich <trae.yelovich@broadcom.com>

* tests: profile propagation, tree node cases

Signed-off-by: Trae Yelovich <trae.yelovich@broadcom.com>

* chore: changelogs

Signed-off-by: Trae Yelovich <trae.yelovich@broadcom.com>

* test(jobs): add patch coverage

Signed-off-by: Trae Yelovich <trae.yelovich@broadcom.com>

* tests: AuthUtils.promptForAuthError

Signed-off-by: Trae Yelovich <trae.yelovich@broadcom.com>

* tests: UssFSProvider.fetchFileAtUri

Signed-off-by: Trae Yelovich <trae.yelovich@broadcom.com>

* fix: reset wasAccessed flag if ImperativeError caught

Signed-off-by: Trae Yelovich <trae.yelovich@broadcom.com>

* tests: resolve failing USS tests

Signed-off-by: Trae Yelovich <trae.yelovich@broadcom.com>

* fix failing jobs test

Signed-off-by: Trae Yelovich <trae.yelovich@broadcom.com>

---------

Signed-off-by: Trae Yelovich <trae.yelovich@broadcom.com>

* fix(ftp): Generate member name if missing in `putContents` (#3313)

* fix(ftp): Generate member name if missing in putContents

Signed-off-by: Trae Yelovich <trae.yelovich@broadcom.com>

* chore: add entry to FTP changelog

Signed-off-by: Trae Yelovich <trae.yelovich@broadcom.com>

* refactor: remove unused isAbsolutePath import

Signed-off-by: Trae Yelovich <trae.yelovich@broadcom.com>

* chore: undo updates to l10n since no strings were changed

Signed-off-by: Trae Yelovich <trae.yelovich@broadcom.com>

* tests(ftp): PDS upload case, clean up PS upload test

Signed-off-by: Trae Yelovich <trae.yelovich@broadcom.com>

---------

Signed-off-by: Trae Yelovich <trae.yelovich@broadcom.com>
Co-authored-by: Billie Simmons <BillieJean.Simmons@ibm.com>
Co-authored-by: Fernando Rijo Cedeno <37381190+zFernand0@users.noreply.github.com>

* run prepublish

Signed-off-by: Billie Simmons <49491949+JillieBeanSim@users.noreply.github.com>

* Fix infinite loop when fetching USS resources with stat() (#3321)

* remove query when looking up parent

Signed-off-by: Benjamin Santos <benjamin.santos@ibm.com>

* remove leftover comment

Signed-off-by: Benjamin Santos <benjamin.santos@ibm.com>

* Update CHANGELOG.md

Signed-off-by: Benjamin Santos <benjamin.santos@ibm.com>

---------

Signed-off-by: Benjamin Santos <benjamin.santos@ibm.com>
Signed-off-by: Billie Simmons <49491949+JillieBeanSim@users.noreply.github.com>

* run prepublish

Signed-off-by: Billie Simmons <49491949+JillieBeanSim@users.noreply.github.com>

* Fix port of #3321 for 3.0.3 release

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

---------

Signed-off-by: Benjamin Santos <benjamin.santos@ibm.com>
Signed-off-by: Trae Yelovich <trae.yelovich@broadcom.com>
Signed-off-by: Santhoshi Boyina <Santhoshi.Boyina1@ibm.com>
Signed-off-by: Billie Simmons <BillieJean.Simmons@ibm.com>
Signed-off-by: Billie Simmons <49491949+JillieBeanSim@users.noreply.github.com>
Signed-off-by: Fernando Rijo Cedeno <37381190+zFernand0@users.noreply.github.com>
Signed-off-by: benjamin-t-santos <115251181+benjamin-t-santos@users.noreply.github.com>
Signed-off-by: Peter Haumer <4391934+phaumer@users.noreply.github.com>
Signed-off-by: Timothy Johnson <timothy.johnson@broadcom.com>
Co-authored-by: benjamin-t-santos <115251181+benjamin-t-santos@users.noreply.github.com>
Co-authored-by: Trae Yelovich <trae.yelovich@broadcom.com>
Co-authored-by: SanthoshiBoyina1 <142206957+SanthoshiBoyina1@users.noreply.github.com>
Co-authored-by: Fernando Rijo Cedeno <37381190+zFernand0@users.noreply.github.com>
Co-authored-by: Peter Haumer <4391934+phaumer@users.noreply.github.com>
Co-authored-by: Timothy Johnson <timothy.johnson@broadcom.com>
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.

3 participants