Skip to content

Conversation

@jocarino
Copy link
Contributor

@jocarino jocarino commented Jun 30, 2025

WHY

Atm there's no option to the the downloaded file directly, only from the pipeline tmp folder -> only works with workflows.
I've added the possibility to download the raw response from google drive directly, and turned the temp file path optional, if raw response is true

Summary by CodeRabbit

  • New Features

    • Added an option to return downloaded Google Drive file content directly in the response, without saving to a file path.
    • The file path is now optional when requesting the raw file content.
  • Chores

    • Updated the action and package versions.

@vercel
Copy link

vercel bot commented Jun 30, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
pipedream-docs-redirect-do-not-edit ⬜️ Ignored (Inspect) Jul 3, 2025 2:53pm

@adolfo-pd adolfo-pd added the User submitted Submitted by a user label Jun 30, 2025
@vercel
Copy link

vercel bot commented Jun 30, 2025

@jocarino is attempting to deploy a commit to the Pipedreamers Team on Vercel.

A member of the Team first needs to authorize it.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jun 30, 2025

Walkthrough

The Google Drive "download file" action was updated to support an optional getBufferResponse boolean property, allowing users to receive file content directly as a buffer instead of saving it to disk. The filePath property was made optional, and internal logic was adjusted to validate and handle both response types. The package version was incremented.

Changes

File(s) Change Summary
components/google_drive/actions/download-file/download-file.mjs Added optional getBufferResponse prop, made filePath optional, updated run method to handle buffer or file output
components/google_drive/package.json Incremented package version from 1.0.1 to 1.0.2

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant DownloadAction
    participant GoogleDriveAPI
    participant FileSystem

    User->>DownloadAction: Trigger download-file action (with/without getBufferResponse)
    DownloadAction->>GoogleDriveAPI: Request file content stream
    GoogleDriveAPI-->>DownloadAction: Return file content stream
    alt getBufferResponse is true
        DownloadAction->>DownloadAction: Read stream fully into buffer
        DownloadAction-->>User: Return buffer and metadata with summary
    else getBufferResponse is false or unset
        DownloadAction->>FileSystem: Write stream to filePath (default /tmp/)
        FileSystem-->>DownloadAction: Confirm file write
        DownloadAction-->>User: Return filePath and metadata with summary
    end
Loading

Poem

A bunny hopped through Drive today,
With options new along the way—
Buffer bytes or files to keep,
Downloading’s now a leap!
Version bumped, the code is neat,
Fetch your files with nimble feet!
🐇📂✨

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

components/google_drive/actions/download-file/download-file.mjs

Oops! Something went wrong! :(

ESLint: 8.57.1

Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'jsonc-eslint-parser' imported from /eslint.config.mjs
at Object.getPackageJSONURL (node:internal/modules/package_json_reader:255:9)
at packageResolve (node:internal/modules/esm/resolve:767:81)
at moduleResolve (node:internal/modules/esm/resolve:853:18)
at defaultResolve (node:internal/modules/esm/resolve:983:11)
at ModuleLoader.defaultResolve (node:internal/modules/esm/loader:801:12)
at #cachedDefaultResolve (node:internal/modules/esm/loader:725:25)
at ModuleLoader.resolve (node:internal/modules/esm/loader:708:38)
at ModuleLoader.getModuleJobForImport (node:internal/modules/esm/loader:309:38)
at #link (node:internal/modules/esm/module_job:202:49)


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 05d29c5 and 0303c22.

📒 Files selected for processing (1)
  • components/google_drive/actions/download-file/download-file.mjs (4 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • components/google_drive/actions/download-file/download-file.mjs
⏰ Context from checks skipped due to timeout of 90000ms (4)
  • GitHub Check: Lint Code Base
  • GitHub Check: Publish TypeScript components
  • GitHub Check: Verify TypeScript components
  • GitHub Check: pnpm publish
✨ Finishing Touches
  • 📝 Generate Docstrings

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@pipedream-component-development
Copy link
Collaborator

Thank you so much for submitting this! We've added it to our backlog to review, and our team has been notified.

@pipedream-component-development
Copy link
Collaborator

Thanks for submitting this PR! When we review PRs, we follow the Pipedream component guidelines. If you're not familiar, here's a quick checklist:

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (2)
components/google_drive/actions/download-file/download-file.mjs (2)

128-135: LGTM! Clean raw response implementation.

The raw response logic correctly returns file content and metadata directly when enabled. The implementation is clean and follows the component's patterns.

Consider documenting potential memory usage implications for large files when using raw response mode.


128-135: LGTM: Clean implementation of raw response functionality.

The logic correctly handles the raw response case with appropriate summary messaging. Consider documenting potential memory implications for large files when using this option.

Consider adding a note in the getRawResponse description about potential memory usage for large files:

-      description: "Whether to return the file content directly in the response instead of writing to a file path",
+      description: "Whether to return the file content directly in the response instead of writing to a file path. Note: Large files may consume significant memory.",
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 43f5a2f and 77b2e13.

📒 Files selected for processing (2)
  • components/google_drive/actions/download-file/download-file.mjs (4 hunks)
  • components/google_drive/package.json (1 hunks)
🧰 Additional context used
🧠 Learnings (1)
components/google_drive/package.json (1)
Learnt from: jcortes
PR: PipedreamHQ/pipedream#14935
File: components/sailpoint/package.json:15-18
Timestamp: 2024-12-12T19:23:09.039Z
Learning: When developing Pipedream components, do not add built-in Node.js modules like `fs` to `package.json` dependencies, as they are native modules provided by the Node.js runtime.
⏰ Context from checks skipped due to timeout of 90000ms (3)
  • GitHub Check: Lint Code Base
  • GitHub Check: Verify TypeScript components
  • GitHub Check: Publish TypeScript components
🔇 Additional comments (12)
components/google_drive/package.json (2)

3-3: LGTM! Appropriate version increment.

The patch version bump from 1.0.1 to 1.0.2 correctly follows semantic versioning for the new raw response functionality.


3-3: LGTM: Appropriate version bump for new functionality.

The patch version increment correctly reflects the addition of the new getRawResponse feature in the download-file action.

components/google_drive/actions/download-file/download-file.mjs (10)

21-21: LGTM! Appropriate version increment.

The version increment from 0.1.10 to 0.1.11 is consistent with the package-level version bump and reflects the new functionality.


50-50: LGTM! Appropriate property modification.

Making filePath optional is correct since it's not required when using the raw response feature.


92-97: LGTM! Well-defined new property.

The new getRawResponse property is clearly documented and follows the component's property definition pattern.


100-104: LGTM! Proper validation logic.

The validation correctly ensures filePath is provided when not using raw response, with a clear error message.


143-147: LGTM! Maintains backward compatibility.

The return structure preserves the existing behavior for file path mode while supporting the new raw response functionality.


21-21: LGTM: Version increment follows standard practice.

The minor version bump correctly reflects the new functionality being added.


50-50: LGTM: Making filePath optional aligns with new raw response functionality.

This change properly supports the new use case where files can be returned as raw content without requiring a file path.


92-97: LGTM: Well-defined getRawResponse property.

The new boolean property is properly structured with clear label and description that explains its purpose.


100-104: LGTM: Excellent validation logic maintaining backwards compatibility.

The validation correctly ensures that existing implementations continue to work while enabling the new raw response functionality. The error message is clear and helpful.


143-146: LGTM: Return statement maintains consistency and backwards compatibility.

The modified return structure preserves the existing API contract while cleanly separating the two execution paths.

Copy link
Collaborator

@jcortes jcortes left a comment

Choose a reason for hiding this comment

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

Hi @jocarino lgtm! Ready for QA!

@jcortes jcortes moved this from Ready for PR Review to Ready for QA in Component (Source and Action) Backlog Jun 30, 2025
@vunguyenhung vunguyenhung moved this from Ready for QA to In QA in Component (Source and Action) Backlog Jul 1, 2025
@vunguyenhung
Copy link
Collaborator

vunguyenhung commented Jul 1, 2025

Hi @jocarino, could you share what is your usecase to use the raw file content?

In Pipedream step, the output is serialized into JSON object, which is not suitable for file content (which is usually binary). This is why we used the tmp dir to store the file to be used for subsequence steps.

@vunguyenhung vunguyenhung moved this from In QA to Changes Required in Component (Source and Action) Backlog Jul 1, 2025
@vunguyenhung
Copy link
Collaborator

Hello everyone, I have tested this PR and there're some test cases failed or needed improvement.

Please check the test report below for more information
https://vunguyenhung.notion.site/Components-google_drive-Add-raw-file-response-possibility-222bf548bb5e81198ce0eaa8e6c97a00

@jocarino
Copy link
Contributor Author

jocarino commented Jul 1, 2025

Hi @jcortes and @vunguyenhung
That was a good point, I've changed it so it returns as a buffer. It's more flexible and works well in the workflow

@jocarino jocarino requested a review from jcortes July 1, 2025 14:08
Copy link
Collaborator

@jcortes jcortes left a comment

Choose a reason for hiding this comment

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

Please change the version of the component! Thanks!

@jocarino
Copy link
Contributor Author

jocarino commented Jul 3, 2025

@jcortes @vunguyenhung let me know if you need anything else from me?

@vunguyenhung vunguyenhung moved this from Changes Required to Ready for PR Review in Component (Source and Action) Backlog Jul 3, 2025
@vunguyenhung
Copy link
Collaborator

vunguyenhung commented Jul 3, 2025

Thanks @jocarino, I've moved the PR to the next phase. In the mean time, could you please resolve the code conflict?

@jocarino
Copy link
Contributor Author

jocarino commented Jul 3, 2025

just noticed it, fixing it

@michelle0927 michelle0927 moved this from Ready for PR Review to In Review in Component (Source and Action) Backlog Jul 3, 2025
Copy link
Collaborator

@michelle0927 michelle0927 left a comment

Choose a reason for hiding this comment

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

LGTM! Ready for QA!

@michelle0927 michelle0927 moved this from In Review to Ready for QA in Component (Source and Action) Backlog Jul 3, 2025
@vunguyenhung vunguyenhung moved this from Ready for QA to In QA in Component (Source and Action) Backlog Jul 4, 2025
@vunguyenhung vunguyenhung moved this from In QA to Ready for Release in Component (Source and Action) Backlog Jul 4, 2025
@vunguyenhung
Copy link
Collaborator

Hi everyone, all test cases are passed! Ready for release!

Test report
https://vunguyenhung.notion.site/Components-google_drive-Add-raw-file-response-possibility-222bf548bb5e81198ce0eaa8e6c97a00

@vunguyenhung
Copy link
Collaborator

Merge this on behalf of the user.

@vunguyenhung vunguyenhung merged commit 0d3a4ae into PipedreamHQ:master Jul 4, 2025
9 of 10 checks passed
@github-project-automation github-project-automation bot moved this from Ready for Release to Done in Component (Source and Action) Backlog Jul 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

User submitted Submitted by a user

Development

Successfully merging this pull request may close these issues.

7 participants