Skip to content

Conversation

@wbssbw
Copy link
Collaborator

@wbssbw wbssbw commented Jan 8, 2026

Summary

Implements support for Slack's external file upload workflow, which allows modules to upload files to Slack channels using the files.getUploadURLExternal, file upload, and files.completeUploadExternal APIs. This provides a complete three-step file upload flow: obtaining an upload URL, uploading the file content, and finalizing the upload to share in channels.

Changes

  • STL additions: Added get_file_upload_url, upload_file, and complete_file_upload functions in plaid-stl/src/slack/mod.rs
  • Runtime implementation: Implemented get_file_upload_url, upload_file, and complete_file_upload methods in runtime/plaid/src/apis/slack/api.rs with proper error handling and HTTP client integration

@wbssbw wbssbw requested a review from Copilot January 8, 2026 21:29
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR implements Slack's external file upload workflow, enabling modules to upload files to Slack channels through a three-step process: obtaining an upload URL, uploading file content, and completing the upload.

Key Changes:

  • Added three new STL functions (get_file_upload_url, upload_file, complete_file_upload) to support the complete file upload flow
  • Implemented runtime methods with proper HTTP request handling and error management for each upload step
  • Registered new functions in the runtime's function registry with appropriate test mode restrictions

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
runtime/plaid/src/functions/api.rs Registers the new Slack file upload functions in the runtime's function registry
runtime/plaid/src/apis/slack/api.rs Implements the runtime methods for handling file upload requests with proper HTTP clients and error handling
runtime/plaid-stl/src/slack/mod.rs Defines STL public API functions and data structures for the file upload workflow
Comments suppressed due to low confidence (1)

runtime/plaid/src/apis/slack/api.rs:1

  • The documentation comment for length has inconsistent punctuation compared to other fields. The bot field comment doesn't end with a period, while length and filename do. Consider removing the period from length and filename comments for consistency, or add one to the bot comment.
use std::sync::Arc;

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@wbssbw wbssbw requested review from michelemin and obelisk January 8, 2026 21:31
@wbssbw wbssbw marked this pull request as ready for review January 8, 2026 21:31
Comment on lines +382 to +384
if !p.url.starts_with("https://files.slack.com/upload") {
return Err(ApiError::BadRequest);
}
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't love us passing information to the rule which we then need to re-verify. Should this just be abstracted behind a single API that uploads a file? What would be the use case for rules to do these individually?

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