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(fs): realpathSync.native sometimes fails on Windows #2224

Merged
merged 3 commits into from
Apr 11, 2023

Conversation

traeok
Copy link
Member

@traeok traeok commented Apr 5, 2023

Proposed changes

Sometimes fs.realpathSync.native will throw an error on Windows. Previously, we were defaulting to this method for Windows systems, but were not catching any exceptions from this function within getFullPath.

This proposes a fallback to fs.realpathSync when fs.realpathSync.native throws an error. Thanks @t1m0thyj for finding where realpath was referenced and for the helpful discussion 🙂

Inspired by this issue, from a repo that proposed the addition of this implementation into Node.js.

Release Notes

Milestone: 2.8.0

Changelog:

  • Resolved an issue where Windows users encountered errors, specifically while Zowe Explorer is building the path for a project directory. (This should help with this issue)

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)

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)

@github-advanced-security
Copy link

You have successfully added a new SonarCloud configuration ``. As part of the setup process, we have scanned this repository and found no existing alerts. In the future, you will see all code scanning alerts on the repository Security tab.

@codecov
Copy link

codecov bot commented Apr 5, 2023

Codecov Report

Patch coverage: 100.00% and no project coverage change.

Comparison is base (7d01d79) 91.46% compared to head (4ff53fc) 91.46%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2224   +/-   ##
=======================================
  Coverage   91.46%   91.46%           
=======================================
  Files          89       89           
  Lines        8856     8857    +1     
  Branches     1828     1828           
=======================================
+ Hits         8100     8101    +1     
  Misses        755      755           
  Partials        1        1           
Impacted Files Coverage Δ
...es/zowe-explorer-api/src/profiles/ProfilesCache.ts 99.56% <100.00%> (+<0.01%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@traeok traeok changed the title fix(fs): realpath.native sometimes fails on Windows fix(fs): realpathSync.native sometimes fails on Windows Apr 5, 2023
t1m0thyj
t1m0thyj previously approved these changes Apr 5, 2023
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.

LGTM and this should help us to support RAM disks on Windows, thanks @traeok!

@t1m0thyj
Copy link
Member

t1m0thyj commented Apr 5, 2023

Do we want to add a line to the ZE changelog for this fix?

@t1m0thyj t1m0thyj added this to the v2.8.0 milestone Apr 5, 2023
Signed-off-by: Trae Yelovich <[email protected]>
@sonarcloud
Copy link

sonarcloud bot commented Apr 11, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

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.

User confirmed that this fixes their issue.
LGTM! 😋

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants