`download_file` shouldn't be destructive
Nobody has claimed this yet.
- Dominant language
- Ruby
- Stars
- 558
- Forks
- 224
- Avg merge
- 1h 4m
- Merged PRs (30d)
- 1
Description
Describe the Bug
The built-in download_file function is destructive and will remove existing files of the destination directory. This is a problem when trying to download multiple files from a target that would result in calling download_file twice.
This might not be considered a bug, but it is definitely undesirable behavior from my point of view.
Expected Behavior
Stop removing files. Overwrite behavior is probably fine, but I can imagine situations where that wouldn't be desirable. Perhaps this could be a config option.
Steps to Reproduce
Steps to reproduce the behavior:
From a single plan perform the following actions:
- Call
download_file('/src/foo.txt', 'foo.txt', $target) - Call
download_file('/src/bar.txt', 'bar.txt', $target) - Inspect
downloads/<target>to see that foo.txt has been deleted.
Environment
- Version 3.26.1
- Platform Ubuntu 20.04
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the built-in download_file entry point and reproduce the two-call sequence described in the issue against a target download directory. Confirm that downloading bar.txt no longer removes foo.txt, and add or update coverage for this behavior if the relevant test location is found.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- ruby
- Domain
- devops
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100