broadinstitute / single_cell_portal

Tutorials, workflows, and convenience scripts for Single Cell Portal
https://singlecell.broadinstitute.org/single_cell
BSD 3-Clause "New" or "Revised" License
48 stars 25 forks source link

Prevent file overwrite by manage-study (SCP-2698) #109

Closed jlchang closed 4 years ago

jlchang commented 4 years ago

Currently manage-study uploads files before performing ingest without checking if a file of the same name already exists in the study bucket. manage-study should not overwrite existing, valid study files.

With this update, manage-study handles file upload more appropriately with the follow behaviors:

  1. checks that no file with the upload file name exists in the google bucket
  2. checks that file paths for upload from google buckets are vaild
  3. removes file copied for upload if upload request is refused (422 status code)
  4. if upload request for file pre-existing in study bucket, does not perform cleanup (#3 above)
  5. handles 422 server response appropriately (either 3 or 4 above)

This fulfills SCP-2698.

codecov[bot] commented 4 years ago

Codecov Report

Merging #109 into master will increase coverage by 0.65%. The diff coverage is 44.82%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #109      +/-   ##
==========================================
+ Coverage   22.36%   23.01%   +0.65%     
==========================================
  Files          17       17              
  Lines        2835     2876      +41     
==========================================
+ Hits          634      662      +28     
- Misses       2201     2214      +13     
Impacted Files Coverage Δ
scripts/manage_study.py 22.00% <ø> (ø)
scripts/Commandline.py 21.62% <7.69%> (-1.24%) :arrow_down:
scripts/scp_api.py 49.65% <55.55%> (+2.14%) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update f1a3e1e...59b1b69. Read the comment docs.