yasithdev opened a new pull request, #187:
URL: https://github.com/apache/airavata-portals/pull/187

   ## Summary
   
   Track D (D4.2): repoint the file **upload / write** data-product views from 
the legacy `airavata_django_portal_sdk` `user_storage` helpers (Thrift) to the 
gRPC `storage` + `research` facades. Follows D4.1 (#186, the read path).
   
   - **`upload_input_file` / `tus_upload_finish`**: a new 
`_storage_upload_and_register` helper uploads the bytes via 
`storage.upload_file` (full `~/`-prefixed path under the input-staging dir 
`tmp`), then registers the data product via `research.register_data_product`, 
returning the registered product adapted to the `DataProductSerializer` shape. 
Replaces `user_storage.save_input_file`.
   - **`DataProductView.put`** (`fileContentText`): overwrite the file in place 
via `storage.upload_file` at the replica's path. Replaces 
`user_storage.update_data_product_content`.
   - **`grpc_requests.data_product_for_upload`** builds the proto 
`DataProductModel` (FILE type, a single GATEWAY_DATA_STORE / TRANSIENT replica, 
mime-type metadata, product size), mirroring the legacy SDK's 
`_create_data_product`.
   
   The REST/JSON contract to the Vue frontend is unchanged — same 
`DataProductSerializer` output. Directory listing/delete in 
`UserStoragePathView` / `ExperimentStoragePathView` and the 
`create_user_storage_dir` signal remain on `user_storage` and migrate in D4.3.
   
   ## Depends on
   
   apache/airavata#651 — makes `register_data_product` / `get_data_product` 
round-trip the data product and its replica (without it, the upload would 
register a product the read path can't return). Please merge #651 first.
   
   ## Validation
   
   - `manage.py check` clean.
   - **Live, end-to-end against the tilt backend (with #651 deployed):** 
uploading through the view helper registers a product **with its replica**; the 
`DataProductSerializer` renders `productUri`, `downloadURL` (to the 
byte-streaming endpoint added in #186), `isInputFileUpload=true` (derived from 
the `tmp` staging dir), `filesize` (matches the uploaded byte count), and 
`userHasWriteAccess`; `DataProductView.put` overwrites the bytes in place 
(download returns the new content).


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to