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 issue where --load inPlace and --force can sometimes remove file unexpectedly #4086

Merged
merged 3 commits into from
Nov 25, 2023

Conversation

cmdcolin
Copy link
Collaborator

There is code that will forcibly remove the file at the destination before doing the copy/move/symlink

This is due to a older bug #2768

Unfortunately it has a weird side effect where --load inPlace and --force in combination, if the file path is a valid one (inPlace does not always require valid file paths), it will then remove that file

this is bad behavior, and so this PR fixes it to not forcibly remove the file when load inPlace is used. It could probably additionally narrow it beyond this to only remove when load symlink is used, as copy and move may not be affected by the need to fs.unlink as #2768 brought up

@github-actions github-actions bot added the needs label triage Needs a label to show in changelog (breaking, enhancement, bug, documentation, or internal) label Nov 25, 2023
@cmdcolin cmdcolin added bug Something isn't working and removed needs label triage Needs a label to show in changelog (breaking, enhancement, bug, documentation, or internal) labels Nov 25, 2023
Copy link

codecov bot commented Nov 25, 2023

Codecov Report

Attention: 11 lines in your changes are missing coverage. Please review.

Comparison is base (7a2f214) 63.31% compared to head (6c799b7) 63.23%.

Files Patch % Lines
plugins/wiggle/src/drawXY.ts 0.00% 4 Missing ⚠️
packages/core/PluginLoader.ts 0.00% 2 Missing ⚠️
products/jbrowse-cli/src/commands/add-track.ts 90.47% 2 Missing ⚠️
packages/core/util/simpleFeature.ts 50.00% 1 Missing ⚠️
...otplot-view/src/DotplotRenderer/DotplotRenderer.ts 50.00% 1 Missing ⚠️
...c/LinearGenomeView/components/OverviewScalebar.tsx 50.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4086      +/-   ##
==========================================
- Coverage   63.31%   63.23%   -0.08%     
==========================================
  Files        1045     1045              
  Lines       30614    30616       +2     
  Branches     7311     7314       +3     
==========================================
- Hits        19384    19361      -23     
- Misses      11057    11085      +28     
+ Partials      173      170       -3     

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

@cmdcolin cmdcolin force-pushed the fix_load_inplace_force branch from e25b3b1 to 6c799b7 Compare November 25, 2023 15:27
@cmdcolin cmdcolin merged commit f4d921e into main Nov 25, 2023
11 checks passed
@cmdcolin cmdcolin deleted the fix_load_inplace_force branch November 25, 2023 17:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant