NBISweden / sda-cli

User command line interface for the SDA
GNU Affero General Public License v3.0
5 stars 1 forks source link

Feature/recursive download #413

Closed kostas-kou closed 4 months ago

kostas-kou commented 4 months ago

Related issue(s) and PR(s)
This PR closes #401. closes #409.

Description With this PR an enhancement has been implemented in the sda-download where the user can download recursively by providing one or multiple folder paths. A bug is also fixed for downloading files: before is the user was giving an incomplete file path, e.g: main/folder/dummy_fi instead of main/folder/dummy_filethen the file would be downloaded in the path which was given as incomplete. This PR is fixing this bug and the tool gives an error for incomplete paths.

How to test Run the setup.sh script from the root of the repo: bash .github/integration/setup/setup.sh Then run the following command for recursive download: ./sda-cli sda-download -config testing/s3cmd-download.conf -dataset-id https://doi.example/ty009.sfrrss/600.45asasga -url http://localhost:8080 -outdir download-folder --recursive main/subfolder2 for testing the bug fix run: ./sda-cli sda-download -config testing/s3cmd-download.conf -dataset-id https://doi.example/ty009.sfrrss/600.45asasga -url http://localhost:8080 -outdir test-download main/subfolder/dummy_ That should give an error.

codecov-commenter commented 4 months ago

:warning: Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

Attention: Patch coverage is 10.34483% with 52 lines in your changes missing coverage. Please review.

Project coverage is 42.23%. Comparing base (655a4e7) to head (67538db).

Files Patch % Lines
sda_download/sda_download.go 10.52% 50 Missing and 1 partial :warning:
helpers/helpers.go 0.00% 1 Missing :warning:

:exclamation: Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #413 +/- ## ========================================== - Coverage 43.16% 42.23% -0.93% ========================================== Files 13 13 Lines 1923 1977 +54 ========================================== + Hits 830 835 +5 - Misses 979 1028 +49 Partials 114 114 ``` | [Flag](https://app.codecov.io/gh/NBISweden/sda-cli/pull/413/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=NBISweden) | Coverage Δ | | |---|---|---| | [unittests](https://app.codecov.io/gh/NBISweden/sda-cli/pull/413/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=NBISweden) | `42.23% <10.34%> (-0.93%)` | :arrow_down: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=NBISweden#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.