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

Feature/sda download #392

Merged
merged 38 commits into from
Jun 24, 2024
Merged

Feature/sda download #392

merged 38 commits into from
Jun 24, 2024

Conversation

kostas-kou
Copy link
Contributor

Related issue(s) and PR(s)
This PR closes #372.

Description
A new feature in the sda-cli is implemented to download files from the download service endpoint by giving the dataset stable_id and the inbox path of the file without the uploader's user id

How to test
By testing that just run the setup script from the root folder: bash .github/integration/setup/setup.sh
and when it is done one can download the file by running: ./sda-cli sda-download -config testing/s3cmd-download.conf -dataset https://doi.example/ty009.sfrrss/600.45asasga -url http://localhost:8080 -outdir test-download main/subfolder/dummy_data.c4gh
Then check if the file test-download/main/subfolder/dummy_data exists and if the result by running head test-download/main/subfolder/dummy_data is "THIS FILE IS JUST DUMMY DATA"

@kostas-kou kostas-kou marked this pull request as draft May 30, 2024 11:57
@codecov-commenter
Copy link

codecov-commenter commented May 30, 2024

Codecov Report

Attention: Patch coverage is 61.87050% with 53 lines in your changes missing coverage. Please review.

Project coverage is 42.25%. Comparing base (433b631) to head (5b32b8f).
Report is 12 commits behind head on main.

Files Patch % Lines
sda_download/sda_download.go 62.77% 39 Missing and 12 partials ⚠️
main.go 0.00% 2 Missing ⚠️

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

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #392      +/-   ##
==========================================
+ Coverage   40.48%   42.25%   +1.77%     
==========================================
  Files          11       12       +1     
  Lines        1539     1678     +139     
==========================================
+ Hits          623      709      +86     
- Misses        837      878      +41     
- Partials       79       91      +12     
Flag Coverage Δ
unittests 42.25% <61.87%> (+1.77%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

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

@kostas-kou kostas-kou marked this pull request as ready for review May 30, 2024 12:21
Copy link
Contributor

@jbygdell jbygdell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • The app should only have one download entry
  • The static tests mixes error catching and assertions.
  • There is a lot of excess whitespace in the form on empty lines directly after function and variable declarations.

sda_download/sda_download.go Outdated Show resolved Hide resolved
sda_download/sda_download.go Outdated Show resolved Hide resolved
sda_download/sda_download.go Outdated Show resolved Hide resolved
main.go Show resolved Hide resolved
sda_download/sda_download.go Outdated Show resolved Hide resolved
sda_download/sda_download.go Outdated Show resolved Hide resolved
sda_download/sda_download.go Outdated Show resolved Hide resolved
sda_download/sda_download.go Outdated Show resolved Hide resolved
sda_download/sda_download.go Outdated Show resolved Hide resolved
@kostas-kou kostas-kou requested a review from jbygdell May 31, 2024 13:25
- the cli now checks the format of the first part
of the filepath and if it is a userid like does not include it
- add a userid in the filepath in integration setup
sda_download/sda_download.go Outdated Show resolved Hide resolved
sda_download/sda_download_test.go Show resolved Hide resolved
sda_download/sda_download.go Outdated Show resolved Hide resolved
sda_download/sda_download.go Outdated Show resolved Hide resolved
sda_download/sda_download.go Outdated Show resolved Hide resolved
sda_download/sda_download.go Outdated Show resolved Hide resolved
sda_download/sda_download.go Outdated Show resolved Hide resolved
sda_download/sda_download.go Show resolved Hide resolved
sda_download/sda_download.go Outdated Show resolved Hide resolved
sda_download/sda_download.go Show resolved Hide resolved
kostas-kou and others added 2 commits June 3, 2024 14:56
Co-authored-by: Joakim Bygdell <joakim.bygdell@nbis.se>
@kostas-kou kostas-kou requested a review from jbygdell June 3, 2024 13:59
@kostas-kou kostas-kou requested a review from jbygdell June 4, 2024 09:19
MalinAhlberg
MalinAhlberg previously approved these changes Jun 11, 2024
Copy link
Member

@MalinAhlberg MalinAhlberg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! And very nice that you provided an easy-to-run test setup!

README.md Outdated Show resolved Hide resolved
jbygdell
jbygdell previously approved these changes Jun 14, 2024
@kostas-kou kostas-kou dismissed stale reviews from jbygdell and MalinAhlberg via dd6b3cc June 14, 2024 12:47
Co-authored-by: Malin Klang <ahlberg.malin@gmail.com>
Copy link
Contributor

@aaperis aaperis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks great! Some minor comments regarding documentation :-)

README.md Outdated Show resolved Hide resolved
sda_download/sda_download.go Outdated Show resolved Hide resolved
sda_download/sda_download.go Outdated Show resolved Hide resolved
sda_download/sda_download.go Outdated Show resolved Hide resolved
sda_download/sda_download.go Outdated Show resolved Hide resolved
.github/integration/tests/tests.sh Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
Copy link
Contributor

@nanjiangshu nanjiangshu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It works very well when I tested. A general feeling is that the naming of sub commands download and sda-download does not clearly distinguish methods for downloading.
I don't have any good suggestions neither. Maybe

s3-download:  by downloading from a S3 bucket
api-download: by using the download API

kostas-kou and others added 3 commits June 17, 2024 16:43
Co-authored-by: Alex Aperis <76202622+aaperis@users.noreply.github.com>
Update the download environment variables for
working with the latest image
@kostas-kou kostas-kou added this pull request to the merge queue Jun 24, 2024
Merged via the queue into main with commit 360b5d8 Jun 24, 2024
6 checks passed
@kostas-kou kostas-kou deleted the feature/sda-download branch June 24, 2024 09:24
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.

Use sda-download's api to get files
7 participants