-
Notifications
You must be signed in to change notification settings - Fork 5.3k
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
[FEATURE] Gorgias: New Ticket source - Add Tags prop for filtering tags #14130
[FEATURE] Gorgias: New Ticket source - Add Tags prop for filtering tags #14130
Conversation
WalkthroughThe pull request introduces several version updates across various components of the Gorgias OAuth module, including actions for creating, updating, and retrieving customers and tickets. Notably, it adds a new property Changes
Assessment against linked issues
Possibly related PRs
Suggested labels
Suggested reviewers
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
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 (
|
@jcortes is attempting to deploy a commit to the Pipedreamers Team on Vercel. A member of the Team first needs to authorize it. |
The latest updates on your projects. Learn more about Vercel for Git ↗︎ |
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
🧹 Outside diff range and nitpick comments (3)
components/gorgias_oauth/sources/ticket-created/ticket-created.mjs (2)
36-44
: NewtagIds
property looks good, with a minor suggestion.The new
tagIds
property is well-defined and aligns with the PR objective. The use of the base component'stagId
prop definition ensures consistency.Consider slightly modifying the description for clarity:
- description: "The tag ids to filter tickets by.", + description: "The tag IDs to filter tickets by. Only tickets with at least one of these tags will be processed.",This change provides users with a clearer understanding of how the filter works.
52-56
:isRelevant
method update looks good, with a minor optimization suggestion.The addition of tag filtering to the
isRelevant
method is well-implemented and aligns with the PR objective. The logic correctly handles the newtagIds
property while maintaining backwards compatibility.Consider this minor optimization to avoid unnecessary tag ID mapping when
this.tagIds
is not provided:- const tagIds = ticket.tags.map(({ id }) => id); return (!this.channel || ticket.channel === this.channel) && (!this.via || ticket.via === this.via) && (!this.assigneeId || ticket?.assignee_user_id === this.assigneeId) - && (!this.tagIds || this.tagIds.some((tagId) => tagIds.includes(tagId))); + && (!this.tagIds || this.tagIds.some((tagId) => ticket.tags.some(tag => tag.id === tagId)));This change avoids creating an unnecessary array when tag filtering is not being used, potentially improving performance for those cases.
components/gorgias_oauth/gorgias_oauth.app.mjs (1)
390-395
: Ensure error handling inlistTags
methodThe
listTags
method is correctly implemented to retrieve tags from the/tags
endpoint. However, consider adding error handling to manage potential API request failures, such as network issues or invalid responses. This will enhance the robustness of your application.You could modify the method as follows to include a try-catch block:
listTags(opts = {}) { + try { return this._makeRequest({ path: "/tags", ...opts, }); + } catch (error) { + throw new Error(`Failed to list tags: ${error.message}`); + } },
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (11)
- components/gorgias_oauth/actions/create-customer/create-customer.mjs (1 hunks)
- components/gorgias_oauth/actions/create-ticket/create-ticket.mjs (1 hunks)
- components/gorgias_oauth/actions/list-tickets/list-tickets.mjs (1 hunks)
- components/gorgias_oauth/actions/retrieve-customer/retrieve-customer.mjs (1 hunks)
- components/gorgias_oauth/actions/update-customer/update-customer.mjs (1 hunks)
- components/gorgias_oauth/actions/update-ticket/update-ticket.mjs (1 hunks)
- components/gorgias_oauth/gorgias_oauth.app.mjs (2 hunks)
- components/gorgias_oauth/package.json (1 hunks)
- components/gorgias_oauth/sources/ticket-created/ticket-created.mjs (2 hunks)
- components/gorgias_oauth/sources/ticket-message-created/ticket-message-created.mjs (1 hunks)
- components/gorgias_oauth/sources/ticket-updated/ticket-updated.mjs (1 hunks)
✅ Files skipped from review due to trivial changes (9)
- components/gorgias_oauth/actions/create-customer/create-customer.mjs
- components/gorgias_oauth/actions/create-ticket/create-ticket.mjs
- components/gorgias_oauth/actions/list-tickets/list-tickets.mjs
- components/gorgias_oauth/actions/retrieve-customer/retrieve-customer.mjs
- components/gorgias_oauth/actions/update-customer/update-customer.mjs
- components/gorgias_oauth/actions/update-ticket/update-ticket.mjs
- components/gorgias_oauth/package.json
- components/gorgias_oauth/sources/ticket-message-created/ticket-message-created.mjs
- components/gorgias_oauth/sources/ticket-updated/ticket-updated.mjs
🔇 Additional comments (2)
components/gorgias_oauth/sources/ticket-created/ticket-created.mjs (2)
10-10
: Version bump looks good.The increment from 0.1.5 to 0.1.6 is appropriate for adding the new tag filtering feature. This change indicates a backwards-compatible update, which aligns with the nature of the modification.
Line range hint
1-76
: Overall, the changes look good and meet the PR objectives.The implementation successfully adds tag filtering capability to the Gorgias ticket source while maintaining backwards compatibility. The code is well-structured and aligns with the existing patterns in the file.
Key points:
- Version bump is appropriate.
- New
tagIds
property is well-defined.isRelevant
method correctly implements tag filtering.Consider the minor suggestions provided in the previous comments to further improve the code. Great job on implementing this feature!
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.
LGTM!
WHY
Added new tagIds filter prop in Ticker Created source
Resolves #14108
Summary by CodeRabbit
Release Notes
New Features
tagId
for enhanced ticket management.listTags
to facilitate tag retrieval.tagIds
property to filter tickets by specific tag IDs in the ticket creation source.Version Updates
gorgias_oauth-create-customer
: 0.0.4 → 0.0.5gorgias_oauth-create-ticket
: 0.0.5 → 0.0.6gorgias_oauth-list-tickets
: 0.0.5 → 0.0.6gorgias_oauth-retrieve-customer
: 0.0.4 → 0.0.5gorgias_oauth-update-customer
: 0.0.4 → 0.0.5gorgias_oauth-update-ticket
: 0.0.1 → 0.0.2@pipedream/gorgias_oauth
: 0.4.0 → 0.4.1ticket-created
: 0.1.5 → 0.1.6ticket-message-created
: 0.1.5 → 0.1.6ticket-updated
: 0.1.5 → 0.1.6