Skip to content

Conversation

@andrewjschuang
Copy link
Contributor

@andrewjschuang andrewjschuang commented Sep 24, 2025

WHY

Summary by CodeRabbit

  • New Features

    • Zoho WorkDrive “New File in Folder” and “New Folder” now support a typed Folder ID as an alternative to selecting a folder.
    • Folder selection is more flexible: use either a selected Folder ID or a typed Folder ID, with clear validation if neither is provided.
  • Chores

    • Version bumps for the Zoho WorkDrive component and related sources to reflect the new capabilities.

@vercel
Copy link

vercel bot commented Sep 24, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

2 Skipped Deployments
Project Deployment Preview Comments Updated (UTC)
pipedream-docs Ignored Ignored Sep 24, 2025 8:36pm
pipedream-docs-redirect-do-not-edit Ignored Ignored Sep 24, 2025 8:36pm

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Sep 24, 2025

Walkthrough

Version bumps across Zoho WorkDrive component and two sources. Both sources add an optional typedFolderId prop, make folderId optional, introduce runtime validation requiring at least one folder identifier, import ConfigurationError, and update logic to use folderId || typedFolderId when fetching/paginating.

Changes

Cohort / File(s) Summary
Component versioning
components/zoho_workdrive/package.json
Bumped package version 0.2.5 → 0.2.6.
New File in Folder source: props, validation, logic
components/zoho_workdrive/sources/new-file-in-folder/new-file-in-folder.mjs
Version 0.1.0 → 0.2.0; import ConfigurationError; add optional typedFolderId prop; make folderId optional and update description; validate that at least one of folderId or typedFolderId is provided; use `folderId
New Folder source: props, validation, logic
components/zoho_workdrive/sources/new-folder/new-folder.mjs
Version 0.0.4 → 0.1.0; import ConfigurationError; add optional typedFolderId prop; make folderId optional; validate presence of one of the two IDs; use `folderId

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor User as User
  participant Src as Source (startEvent)
  participant ZWD as Zoho WorkDrive API

  User->>Src: Configure props (folderId?, typedFolderId?)
  Src->>Src: Validate: require folderId OR typedFolderId
  alt Missing both
    Src-->>User: Throw ConfigurationError
  else Provided
    Src->>ZWD: paginate(folderId || typedFolderId)
    ZWD-->>Src: Files/Folders page(s)
    Src-->>User: Emit events
  end
  note over Src: Applied in both new-file-in-folder and new-folder sources
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

I twitch my ears at version chimes,
Two paths to folders, none to mimes—
If neither ID hops in sight,
ConfigurationError takes flight.
Now I bound through lists with glee,
folderId or typed—works for me! 🐇✨

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Description Check ⚠️ Warning The pull request description contains only the template heading without any explanation of why the change is needed or what problem it solves, leaving the required “WHY” section unfilled and providing no context for reviewers. Please fill in the “## WHY” section with a clear explanation of the motivation and benefits of adding the optional folder id property, and ensure any additional context or sections required by the repository template are completed.
✅ Passed checks (2 passed)
Check name Status Explanation
Title Check ✅ Passed The title clearly summarizes the main change by describing the addition of an optional folder id property and its purpose of bypassing rate limiting, which aligns with the code changes across the Zoho Workdrive sources. It is concise, specific, and directly related to the core feature introduced in the pull request.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch zoho-workdrive-optional-folder-id-props

Tip

👮 Agentic pre-merge checks are now available in preview!

Pro plan users can now enable pre-merge checks in their settings to enforce checklists before merging PRs.

  • Built-in checks – Quickly apply ready-made checks to enforce title conventions, require pull request descriptions that follow templates, validate linked issues for compliance, and more.
  • Custom agentic checks – Define your own rules using CodeRabbit’s advanced agentic capabilities to enforce organization-specific policies and workflows. For example, you can instruct CodeRabbit’s agent to verify that API documentation is updated whenever API schema files are modified in a PR. Note: Upto 5 custom checks are currently allowed during the preview period. Pricing for this feature will be announced in a few weeks.

Please see the documentation for more information.

Example:

reviews:
  pre_merge_checks:
    custom_checks:
      - name: "Undocumented Breaking Changes"
        mode: "warning"
        instructions: |
          Pass/fail criteria: All breaking changes to public APIs, CLI flags, environment variables, configuration keys, database schemas, or HTTP/GraphQL endpoints must be documented in the "Breaking Change" section of the PR description and in CHANGELOG.md. Exclude purely internal or private changes (e.g., code not exported from package entry points or explicitly marked as internal).

Please share your feedback with us on this Discord post.


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.

@andrewjschuang andrewjschuang merged commit ee017f0 into master Sep 24, 2025
9 of 10 checks passed
@andrewjschuang andrewjschuang deleted the zoho-workdrive-optional-folder-id-props branch September 24, 2025 20:41
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 (4)
components/zoho_workdrive/sources/new-file-in-folder/new-file-in-folder.mjs (2)

52-60: Good UX: optional Folder Id + new Typed Folder Id to bypass rate limits.

Nice addition and clear descriptions.

Consider noting in one/both prop descriptions that only one should be set at a time to avoid ambiguity.


101-106: Enforce mutual exclusivity and avoid repeating the selection expression.

Currently you only require at least one identifier. If users provide both, behavior may be ambiguous. Recommend enforcing exactly one and using a single effectiveFolderId.

Apply this diff:

       } = this;
 
-      if (!folderId && !typedFolderId) {
-        throw new ConfigurationError("Please select a Folder Id or type in a Typed Folder Id.");
-      }
+      const effectiveFolderId = folderId || typedFolderId;
+      if (!effectiveFolderId) {
+        throw new ConfigurationError("Please select a Folder Id or type in a Typed Folder Id.");
+      }
+      if (folderId && typedFolderId) {
+        throw new ConfigurationError("Please provide only one of Folder Id or Typed Folder Id.");
+      }
 
       const lastDate = this._getLastDate();
       let maxDate = lastDate;
       const items = app.paginate({
         fn: app.listFiles,
         maxResults,
         filter: "allfiles",
         sort: "created_time",
-        folderId: folderId || typedFolderId,
+        folderId: effectiveFolderId,
       });

Also applies to: 115-116

components/zoho_workdrive/sources/new-folder/new-folder.mjs (2)

48-51: Make description consistent with the “select vs type” guidance.

For parity with the other source, consider: “Select the unique ID of the folder.”

Apply this diff:

       label: "Folder Id",
-      description: "The unique ID of the folder.",
+      description: "Select the unique ID of the folder.",
       optional: true,

70-75: Enforce exactly one folder identifier and centralize the value.

Mirror the recommendation from the other source to avoid ambiguity when both props are set.

Apply this diff:

       } = this;
 
-      if (!folderId && !typedFolderId) {
-        throw new ConfigurationError("Please select a Folder Id or type in a Typed Folder Id.");
-      }
+      const effectiveFolderId = folderId || typedFolderId;
+      if (!effectiveFolderId) {
+        throw new ConfigurationError("Please select a Folder Id or type in a Typed Folder Id.");
+      }
+      if (folderId && typedFolderId) {
+        throw new ConfigurationError("Please provide only one of Folder Id or Typed Folder Id.");
+      }
 
       const lastDate = this._getLastDate();
       let maxDate = lastDate;
       const items = app.paginate({
         fn: app.listFiles,
         maxResults,
         filter: "folder",
         sort: "created_time",
-        folderId: folderId || typedFolderId,
+        folderId: effectiveFolderId,
       });

Also applies to: 84-85

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 5914a1b and 24dae00.

📒 Files selected for processing (3)
  • components/zoho_workdrive/package.json (1 hunks)
  • components/zoho_workdrive/sources/new-file-in-folder/new-file-in-folder.mjs (4 hunks)
  • components/zoho_workdrive/sources/new-folder/new-folder.mjs (3 hunks)
🧰 Additional context used
🧬 Code graph analysis (2)
components/zoho_workdrive/sources/new-folder/new-folder.mjs (1)
components/zoho_workdrive/sources/new-file-in-folder/new-file-in-folder.mjs (3)
  • lastDate (108-108)
  • maxDate (109-109)
  • items (110-116)
components/zoho_workdrive/sources/new-file-in-folder/new-file-in-folder.mjs (1)
components/zoho_workdrive/sources/new-folder/new-folder.mjs (3)
  • lastDate (77-77)
  • maxDate (78-78)
  • items (79-85)
🔇 Additional comments (4)
components/zoho_workdrive/package.json (1)

3-3: Version bump looks good.

Matches the source-level version bumps; no concerns.

components/zoho_workdrive/sources/new-file-in-folder/new-file-in-folder.mjs (1)

1-4: Importing ConfigurationError is appropriate for runtime config validation.

Assuming @pipedream/platform@^3.1.0 exports ConfigurationError, this is fine.

Please confirm ConfigurationError is available in ^3.1.0 in your publish environment.

components/zoho_workdrive/sources/new-folder/new-folder.mjs (2)

10-10: Version bump acknowledged.

Aligned with package bump and prop changes.


52-57: Typed Folder Id prop addition is clear and useful.

Good guidance to use this when hitting rate limits.

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