Skip to content

feat(cloud): upload workflow code through cloud storage API#938

Merged
khaliqgant merged 1 commit into
mainfrom
codex/r2-workflow-storage-cli
May 21, 2026
Merged

feat(cloud): upload workflow code through cloud storage API#938
khaliqgant merged 1 commit into
mainfrom
codex/r2-workflow-storage-cli

Conversation

@khaliqgant
Copy link
Copy Markdown
Member

Summary

  • Extend workflow prepare response handling for backend: cloud-api workflow storage.
  • Upload code tarballs through the Cloud API run-scoped object route instead of direct S3 when Cloud returns cloud-api storage.
  • Keep the existing direct S3 upload behavior for legacy/S3-backed prepare responses.

Tests

  • PASS: npm --prefix packages/cloud run build
  • PASS: npm --prefix packages/cloud test -- workflows.test.ts

Notes

@khaliqgant khaliqgant requested a review from willwashburn as a code owner May 21, 2026 17:46
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 21, 2026

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 326128cb-df92-426b-ae0e-625ed588cdd2

📥 Commits

Reviewing files that changed from the base of the PR and between cb8cfc0 and 983b475.

📒 Files selected for processing (2)
  • packages/cloud/src/workflows.test.ts
  • packages/cloud/src/workflows.ts

📝 Walkthrough

Walkthrough

The PR extends workflow run logic to support cloud-api as a code storage backend alongside S3. Types are updated to include optional backend metadata, a new uploadCodeObject helper conditionally routes uploads to either cloud-api or S3, all upload call sites are refactored to use the helper, and test coverage verifies the cloud-api upload path.

Changes

Cloud-API Workflow Storage Backend Support

Layer / File(s) Summary
Type definitions and validation
packages/cloud/src/workflows.ts
S3Credentials and PrepareWorkflowResponse extended with optional backend and cloudApiUrl/cloudApiAccessToken fields. Validation and helper functions added to detect cloud-api storage backend and compute storage object paths.
Upload logic abstraction and call site updates
packages/cloud/src/workflows.ts
New uploadCodeObject helper routes tarballs to either the cloud-api workflow storage endpoint via authenticated API calls or to S3 via lazily-initialized client. Multi-path and single-tarball upload paths refactored to use the helper.
Cloud-API storage path test case
packages/cloud/src/workflows.test.ts
New test verifies code-upload flow when /prepare returns cloud-api backend. Mocks authenticated PUT to run storage endpoint, asserts gzip content-type and binary body, confirms S3 upload is skipped.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Suggested reviewers

  • willwashburn

Poem

🐰 A rabbit hops through clouds today,
Where storage paths now find their way—
Cloud-API joins with S3 dance,
Upload abstractions grant a chance!
Two backends blend in harmony,
Code flows with tested certainty. ✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the primary change: adding support for uploading workflow code through the cloud storage API instead of just S3.
Description check ✅ Passed The description covers the summary section with clear objectives and includes a test plan section, though it uses 'Tests' instead of the template's checkbox format.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/r2-workflow-storage-cli

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

Comment @coderabbitai help to get the list of available commands and usage tips.

@khaliqgant khaliqgant merged commit 9812d38 into main May 21, 2026
41 checks passed
@khaliqgant khaliqgant deleted the codex/r2-workflow-storage-cli branch May 21, 2026 17:58
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.

1 participant