Skip to content

SOF-8099: upload every file through a signed putObject URL - #408

Merged
k0stik merged 3 commits into
mainfrom
chore/SOF-8099-1
Nov 4, 2026
Merged

k0stik merged 3 commits into
mainfrom
chore/SOF-8099-1

Conversation

@k0stik

@k0stik k0stik commented Nov 3, 2026 •

Copy link
Copy Markdown
Member

Jira: SOF-8099
Platform change: mat3ra/web-app#3026. Merge and release this PR together with it.
Uses client.files from mat3ra/api-client#51, released as mat3ra-api-client 2026.11.4.post0.

Why

The platform no longer accepts file bodies: public POST files is removed, and every file goes straight to storage with a signed URL. The notebooks uploaded text through POST files, so they would break.

What changes

  • Notebooks (custom_python_calculation.ipynb, custom_shell_calculation.ipynb): upload with one call to the API client, client.files.upload(files_to_upload, account_id=ACCOUNT_ID). Files are read as bytes and passed on as they are; the markdown no longer says text "travels inside the request".
  • notebooks_utils/core/entity/file/api.py: keeps only to_object_storage_input. The upload itself (one files/signed-urls putObject request with each file's size and content type, then a PUT per file with the signed headers) now lives in mat3ra-api-client as FileEndpoints.upload, with its tests.

Dependency

pyproject.toml and config.yml (api, api_examples) require mat3ra-api-client>=2026.11.4.post0.

Testing

  • pytest tests/py/unit: 143 passed with the client from api-client#51 (the earlier JobEndpoints.auth failure was an outdated client).
  • client.files against a local web-app (S3): text and binary upload, download round-trip, folder delete.
  • The JupyterLite path: in a browser worker with this repo's Pyodide 0.24.1 and pyodide-http, a binary requests.put to a signed S3 URL with the signed headers returns 200 and the object reads back byte for byte.
  • Not run end to end yet: the web-app Cypress features api-examples/custom_python_calculation and custom_shell_calculation cover the notebooks.

🤖 Generated with Claude Code

The platform no longer accepts file bodies (public POST files is removed), so
upload_files asks files/signed-urls for one putObject URL per file, with the
size and content type to enforce, and PUTs the bytes with the returned
headers. Text is uploaded as UTF-8; the notebooks pass file bytes as they are.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@review-notebook-app

Copy link
Copy Markdown

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@coderabbitai

coderabbitai Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

Important

  • Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 333c5ebb-ac0a-401e-ba1b-c00c27043a08
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Tip

🎯 Customize your risk assessments

Guide how CodeRabbit assesses merge risk and security architecture risk. Highlight sensitive changes and explain your security boundaries using Merge Risk Instructions and Security Risk Instructions in your review settings. Security architecture risk assessments require the Advanced plan or above.

✅ Automatic approvals, with your rules

Let CodeRabbit approve pull requests once required threads are resolved, pre-merge checks pass, and your risk limits are met. Enable Automatic approvals in review settings, with overrides for teams or file paths.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

The sign-and-PUT steps move to mat3ra-api-client (FileEndpoints, mat3ra/api-client#51), so
the custom calculation notebooks call client.files.upload and notebooks_utils keeps only
to_object_storage_input. Until that PR is released, pyproject.toml pins its commit and
config.yml installs a wheel built from it (packages/); both go back to a released version
before merging.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Replaces the git pin and the bundled test wheel with the release that ships
client.files.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@k0stik
k0stik merged commit 531be32 into main Nov 4, 2026
8 checks passed
@k0stik
k0stik deleted the chore/SOF-8099-1 branch November 4, 2026 13:28
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.

2 participants