-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New Components - freshservice #17898
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 3 Skipped Deployments
|
WalkthroughThis update introduces a comprehensive Freshservice integration, adding new action and source modules for managing tickets and solution articles. It implements CRUD operations and event sources for tickets and articles, enhances the Freshservice app with dynamic prop definitions and granular API methods, and centralizes polling logic with a reusable base module. Changes
Sequence Diagram(s)Example: Creating a Solution ArticlesequenceDiagram
participant User
participant CreateSolutionArticleAction
participant FreshserviceApp
participant FreshserviceAPI
User->>CreateSolutionArticleAction: Provide article details
CreateSolutionArticleAction->>FreshserviceApp: createSolutionArticle(props)
FreshserviceApp->>FreshserviceAPI: POST /api/v2/solutions/articles
FreshserviceAPI-->>FreshserviceApp: Article created (ID)
FreshserviceApp-->>CreateSolutionArticleAction: Return article object
CreateSolutionArticleAction-->>User: Return article object & summary
Example: Polling for New TicketssequenceDiagram
participant SourceScheduler
participant NewTicketSource
participant FreshserviceApp
participant FreshserviceAPI
participant EventStream
SourceScheduler->>NewTicketSource: Trigger run()
NewTicketSource->>FreshserviceApp: listTickets(params)
FreshserviceApp->>FreshserviceAPI: GET /api/v2/tickets
FreshserviceAPI-->>FreshserviceApp: Tickets list
FreshserviceApp-->>NewTicketSource: Tickets data
NewTicketSource->>EventStream: Emit new ticket events
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Assessment against linked issues
Assessment against linked issues: Out-of-scope changes
Suggested labels
Suggested reviewers
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (2)
✅ Files skipped from review due to trivial changes (1)
🚧 Files skipped from review as they are similar to previous changes (1)
✨ Finishing Touches
🧪 Generate unit tests
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed 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)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 4
🧹 Nitpick comments (2)
components/freshservice/actions/update-ticket/update-ticket.mjs (1)
53-53: Fix typo in email description."accociated" should be "associated".
- description: "The email address accociated with the ticket", + description: "The email address associated with the ticket",components/freshservice/actions/create-ticket/create-ticket.mjs (1)
42-42: Fix typo in email description.There's a spelling error in the email description.
- description: "The email address accociated with the ticket", + description: "The email address associated with the ticket",
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (17)
components/freshservice/actions/create-solution-article/create-solution-article.mjs(1 hunks)components/freshservice/actions/create-ticket/create-ticket.mjs(1 hunks)components/freshservice/actions/delete-solution-article/delete-solution-article.mjs(1 hunks)components/freshservice/actions/get-solution-article/get-solution-article.mjs(1 hunks)components/freshservice/actions/get-ticket/get-ticket.mjs(1 hunks)components/freshservice/actions/list-solution-articles/list-solution-articles.mjs(1 hunks)components/freshservice/actions/list-solution-categories/list-solution-categories.mjs(1 hunks)components/freshservice/actions/update-solution-article/update-solution-article.mjs(1 hunks)components/freshservice/actions/update-ticket/update-ticket.mjs(1 hunks)components/freshservice/common/constants.mjs(1 hunks)components/freshservice/freshservice.app.mjs(3 hunks)components/freshservice/package.json(2 hunks)components/freshservice/sources/common/base.mjs(1 hunks)components/freshservice/sources/new-solution-article/new-solution-article.mjs(1 hunks)components/freshservice/sources/new-ticket/new-ticket.mjs(1 hunks)components/freshservice/sources/solution-article-updated/solution-article-updated.mjs(1 hunks)components/freshservice/sources/ticket-updated/ticket-updated.mjs(1 hunks)
🧰 Additional context used
🧠 Learnings (8)
📚 Learning: when developing pipedream components, do not add built-in node.js modules like `fs` to `package.json...
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.
Applied to files:
components/freshservice/package.json
📚 Learning: when exporting a summary message in the `run` method of an action, ensure the message is correctly f...
Learnt from: GTFalcao
PR: PipedreamHQ/pipedream#12731
File: components/hackerone/actions/get-members/get-members.mjs:3-28
Timestamp: 2024-07-04T18:11:59.822Z
Learning: When exporting a summary message in the `run` method of an action, ensure the message is correctly formatted. For example, in the `hackerone-get-members` action, the correct format is `Successfully retrieved ${response.data.length} members`.
Applied to files:
components/freshservice/actions/update-ticket/update-ticket.mjscomponents/freshservice/actions/list-solution-categories/list-solution-categories.mjscomponents/freshservice/actions/create-solution-article/create-solution-article.mjscomponents/freshservice/actions/update-solution-article/update-solution-article.mjscomponents/freshservice/actions/create-ticket/create-ticket.mjscomponents/freshservice/actions/get-solution-article/get-solution-article.mjs
📚 Learning: in `components/gainsight_px/actions/create-account/create-account.mjs`, the action name should be "c...
Learnt from: jcortes
PR: PipedreamHQ/pipedream#14467
File: components/gainsight_px/actions/create-account/create-account.mjs:4-6
Timestamp: 2024-10-30T15:24:39.294Z
Learning: In `components/gainsight_px/actions/create-account/create-account.mjs`, the action name should be "Create Account" instead of "Create Memory".
Applied to files:
components/freshservice/actions/create-ticket/create-ticket.mjs
📚 Learning: source names in monday.com components don't need to start with "new" if they emit events for updated...
Learnt from: GTFalcao
PR: PipedreamHQ/pipedream#15376
File: components/monday/sources/name-updated/name-updated.mjs:6-6
Timestamp: 2025-01-23T03:55:15.166Z
Learning: Source names in Monday.com components don't need to start with "New" if they emit events for updated items (e.g., "Name Updated", "Column Value Updated") rather than new items. This follows the component guidelines exception where the "New" prefix is only required when emits are limited to new items.
Applied to files:
components/freshservice/sources/new-ticket/new-ticket.mjscomponents/freshservice/sources/solution-article-updated/solution-article-updated.mjscomponents/freshservice/sources/new-solution-article/new-solution-article.mjscomponents/freshservice/sources/ticket-updated/ticket-updated.mjs
📚 Learning: in `components/the_magic_drip/sources/common.mjs`, when processing items in `getandprocessdata`, `sa...
Learnt from: GTFalcao
PR: PipedreamHQ/pipedream#14265
File: components/the_magic_drip/sources/common.mjs:35-43
Timestamp: 2024-10-10T19:18:27.998Z
Learning: In `components/the_magic_drip/sources/common.mjs`, when processing items in `getAndProcessData`, `savedIds` is intentionally updated with IDs of both emitted and non-emitted items to avoid emitting retroactive events upon first deployment and ensure only new events are emitted as they occur.
Applied to files:
components/freshservice/sources/new-ticket/new-ticket.mjscomponents/freshservice/sources/solution-article-updated/solution-article-updated.mjscomponents/freshservice/sources/common/base.mjscomponents/freshservice/sources/ticket-updated/ticket-updated.mjs
📚 Learning: the `common-webhook-methods.mjs` object is designed to be extended, similar to an abstract class, an...
Learnt from: GTFalcao
PR: PipedreamHQ/pipedream#12697
File: components/salesforce_rest_api/sources/common-webhook-methods.mjs:1-71
Timestamp: 2024-10-08T15:33:38.240Z
Learning: The `common-webhook-methods.mjs` object is designed to be extended, similar to an abstract class, and intentionally does not implement certain methods like `generateWebhookMeta` and `getEventType` to enforce implementation in subclasses.
Applied to files:
components/freshservice/sources/new-ticket/new-ticket.mjscomponents/freshservice/sources/solution-article-updated/solution-article-updated.mjscomponents/freshservice/sources/new-solution-article/new-solution-article.mjscomponents/freshservice/sources/ticket-updated/ticket-updated.mjs
📚 Learning: the `processtimerevent` method in the `components/salesforce_rest_api/sources/common.mjs` file is in...
Learnt from: GTFalcao
PR: PipedreamHQ/pipedream#12697
File: components/salesforce_rest_api/sources/common.mjs:97-98
Timestamp: 2024-07-24T02:05:59.531Z
Learning: The `processTimerEvent` method in the `components/salesforce_rest_api/sources/common.mjs` file is intentionally left unimplemented to enforce that subclasses must implement this method, similar to an abstract class in object-oriented programming.
Applied to files:
components/freshservice/sources/new-ticket/new-ticket.mjscomponents/freshservice/sources/common/base.mjs
📚 Learning: in the salesloft api integration (components/salesloft/salesloft.app.mjs), the _makerequest method r...
Learnt from: GTFalcao
PR: PipedreamHQ/pipedream#16954
File: components/salesloft/salesloft.app.mjs:14-23
Timestamp: 2025-06-04T17:52:05.780Z
Learning: In the Salesloft API integration (components/salesloft/salesloft.app.mjs), the _makeRequest method returns response.data which directly contains arrays for list endpoints like listPeople, listCadences, listUsers, and listAccounts. The propDefinitions correctly call .map() directly on these responses without needing to destructure a nested data property.
Applied to files:
components/freshservice/freshservice.app.mjs
🧬 Code Graph Analysis (3)
components/freshservice/sources/solution-article-updated/solution-article-updated.mjs (1)
components/freshservice/sources/common/base.mjs (1)
ts(52-52)
components/freshservice/actions/get-solution-article/get-solution-article.mjs (1)
components/freshservice/actions/delete-solution-article/delete-solution-article.mjs (1)
article(37-40)
components/freshservice/sources/ticket-updated/ticket-updated.mjs (2)
components/freshservice/sources/common/base.mjs (2)
lastTs(31-31)ts(52-52)components/freshservice/sources/solution-article-updated/solution-article-updated.mjs (1)
ts(46-46)
⏰ 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 (36)
components/freshservice/common/constants.mjs (2)
104-110: LGTM!The constants module is well-structured with consistent label/value mappings and proper export pattern. This provides a centralized source for Freshservice enumerations across the integration.
44-61: Confirm inclusion of “New” ticket status (value 1)
Ticket statuses currently start at 2 (“Open”), skipping value 1. According to Freshservice API, value 1 typically represents “New.” Please verify against the official API spec and include the “New” status if it’s required by your integration.• File: components/freshservice/common/constants.mjs
Lines: 44–61components/freshservice/package.json (1)
3-3: LGTM!The version bump to 0.1.0 and platform dependency upgrade to ^3.1.0 appropriately reflect the significant new functionality being added to the Freshservice integration.
Also applies to: 17-17
components/freshservice/actions/update-ticket/update-ticket.mjs (1)
57-72: LGTM!The action implementation follows Pipedream patterns correctly with proper use of propDefinitions, appropriate summary export format, and returns the updated ticket object. All update fields are appropriately optional for flexible partial updates.
components/freshservice/actions/list-solution-categories/list-solution-categories.mjs (1)
3-19: LGTM!The action is correctly implemented with proper summary export format and returns the categories array. The simple structure is appropriate for a list operation with no input parameters.
components/freshservice/actions/get-ticket/get-ticket.mjs (1)
3-26: LGTM!The action is properly implemented with correct use of propDefinitions for input validation, appropriate summary export format, and returns the ticket object. The structure follows Pipedream action patterns correctly.
components/freshservice/actions/create-ticket/create-ticket.mjs (1)
45-59: LGTM! Excellent implementation.The run method correctly calls the Freshservice API, exports a properly formatted summary message consistent with learned patterns, and returns the ticket object.
components/freshservice/actions/update-solution-article/update-solution-article.mjs (1)
11-34: LGTM! Well-structured dependent props.The hierarchical prop dependencies (category → folder → article) are correctly implemented, providing a good user experience for selecting the article to update.
components/freshservice/actions/create-solution-article/create-solution-article.mjs (1)
68-84: LGTM! Proper API parameter mapping.The run method correctly maps props to API parameters using snake_case and exports a properly formatted summary message.
components/freshservice/actions/list-solution-articles/list-solution-articles.mjs (1)
1-37: LGTM! Clean and well-structured implementation.This action follows all the expected patterns:
- Proper dependent prop definitions for hierarchical selection
- Correct API parameter passing via params object
- Well-formatted summary message with count
- Clean, concise code structure
components/freshservice/sources/ticket-updated/ticket-updated.mjs (3)
5-5: LGTM! Correct naming convention.The name "Ticket Updated" correctly follows the component guidelines by not using the "New" prefix since this source emits events for updated items rather than newly created ones.
28-35: LGTM! Excellent generateMeta implementation.The method correctly creates unique event IDs by combining ticket ID and timestamp, ensuring proper deduplication for updated tickets. The implementation follows the established patterns from other Freshservice sources.
13-27: LGTM! Proper implementation of abstract methods.All required abstract methods from the common base are correctly implemented:
- Resource function points to the right API method
- Parameters include proper filtering and ordering
- Timestamp and resource key fields are correctly specified
components/freshservice/actions/delete-solution-article/delete-solution-article.mjs (3)
1-8: LGTM!The component metadata and import statement are well-structured and follow standard Pipedream action conventions.
9-35: LGTM!The hierarchical prop dependencies are correctly implemented, ensuring proper selection flow from category → folder → article.
36-43: LGTM!The run method correctly implements the delete operation and follows standard patterns for API calls and summary exports.
components/freshservice/actions/get-solution-article/get-solution-article.mjs (3)
1-8: LGTM!The component metadata follows standard conventions and correctly identifies this as a get operation.
9-35: LGTM!The props structure correctly implements hierarchical dependencies and is consistent with other solution article actions.
36-43: LGTM!The run method correctly implements the get operation with proper response destructuring and summary formatting.
components/freshservice/sources/new-ticket/new-ticket.mjs (3)
1-4: LGTM!Good architectural decision to extend a common base module, which will reduce code duplication and ensure consistent polling behavior across Freshservice sources.
5-10: LGTM!Version increment is appropriate for the refactor, and the component name correctly follows the "New" prefix convention for sources that emit only new items.
11-31: LGTM!All required methods are properly implemented to work with the common base module. The descending order and timestamp parsing are correctly configured for detecting new tickets.
components/freshservice/sources/new-solution-article/new-solution-article.mjs (4)
1-4: LGTM!Correctly extends the common base module following the established pattern.
5-10: LGTM!Component metadata follows standard conventions, and the "New" prefix correctly indicates this source emits events for newly created articles only.
11-28: LGTM!Props structure correctly extends the base props and implements hierarchical dependencies consistent with the action components.
29-50: LGTM!All required methods are properly implemented with correct filtering by folder ID and appropriate metadata generation for solution articles.
components/freshservice/sources/common/base.mjs (6)
1-16: LGTM!Standard props structure with appropriate use of default polling interval and required dependencies for source components.
17-29: LGTM!Timestamp tracking methods correctly implement persistent state management with appropriate defaults and extension points.
30-63: LGTM!Core polling logic correctly implements timestamp-based filtering to emit only new items, with proper state management and event emission patterns.
64-72: LGTM!Abstract methods correctly enforce implementation in subclasses using ConfigurationError, following established patterns for base modules.
74-77: LGTM!Deploy hook appropriately limits initial events to avoid overwhelming the system during first deployment.
79-81: LGTM!Run method correctly implements regular polling execution with appropriate default limits.
components/freshservice/sources/solution-article-updated/solution-article-updated.mjs (1)
45-52: LGTM!The
generateMetamethod correctly implements event metadata generation with proper deduplication using a composite ID and accurate timestamp parsing.components/freshservice/freshservice.app.mjs (3)
107-107: LGTM!The API URL correctly uses the v2 endpoint as required by the Freshservice API documentation.
121-201: Well-structured API methods implementation.The new API methods follow RESTful conventions consistently and provide comprehensive coverage for tickets and solution articles management. The methods properly use HTTP verbs and resource paths.
121-201: Consider implementing additional endpoints mentioned in PR objectives.The current implementation covers tickets and solution articles well. However, the PR objectives mention additional endpoints that aren't implemented yet:
- Service requests (
/api/v2/service_requests)- Notes on tickets (
/api/v2/tickets/{id}/notes)- Templates/macros (
/api/v2/templates)Are these planned for a future iteration?
components/freshservice/actions/create-solution-article/create-solution-article.mjs
Show resolved
Hide resolved
components/freshservice/actions/update-solution-article/update-solution-article.mjs
Outdated
Show resolved
Hide resolved
components/freshservice/sources/solution-article-updated/solution-article-updated.mjs
Show resolved
Hide resolved
jcortes
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @michelle0927 lgtm! Ready for QA!
Resolves #17429
Summary by CodeRabbit
New Features
Improvements
Refactor
Chores