-
Notifications
You must be signed in to change notification settings - Fork 94
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
refactor: Lock profiles during async operations (phase 1: filesystem) #3370
Open
traeok
wants to merge
30
commits into
main
Choose a base branch
from
refactor/lock-profiles-in-fs
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+815
−125
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Signed-off-by: Trae Yelovich <[email protected]>
Signed-off-by: Trae Yelovich <[email protected]>
Signed-off-by: Trae Yelovich <[email protected]>
- note: may need to throttle amount of times the reload is called, if you have a workspace with hundreds of folders it will make a list request for each one Signed-off-by: Trae Yelovich <[email protected]>
Signed-off-by: Trae Yelovich <[email protected]>
Signed-off-by: Trae Yelovich <[email protected]>
Signed-off-by: Trae Yelovich <[email protected]>
Signed-off-by: Trae Yelovich <[email protected]>
- Adds a new `Mutex` class that wraps around a `DeferredPromise`. See the `@brief` for details. - Refactors the `AuthHandler` class to use a map of `Mutex` for each profile used in critical sections. - Added doc: `AuthHandler, DeferredPromise, Mutex` Signed-off-by: Trae Yelovich <[email protected]>
Signed-off-by: Trae Yelovich <[email protected]>
Signed-off-by: Trae Yelovich <[email protected]>
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3370 +/- ##
==========================================
- Coverage 93.17% 93.17% -0.01%
==========================================
Files 117 119 +2
Lines 12277 12374 +97
Branches 2822 2835 +13
==========================================
+ Hits 11439 11529 +90
- Misses 837 844 +7
Partials 1 1 ☔ View full report in Codecov by Sentry. |
packages/zowe-explorer/__tests__/__unit__/utils/ProfilesUtils.unit.test.ts
Fixed
Show fixed
Hide fixed
packages/zowe-explorer/__tests__/__unit__/utils/ProfilesUtils.unit.test.ts
Fixed
Show fixed
Hide fixed
packages/zowe-explorer/__tests__/__unit__/utils/ProfilesUtils.unit.test.ts
Fixed
Show fixed
Hide fixed
packages/zowe-explorer/__tests__/__unit__/utils/ProfilesUtils.unit.test.ts
Fixed
Show fixed
Hide fixed
Signed-off-by: Trae Yelovich <[email protected]>
- removed `no-return-await` lint rule since the extra microtask was removed in recent versions of Node, so there is now a benefit to using `return await` - add test `zowe.config.json` to prettierignore to avoid invalid JSON errors Signed-off-by: Trae Yelovich <[email protected]>
Signed-off-by: Trae Yelovich <[email protected]>
Signed-off-by: Trae Yelovich <[email protected]>
Signed-off-by: Trae Yelovich <[email protected]>
Signed-off-by: Trae Yelovich <[email protected]>
traeok
changed the title
Refactor/lock profiles in fs
refactor: Lock profiles during async operations (phase 1: filesystem)
Dec 23, 2024
Signed-off-by: Trae Yelovich <[email protected]>
Signed-off-by: Trae Yelovich <[email protected]>
Signed-off-by: Trae Yelovich <[email protected]>
Signed-off-by: Trae Yelovich <[email protected]>
Signed-off-by: Trae Yelovich <[email protected]>
Signed-off-by: Trae Yelovich <[email protected]>
Signed-off-by: Trae Yelovich <[email protected]>
Signed-off-by: Trae Yelovich <[email protected]>
Signed-off-by: Trae Yelovich <[email protected]>
Signed-off-by: Trae Yelovich <[email protected]>
Signed-off-by: Trae Yelovich <[email protected]>
Signed-off-by: Trae Yelovich <[email protected]>
📅 Suggested merge-by date: 1/7/2025 |
Signed-off-by: Trae Yelovich <[email protected]>
traeok
force-pushed
the
refactor/lock-profiles-in-fs
branch
from
December 24, 2024 16:44
a9798da
to
3dc39b1
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Proposed changes
This PR is the "first phase" of resolving the issues with authentication prompts and APIs as described in #3329.
It avoids race conditions during filesystem access by leveraging a new lock mechanism for profiles. This is exposed in Zowe Explorer API so that extenders can also leverage the locking mechanism until its rolled out to all core APIs.
I decided to separate the logic into two phases to avoid a large PR and complicated review process:
How to test
As an alternative to step 3, you can select "Cancel" - then go to the Zowe Explorer tab and update the credentials from the tree. Once updated, the profile is unlocked and you can refresh the workspace as outlined in step 4.
Release Notes
Milestone: 3.1.0
Changelogs:
AuthHandler
class with functions for locking/unlocking profiles, prompting for credentials and SSO login support. Extenders can now lock profiles after an authentication error, ensuring that an invalid profile is not used asynchronously until the error is resolved.Types of changes
AuthHandler
class provides authentication prompts to extenders as well as the lock mechanismChecklist
General
yarn workspace vscode-extension-for-zowe vscode:prepublish
pnpm --filter vscode-extension-for-zowe vscode:prepublish
Code coverage
Deployment