CenterForOpenScience / waterbutler

WaterButler is a Python web application for interacting with various file storage services via a single RESTful API, developed at Center for Open Science.
Apache License 2.0
62 stars 76 forks source link

[ENG-330] [OATHPIT] Throw figshare into the Oath Pit #391

Closed cslzchen closed 4 years ago

cslzchen commented 4 years ago

Ticket

https://openscience.atlassian.net/browse/ENG-330

Purpose

Enable and update the figshare provider for aiohttp3.

Changes

aiohttp 0.18 -> 3

The figshare provider directly calls aiohttp.request() in aiohttp 0.18 for some downloads, which no longer works with aiohttp-3.5. Instead, use the updated super().make_request(). However, this only partially fix the download issue.

Authorization Header

To fully fix the download issue, the figshare auth header are dropped for published / public files.

Broken Celery Task (Existing Issue on staging)

Move / copy fails for the figshare provider since the __new__() in the FigshareProvider class does not accept extra arguments such as is_celery_task which was recently added for celery tasks. The fix is simply adding the missing **kwargs. Here is the related commit: add flag to BaseProvider to mark if it's running in celery.

Download Stream Size (Existing Issue on staging)

Fixed missing stream size when copy / move private files for figshare.

Side effects

Fixed move / copy which is broken on both staging and prod.

QA Notes

About figshare and WB-figshare

Dev Tests

As usual, no comments indicates a PASS. Please test both figshare as root and dataset as root when eligible.

Extra Notes for QA Testing

At the time of writing the QA notes, prod OSF does not have the figshare article type fix while staging1 and staging2 has just been fixed. In short:

Deployment Notes

No

coveralls commented 4 years ago

Coverage Status

Coverage increased (+6.8%) to 76.117% when pulling 4f38829c8250937709bcfd0215acd2b88f5e245d on cslzchen:feature/oathpit-figshare into be3b81f989cdb44de0b213635bd9073351297cf5 on CenterForOpenScience:feature/oathpit.