Skip to content

Conversation

verhovsky
Copy link
Contributor

@verhovsky verhovsky commented Oct 10, 2025

Closes #18644

The order is list-help-centers.mjs → list-root-categories.mjs → list-articles.mjs or search-articles.mjs → get-article.mjs

A nuance in testing this, when publishing a help article you need to set its visibility to something other than private, otherwise you will not see it in the API.

Summary by CodeRabbit

  • New Features
    • Added Zoho Desk actions: List Help Centers, List Root Categories, List Articles, Search Articles, and Get Article.
    • Portal ID selection to target specific help centers and Article ID input for fetching a specific article.
    • Search/list actions support sorting, filtering, streaming, and optional max result limits.
  • Chores
    • Bumped Zoho Desk package version to 0.2.2.

@verhovsky verhovsky requested a review from GTFalcao October 10, 2025 00:11
Copy link

vercel bot commented Oct 10, 2025

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

1 Skipped Deployment
Project Deployment Preview Comments Updated (UTC)
pipedream-docs-redirect-do-not-edit Ignored Ignored Oct 10, 2025 0:31am

@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 bot commented Oct 10, 2025

Walkthrough

Adds Zoho Desk Help Center and Knowledge Base actions (list help centers, list articles, get article, search articles, list root categories). Extends the Zoho Desk app with portal/article propDefinitions, request/stream helpers for KB endpoints, replaces VERSION_PATH with CORE_API_PATH, adds PORTAL_API_PATH, and bumps package version.

Changes

Cohort / File(s) Summary
New Zoho Desk actions
components/zoho_desk/actions/list-help-centers/list-help-centers.mjs, components/zoho_desk/actions/list-articles/list-articles.mjs, components/zoho_desk/actions/get-article/get-article.mjs, components/zoho_desk/actions/search-articles/search-articles.mjs, components/zoho_desk/actions/list-root-categories/list-root-categories.mjs
Add five action modules exposing metadata, props, and async run() implementations that call corresponding app methods. Support streaming iteration for listings/search with optional maxResults, single-entity fetch for get-article, and export concise $summary strings.
App enhancements
components/zoho_desk/zoho_desk.app.mjs
Adds portalId and articleId propDefinitions, implements methods for help centers, KB articles, root categories, search, and get-article, plus async generator stream helpers. Switches internal URL construction to use CORE_API_PATH (apiPrefix) and integrates portal/KB endpoints.
Constants
components/zoho_desk/common/constants.mjs
Renames VERSION_PATHCORE_API_PATH = "/api/v1" and adds PORTAL_API_PATH = "/portal/api"; updates default export accordingly.
Package
components/zoho_desk/package.json
Bumps package version from 0.2.1 to 0.2.2.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor User
  participant Action as Zoho Desk Action
  participant App as zoho_desk.app
  participant API as Zoho Desk API

  User->>Action: Configure orgId, portalId, params
  Action->>App: invoke list/search/get/root-category method
  App->>API: HTTP request(s) to portal/KB endpoints (using CORE_API_PATH / PORTAL_API_PATH)
  API-->>App: Page(s) of data or single item
  alt Streaming (list/search/root-categories)
    loop until no more pages or maxResults reached
      App-->>Action: yield item(s)
      Action->>Action: accumulate, enforce maxResults
    end
  else Single fetch (get-article)
    App-->>Action: return entity
  end
  Action->>Action: export $summary
  Action-->>User: return collected data
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Poem

I hop through portals, nose to the breeze,
Fetching articles and catalogued trees.
Streams of knowledge, pages to share,
Rooted categories, found with a flair.
A rabbit applauds—help centers, I cheer! 🐇✨

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Description Check ⚠️ Warning The pull request description does not use the required “## WHY” section from the repository template and omits the background context explaining the motivation behind adding these help center and knowledge base actions. It instead lists implementation order and a testing nuance without explicitly articulating why these additions are needed. This diverges from the template structure and leaves out critical rationale. Please update the description to include a “## WHY” section that clearly outlines the motivation and context for these new Zoho Desk actions, following the repository’s pull request template.
✅ Passed checks (4 passed)
Check name Status Explanation
Title Check ✅ Passed The title correctly notes the addition of new Zoho Desk help center actions, reflecting a major part of the changeset. However, the PR also introduces several knowledge base actions (list-root-categories, list-articles, search-articles, get-article) which are not captured in the title. As written it only partially describes the full scope of work. Including both help center and knowledge base components would give a clearer overview of the changes.
Linked Issues Check ✅ Passed The changes implement all coding-related requirements from issue #18644 by adding modules for listing help centers, listing root categories, listing and searching articles, and retrieving individual articles against Zoho Desk’s API. Each action is defined with appropriate props, streaming support, and summary exports that align with the documented endpoints. The linked issue’s objectives for Help Center and Knowledge Base actions have been fully addressed.
Out of Scope Changes Check ✅ Passed All code changes—including new action modules for listing and retrieving Help Center and Knowledge Base content, supporting changes to the app’s public methods, and updated constants—directly enable the functionality requested in the linked issue. The constants refactoring and new PORTAL_API_PATH were introduced to support the new endpoints rather than adding unrelated features. The version bump in package.json reflects the release of these new capabilities without diverging from the scope.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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.

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/zoho_desk/zoho_desk.app.mjs (2)

24-46: Consider adding error handling in the async options.

The portalId prop's async options function calls listHelpCenters without error handling. If the API call fails, the error could bubble up and cause issues for users trying to configure the component.

Consider wrapping the API call in a try-catch block:

     async options({ orgId }) {
       if (!orgId) {
         return [];
       }
+      try {
         const { data: helpCenters = [] } =
           await this.listHelpCenters({
             params: {
               orgId,
             },
           });
         return helpCenters.map(({
           portalId: value,
           name: label,
         }) => ({
           value,
           label: label || value,
         }));
+      } catch (error) {
+        console.error("Error fetching help centers:", error);
+        return [];
+      }
     },

126-130: Consider enhancing articleId with async options.

While the simple string approach works, adding async options (similar to contactId and ticketId props) would improve user experience by allowing users to select from available articles rather than manually entering IDs.

This would require additional context (e.g., orgId and portalId) to fetch available articles, so it can be implemented as a future enhancement if needed.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 17ae289 and 2af7bf0.

📒 Files selected for processing (2)
  • components/zoho_desk/common/constants.mjs (2 hunks)
  • components/zoho_desk/zoho_desk.app.mjs (4 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • components/zoho_desk/common/constants.mjs
🧰 Additional context used
🧬 Code graph analysis (1)
components/zoho_desk/zoho_desk.app.mjs (1)
components/zoho_desk/actions/list-help-centers/list-help-centers.mjs (1)
  • helpCenters (26-31)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
  • GitHub Check: Publish TypeScript components
  • GitHub Check: Verify TypeScript components
  • GitHub Check: pnpm publish
  • GitHub Check: Lint Code Base
🔇 Additional comments (2)
components/zoho_desk/zoho_desk.app.mjs (2)

295-368: LGTM! Well-structured knowledge base methods.

The new help center and knowledge base methods are well-implemented:

  • Consistent use of makeRequest with apiPrefix: constants.PORTAL_API_PATH for portal API endpoints
  • Proper async generator patterns for streaming methods using yield* and getResourcesStream
  • Clear, RESTful path conventions (/helpCenters, /kbArticles, /kbArticles/search, /kbRootCategories)
  • Correct parameter handling and destructuring in stream methods
  • Implementation aligns with how they're consumed in the action files

The code follows the established patterns in the codebase and integrates cleanly with the existing infrastructure.


133-136: Constants definitions verified. CORE_API_PATH and PORTAL_API_PATH are defined in components/zoho_desk/common/constants.mjs with the expected values.

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.

[ACTION] Help Center & Knowledge Base Actions for Zoho Desk
2 participants