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/list dataset show more info #443

Merged
merged 4 commits into from
Sep 2, 2024

Conversation

MalinAhlberg
Copy link
Member

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

Description

  • sda-cli list --dataset X will print the file ID, file size (in human or machine readable form) and file path of each file in dataset X. Also the dataset size will be printed.
  • flag --bytes is added, defaulting to false. If true, file sizes are printed in byte format.

How to test
From the root folder run the setup script:

bash .github/integration/setup/setup.sh

(note to future self: if it does not work, remove all containers and run docker volume rm -f $(docker volume ls -f "dangling=true")).
Then run:

./sda-cli list -config testing/s3cmd-download.conf -dataset https://doi.example/ty009.sfrrss/600.45asasga -url http://localhost:8080 

And get

FileID               	 Size       	 Path
urn:neic:001-001 	 1.0 MB 	 5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8_elixir-europe.org/main/subfolder/dummy_data.c4gh
urn:neic:001-002 	 1.0 MB 	 5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8_elixir-europe.org/main/subfolder2/dummy_data2.c4gh
urn:neic:001-003 	 1.0 MB 	 5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8_elixir-europe.org/main/subfolder2/random/dummy_data3.c4gh
Dataset size: 3.1 MB

@MalinAhlberg MalinAhlberg requested a review from a team August 29, 2024 09:44
list/list.go 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.

Looks good! Just a minor comment about the usage of single dash - or double dash -- in the usage description.

@codecov-commenter
Copy link

codecov-commenter commented Aug 30, 2024

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

Codecov Report

Attention: Patch coverage is 0% with 11 lines in your changes missing coverage. Please review.

Project coverage is 39.04%. Comparing base (214bd0d) to head (d1a2b85).
Report is 270 commits behind head on main.

Files with missing lines Patch % Lines
list/list.go 0.00% 11 Missing ⚠️

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

Additional details and impacted files
@@             Coverage Diff             @@
##             main     #443       +/-   ##
===========================================
- Coverage   52.66%   39.04%   -13.62%     
===========================================
  Files           9       11        +2     
  Lines        1183     1903      +720     
===========================================
+ Hits          623      743      +120     
- Misses        481     1048      +567     
- Partials       79      112       +33     
Flag Coverage Δ
unittests 39.04% <0.00%> (-13.62%) ⬇️

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.

@MalinAhlberg
Copy link
Member Author

Looks good! Just a minor comment about the usage of single dash - or double dash -- in the usage description.

Thanks @nanjiangshu ! Fixed by d1a2b85, please resolve when happy.

@MalinAhlberg MalinAhlberg added this pull request to the merge queue Sep 2, 2024
Merged via the queue into main with commit d24ea15 Sep 2, 2024
6 checks passed
@MalinAhlberg MalinAhlberg deleted the feature/list-dataset-show-more-info branch September 2, 2024 07:43
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.

[list] returns filepaths and dataset size of a dataset
4 participants