-
Notifications
You must be signed in to change notification settings - Fork 5.5k
Gorgias ticket messages functionality #19027
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
base: master
Are you sure you want to change the base?
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
WalkthroughAdds message-retrieval capabilities to the Gorgias OAuth integration: three new actions (Get Ticket Message, List Ticket Messages, List Messages), three new app methods in the gorgias_oauth app, a package version bump to 0.7.0, and multiple action/source version increments. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant Action as Action (List / Get-Ticket-Message)
participant App as gorgias_oauth.app
participant API as Gorgias API
Note over Action,App: props: gorgiasOAuth, ticketId?, messageId?, limit, cursor
Action->>App: listTicketMessages({ $, ticketId, params })\nlistMessages({ $, params })\ngetTicketMessage({ $, ticketId, messageId })
App->>API: GET /tickets/{ticketId}/messages\nor /messages\nor /tickets/{ticketId}/messages/{messageId}
API-->>App: 200 OK { data, meta }
App-->>Action: return { data, meta } or message payload
Action->>Action: export summary (e.g., "Retrieved X messages")
Action-->>User: return result
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes
Suggested reviewers
Pre-merge checks and finishing touches❌ Failed checks (1 inconclusive)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
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. Comment |
|
Thank you so much for submitting this! We've added it to our backlog to review, and our team has been notified. |
|
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:
|
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: 3
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (6)
PR_DESCRIPTION.md(1 hunks)components/gorgias_oauth/actions/get-ticket-message/get-ticket-message.mjs(1 hunks)components/gorgias_oauth/actions/list-ticket-messages/list-ticket-messages.mjs(1 hunks)components/gorgias_oauth/gorgias_oauth.app.mjs(1 hunks)sage_crm_client.py(1 hunks)update_pr_title.sh(1 hunks)
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2024-10-08T15:33:38.240Z
Learnt from: GTFalcao
Repo: PipedreamHQ/pipedream PR: 12731
File: components/hackerone/actions/get-members/get-members.mjs:3-28
Timestamp: 2024-10-08T15:33:38.240Z
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/gorgias_oauth/actions/list-ticket-messages/list-ticket-messages.mjscomponents/gorgias_oauth/actions/get-ticket-message/get-ticket-message.mjs
🧬 Code graph analysis (2)
components/gorgias_oauth/actions/list-ticket-messages/list-ticket-messages.mjs (3)
types/src/index.ts (1)
defineAction(402-408)components/gorgias_oauth/gorgias_oauth.app.mjs (2)
params(295-295)response(285-285)components/gorgias_oauth/actions/get-ticket-message/get-ticket-message.mjs (1)
response(25-29)
components/gorgias_oauth/actions/get-ticket-message/get-ticket-message.mjs (3)
types/src/index.ts (1)
defineAction(402-408)components/gorgias_oauth/actions/list-ticket-messages/list-ticket-messages.mjs (1)
response(42-46)components/gorgias_oauth/gorgias_oauth.app.mjs (1)
response(285-285)
🪛 Ruff (0.14.4)
sage_crm_client.py
40-40: Avoid specifying long messages outside the exception class
(TRY003)
44-44: Avoid specifying long messages outside the exception class
(TRY003)
47-47: Avoid specifying long messages outside the exception class
(TRY003)
66-66: Dynamically typed expressions (typing.Any) are disallowed in **kwargs
(ANN401)
86-86: Logging statement uses f-string
(G004)
93-93: Avoid specifying long messages outside the exception class
(TRY003)
95-95: Avoid specifying long messages outside the exception class
(TRY003)
97-97: Avoid specifying long messages outside the exception class
(TRY003)
107-107: Use logging.exception instead of logging.error
Replace with exception
(TRY400)
107-107: Logging statement uses f-string
(G004)
108-108: Within an except clause, raise exceptions with raise ... from err or raise ... from None to distinguish them from errors in exception handling
(B904)
108-108: Avoid specifying long messages outside the exception class
(TRY003)
111-111: Use logging.exception instead of logging.error
Replace with exception
(TRY400)
111-111: Logging statement uses f-string
(G004)
111-111: Use explicit conversion flag
Replace with conversion flag
(RUF010)
116-116: datetime.datetime.now() called without a tz argument
(DTZ005)
124-124: datetime.datetime.now() called without a tz argument
(DTZ005)
128-128: Dynamically typed expressions (typing.Any) are disallowed in **filters
(ANN401)
189-189: Avoid specifying long messages outside the exception class
(TRY003)
218-218: Avoid specifying long messages outside the exception class
(TRY003)
247-247: Avoid specifying long messages outside the exception class
(TRY003)
249-249: Avoid specifying long messages outside the exception class
(TRY003)
274-274: Avoid specifying long messages outside the exception class
(TRY003)
281-281: Unnecessary pass statement
Remove unnecessary pass
(PIE790)
286-286: Unnecessary pass statement
Remove unnecessary pass
(PIE790)
341-341: f-string without any placeholders
Remove extraneous f prefix
(F541)
356-356: Do not catch blind exception: Exception
(BLE001)
🔇 Additional comments (4)
components/gorgias_oauth/actions/list-ticket-messages/list-ticket-messages.mjs (4)
1-2: LGTM!The imports are correct and follow Pipedream conventions.
4-9: LGTM!The action metadata is well-structured, includes helpful documentation links, and follows Pipedream component guidelines.
10-32: LGTM!The props are well-defined with appropriate validation, defaults, and helpful descriptions. Good use of
propDefinitionforticketIdandoptionalfor the pagination cursor.
33-46: listTicketMessages method verified—no changes needed.The
listTicketMessagesmethod exists incomponents/gorgias_oauth/gorgias_oauth.app.mjs(line 236) with the correct signature and implementation. The action file correctly calls this method with all required parameters.
components/gorgias_oauth/actions/list-ticket-messages/list-ticket-messages.mjs
Show resolved
Hide resolved
lcaresia
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.
Thanks for your contribution, I just left some comments to fix.
components/gorgias_oauth/actions/list-ticket-messages/list-ticket-messages.mjs
Show resolved
Hide resolved
components/gorgias_oauth/actions/get-ticket-message/get-ticket-message.mjs
Show resolved
Hide resolved
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: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (3)
components/gorgias_oauth/actions/get-ticket-message/get-ticket-message.mjs(1 hunks)components/gorgias_oauth/actions/list-ticket-messages/list-ticket-messages.mjs(1 hunks)components/gorgias_oauth/gorgias_oauth.app.mjs(1 hunks)
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2024-10-08T15:33:38.240Z
Learnt from: GTFalcao
Repo: PipedreamHQ/pipedream PR: 12731
File: components/hackerone/actions/get-members/get-members.mjs:3-28
Timestamp: 2024-10-08T15:33:38.240Z
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/gorgias_oauth/actions/list-ticket-messages/list-ticket-messages.mjscomponents/gorgias_oauth/actions/get-ticket-message/get-ticket-message.mjs
🧬 Code graph analysis (2)
components/gorgias_oauth/actions/list-ticket-messages/list-ticket-messages.mjs (3)
types/src/index.ts (1)
defineAction(402-408)components/gorgias_oauth/gorgias_oauth.app.mjs (2)
params(295-295)response(285-285)components/gorgias_oauth/actions/get-ticket-message/get-ticket-message.mjs (1)
response(25-29)
components/gorgias_oauth/actions/get-ticket-message/get-ticket-message.mjs (3)
types/src/index.ts (1)
defineAction(402-408)components/gorgias_oauth/actions/list-ticket-messages/list-ticket-messages.mjs (1)
response(42-46)components/gorgias_oauth/gorgias_oauth.app.mjs (1)
response(285-285)
🔇 Additional comments (5)
components/gorgias_oauth/gorgias_oauth.app.mjs (1)
229-243: LGTM! Method implementation is correct.The
listTicketMessagesmethod is properly implemented with comprehensive JSDoc documentation. The path correctly omits the/apiprefix since_defaultConfigadds it automatically.components/gorgias_oauth/actions/get-ticket-message/get-ticket-message.mjs (2)
4-23: LGTM! Action metadata and props are well-defined.The action follows Pipedream component guidelines with proper metadata, key format, and prop definitions. The use of propDefinition for
ticketIdensures consistency across actions.
24-35: LGTM! Run method is correctly implemented.The run method properly calls the app method and returns the response. The summary export was correctly added to address the previous review feedback, providing clear user feedback.
components/gorgias_oauth/actions/list-ticket-messages/list-ticket-messages.mjs (2)
4-32: LGTM! Action metadata and props are well-defined.The action follows Pipedream conventions with proper metadata and prop definitions. The
limitprop includes appropriate constraints (1-100) and a sensible default (50). The optionalcursorprop enables pagination.
33-56: LGTM! Run method is correctly implemented.The run method properly builds the params object, calls the app method, and returns the response with pagination metadata. The summary export was correctly added to address previous feedback, with proper message pluralization based on the result count.
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: 2
♻️ Duplicate comments (1)
components/gorgias_oauth/gorgias_oauth.app.mjs (1)
252-259: Consider "retrieve" prefix for consistency.The method implementation is correct. However, other single-item retrieval methods in this file use the "retrieve" prefix (
retrieveTicketat line 438,retrieveCustomerat line 394,retrieveUserat line 402), while this uses "get". Consider renaming toretrieveTicketMessagefor consistency across the codebase.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (5)
components/gorgias_oauth/actions/get-ticket-message/get-ticket-message.mjs(1 hunks)components/gorgias_oauth/actions/list-messages/list-messages.mjs(1 hunks)components/gorgias_oauth/actions/list-ticket-messages/list-ticket-messages.mjs(1 hunks)components/gorgias_oauth/gorgias_oauth.app.mjs(1 hunks)components/gorgias_oauth/package.json(1 hunks)
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2024-10-08T15:33:38.240Z
Learnt from: GTFalcao
Repo: PipedreamHQ/pipedream PR: 12731
File: components/hackerone/actions/get-members/get-members.mjs:3-28
Timestamp: 2024-10-08T15:33:38.240Z
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/gorgias_oauth/actions/get-ticket-message/get-ticket-message.mjscomponents/gorgias_oauth/actions/list-messages/list-messages.mjscomponents/gorgias_oauth/actions/list-ticket-messages/list-ticket-messages.mjs
🧬 Code graph analysis (3)
components/gorgias_oauth/actions/get-ticket-message/get-ticket-message.mjs (3)
components/gorgias_oauth/actions/list-messages/list-messages.mjs (1)
response(40-43)components/gorgias_oauth/actions/list-ticket-messages/list-ticket-messages.mjs (1)
response(46-50)components/gorgias_oauth/gorgias_oauth.app.mjs (1)
response(300-300)
components/gorgias_oauth/actions/list-messages/list-messages.mjs (2)
components/gorgias_oauth/actions/list-ticket-messages/list-ticket-messages.mjs (2)
params(38-40)response(46-50)components/gorgias_oauth/gorgias_oauth.app.mjs (2)
params(310-310)response(300-300)
components/gorgias_oauth/actions/list-ticket-messages/list-ticket-messages.mjs (3)
components/gorgias_oauth/actions/list-messages/list-messages.mjs (2)
params(32-34)response(40-43)components/gorgias_oauth/gorgias_oauth.app.mjs (2)
params(310-310)response(300-300)components/gorgias_oauth/actions/get-ticket-message/get-ticket-message.mjs (1)
response(46-50)
🔇 Additional comments (11)
components/gorgias_oauth/package.json (1)
3-3: LGTM!The minor version bump from 0.6.2 to 0.7.0 is appropriate for adding new functionality without breaking changes.
components/gorgias_oauth/gorgias_oauth.app.mjs (2)
229-244: LGTM!The
listTicketMessagesmethod is well-documented and correctly implemented. The path uses the proper format without the double/apiprefix.
260-274: LGTM!The
listMessagesmethod is well-documented and correctly implemented. It follows the same patterns as other list methods in the file.components/gorgias_oauth/actions/list-ticket-messages/list-ticket-messages.mjs (3)
3-13: LGTM!Action metadata is correctly configured with appropriate annotations for a read-only operation and includes documentation link.
14-36: LGTM!Props are well-defined with appropriate constraints on the limit parameter (1-100) and proper reuse of the ticketId propDefinition for consistency.
37-61: LGTM!The run method is correctly implemented with proper parameter handling, summary export following the learned pattern, and returns both data and pagination metadata.
components/gorgias_oauth/actions/get-ticket-message/get-ticket-message.mjs (3)
3-13: LGTM!Action metadata is correctly configured with appropriate annotations for a read-only operation.
16-21: LGTM!Proper reuse of the ticketId propDefinition for consistency.
45-55: LGTM!The run method correctly calls the app method and exports an informative summary message.
components/gorgias_oauth/actions/list-messages/list-messages.mjs (2)
14-30: LGTM!Props are well-defined with appropriate constraints and pagination support.
31-54: LGTM!The run method is correctly implemented with proper parameter handling, summary export, and returns both data and pagination metadata.
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: 1
♻️ Duplicate comments (1)
components/gorgias_oauth/actions/list-messages/list-messages.mjs (1)
3-13: Consider clarifying the scope in the description.The description "List all messages" has been improved from the previous version but could be more explicit about the account-wide scope to differentiate it from the ticket-specific
list-ticket-messagesaction.Suggested improvement:
- description: "List all messages. [See the documentation](https://developers.gorgias.com/reference/list-messages)", + description: "List all messages across all tickets. [See the documentation](https://developers.gorgias.com/reference/list-messages)",This makes it clearer that the action fetches messages account-wide rather than for a specific ticket.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (2)
components/gorgias_oauth/actions/get-ticket-message/get-ticket-message.mjs(1 hunks)components/gorgias_oauth/actions/list-messages/list-messages.mjs(1 hunks)
🧰 Additional context used
🧠 Learnings (2)
📚 Learning: 2024-10-08T15:33:38.240Z
Learnt from: GTFalcao
Repo: PipedreamHQ/pipedream PR: 12731
File: components/hackerone/actions/get-members/get-members.mjs:3-28
Timestamp: 2024-10-08T15:33:38.240Z
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/gorgias_oauth/actions/list-messages/list-messages.mjscomponents/gorgias_oauth/actions/get-ticket-message/get-ticket-message.mjs
📚 Learning: 2024-10-30T15:24:39.294Z
Learnt from: jcortes
Repo: PipedreamHQ/pipedream PR: 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/gorgias_oauth/actions/list-messages/list-messages.mjs
🧬 Code graph analysis (2)
components/gorgias_oauth/actions/list-messages/list-messages.mjs (3)
components/gorgias_oauth/actions/list-ticket-messages/list-ticket-messages.mjs (2)
params(38-40)response(46-50)components/gorgias_oauth/gorgias_oauth.app.mjs (2)
params(310-310)response(300-300)components/gorgias_oauth/actions/get-ticket-message/get-ticket-message.mjs (1)
response(46-50)
components/gorgias_oauth/actions/get-ticket-message/get-ticket-message.mjs (2)
components/gorgias_oauth/actions/list-ticket-messages/list-ticket-messages.mjs (1)
response(46-50)components/gorgias_oauth/gorgias_oauth.app.mjs (1)
response(300-300)
🔇 Additional comments (4)
components/gorgias_oauth/actions/get-ticket-message/get-ticket-message.mjs (2)
1-21: LGTM!The action metadata, key naming convention, and prop definitions follow Pipedream component guidelines correctly. The use of propDefinition for ticketId promotes reusability.
45-55: LGTM!The run method correctly implements the action logic with proper error context (
$parameter), includes an informative summary export, and returns the API response. This addresses the previous review feedback about missing summary.components/gorgias_oauth/actions/list-messages/list-messages.mjs (2)
14-29: LGTM!The props are well-defined with appropriate constraints, defaults, and helpful descriptions. The
limitprop has proper validation (min/max), and thecursorprop is correctly marked optional with clear guidance for users.
31-54: LGTM!The run method implementation is clean and follows best practices. The summary export correctly formats the message count with proper pluralization, consistent with the learnings pattern. Returning both
dataandmetaenables pagination for users.Based on learnings.
I've successfully implemented the Gorgias ticket messages functionality as requested. Here's a quick summary of what's been added:
New Methods in Gorgias OAuth App:
listTicketMessages(ticketId, params)
: Fetches all messages for a specific ticket with pagination support.
getTicketMessage(ticketId, messageId)
: Retrieves a specific message by its ID from a ticket.
New Actions:
List Ticket Messages: Located at components/gorgias_oauth/actions/list-ticket-messages/
Get Ticket Message: Located at components/gorgias_oauth/actions/get-ticket-message/
Documentation:
Added JSDoc comments for all new methods
Included links to the official Gorgias API documentation
Added parameter descriptions and types
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.