Skip to content

Conversation

@jcortes
Copy link
Collaborator

@jcortes jcortes commented Nov 26, 2025

WHY

Resolves #19171

Summary by CodeRabbit

  • New Features

    • Close tickets directly via the Trengo integration
    • Select and manage ticket result options when closing tickets
  • Minor Updates

    • Component version bumped to 0.6.0
    • Multiple Trengo actions and event sources updated with minor version bumps and maintenance updates

✏️ Tip: You can customize this high-level summary in your review settings.

@jcortes jcortes self-assigned this Nov 26, 2025
@vercel
Copy link

vercel bot commented Nov 26, 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 Nov 26, 2025 9:02pm
pipedream-docs-redirect-do-not-edit Ignored Ignored Nov 26, 2025 9:02pm

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 26, 2025

Walkthrough

Adds a new "Close Ticket" action and related app methods/prop for Trengo, plus numerous metadata version bumps across Trengo actions and sources and a package version update to 0.6.0.

Changes

Cohort / File(s) Summary
New Close Ticket Action
components/trengo/actions/close-ticket/close-ticket.mjs
New action module exporting metadata (key: trengo-close-ticket, version: 0.0.1) with props app, ticketId, ticketResultId. run() calls app.closeTicket({ $, ticketId, data: { ticket_result_id } }), exports summary, and returns API response.
App API & Props
components/trengo/trengo.app.mjs
Adds ticketResultId propDefinition with async options resolver; adds closeTicket({ ticketId, ... }) method to POST /tickets/{ticketId}/close; adds listTicketResults() method to GET /ticket_results.
Package version
components/trengo/package.json
Bumps package version from 0.5.0 to 0.6.0.
Action version bumps
components/trengo/actions/*
Incremental version updates across many action modules (examples): attach-label, create-contact, find-contacts, get-label, get-message, list-articles, list-labels, list-messages, list-tickets, log-a-voice-call, send-a-message, send-a-team-chat-message, send-a-ticket-message, send-a-whatsapp-message-template — only metadata version fields changed.
Source version bumps
components/trengo/sources/*
Incremental version updates across source modules (examples): new-inbound-message, new-internal-note, new-outbound-message, phone-call-ended, phone-call-missed, phone-call-started, ticket-closed, ticket-label-added, ticket-reopened, voice-call-recorded — only metadata version fields changed.

Sequence Diagram(s)

sequenceDiagram
  %% styling: subtle colored boxes for components
  participant A as Close Ticket Action
  participant B as Trengo App
  participant C as Trengo API
  rect rgb(240,248,255)
    A->>B: closeTicket({ $, ticketId, data:{ticket_result_id} })
  end
  B->>C: POST /tickets/{ticketId}/close (body: { ticket_result_id })
  C-->>B: 200/response
  B-->>A: API response
  A->>A: $.export("$summary","Successfully closed ticket")
  A-->>User: return API response
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

  • Pay attention to: new closeTicket() request construction and path interpolation, ticketResultId prop async options resolver correctness, and consistent usage of ticket_result_id mapping in the action.
  • Spot-check version bumps for accidental logic edits.

Suggested labels

User submitted

Suggested reviewers

  • lcaresia
  • michelle0927

Pre-merge checks and finishing touches

✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the primary change: a new action to close Trengo tickets, which matches the main focus of the PR.
Description check ✅ Passed The description provides minimal information (only issue reference) but follows the template structure with the WHY section completed. The issue reference enables context lookup.
Linked Issues check ✅ Passed The PR implements the close ticket action for Trengo using the specified POST endpoint with proper parameters and API documentation reference as required by issue #19171.
Out of Scope Changes check ✅ Passed All code changes directly support the close ticket action objective. Version bumps across files are consistent with adding new functionality and updating dependencies.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch trengo-new-component-close-ticket

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.

@jcortes jcortes force-pushed the trengo-new-component-close-ticket branch from 5123954 to 8296c63 Compare November 26, 2025 21:02
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: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (3)
components/trengo/sources/new-outbound-message/new-outbound-message.mjs (1)

7-20: Version bump is fine; fix minor typo in summary.

The metadata version update to "0.0.7" looks good. There’s a minor typo in the summary string ("New outbund message event"); consider changing it to "New outbound message event" for clarity.

components/trengo/sources/phone-call-missed/phone-call-missed.mjs (1)

7-18: Version bump is fine; consider tightening description text.

The version change to "0.0.7" is fine. The description string reads a bit awkwardly ("Emit new event when an phone call missed"); consider something like "Emit a new event when a phone call is missed." to improve readability.

components/trengo/sources/new-internal-note/new-internal-note.mjs (1)

7-20: Update summary text to match “New Internal Note” semantics.

The version bump to "0.0.7" looks good. The summary currently says "New ticket label added event", which doesn’t match this being an internal note source. Consider updating it to something like "New internal note event: …" so the emitted events are self‑descriptive.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 5123954 and 8296c63.

📒 Files selected for processing (27)
  • components/trengo/actions/attach-label/attach-label.mjs (1 hunks)
  • components/trengo/actions/close-ticket/close-ticket.mjs (1 hunks)
  • components/trengo/actions/create-contact/create-contact.mjs (1 hunks)
  • components/trengo/actions/find-contacts/find-contacts.mjs (1 hunks)
  • components/trengo/actions/get-label/get-label.mjs (1 hunks)
  • components/trengo/actions/get-message/get-message.mjs (1 hunks)
  • components/trengo/actions/list-articles/list-articles.mjs (1 hunks)
  • components/trengo/actions/list-labels/list-labels.mjs (1 hunks)
  • components/trengo/actions/list-messages/list-messages.mjs (1 hunks)
  • components/trengo/actions/list-tickets/list-tickets.mjs (1 hunks)
  • components/trengo/actions/log-a-voice-call/log-a-voice-call.mjs (1 hunks)
  • components/trengo/actions/send-a-message/send-a-message.mjs (1 hunks)
  • components/trengo/actions/send-a-team-chat-message/send-a-team-chat-message.mjs (1 hunks)
  • components/trengo/actions/send-a-ticket-message/send-a-ticket-message.mjs (1 hunks)
  • components/trengo/actions/send-a-whatsapp-message-template/send-a-whatsapp-message-template.mjs (1 hunks)
  • components/trengo/package.json (1 hunks)
  • components/trengo/sources/new-inbound-message/new-inbound-message.mjs (1 hunks)
  • components/trengo/sources/new-internal-note/new-internal-note.mjs (1 hunks)
  • components/trengo/sources/new-outbound-message/new-outbound-message.mjs (1 hunks)
  • components/trengo/sources/phone-call-ended/phone-call-ended.mjs (1 hunks)
  • components/trengo/sources/phone-call-missed/phone-call-missed.mjs (1 hunks)
  • components/trengo/sources/phone-call-started/phone-call-started.mjs (1 hunks)
  • components/trengo/sources/ticket-closed/ticket-closed.mjs (1 hunks)
  • components/trengo/sources/ticket-label-added/ticket-label-added.mjs (1 hunks)
  • components/trengo/sources/ticket-reopened/ticket-reopened.mjs (1 hunks)
  • components/trengo/sources/voice-call-recorded/voice-call-recorded.mjs (1 hunks)
  • components/trengo/trengo.app.mjs (2 hunks)
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-10-20T01:01:02.970Z
Learnt from: js07
Repo: PipedreamHQ/pipedream PR: 18744
File: components/slack_v2/actions/send-large-message/send-large-message.mjs:49-64
Timestamp: 2025-10-20T01:01:02.970Z
Learning: In components/slack_v2/actions/send-large-message/send-large-message.mjs, the metadata_event_payload prop is typed as string, so the code only needs to handle string-to-JSON parsing and does not need to handle object inputs.

Applied to files:

  • components/trengo/actions/get-message/get-message.mjs
  • components/trengo/actions/send-a-message/send-a-message.mjs
  • components/trengo/actions/send-a-ticket-message/send-a-ticket-message.mjs
  • components/trengo/actions/send-a-team-chat-message/send-a-team-chat-message.mjs
  • components/trengo/actions/list-tickets/list-tickets.mjs
  • components/trengo/sources/new-outbound-message/new-outbound-message.mjs
🧬 Code graph analysis (1)
components/trengo/trengo.app.mjs (1)
components/trengo/actions/close-ticket/close-ticket.mjs (1)
  • response (30-36)
⏰ 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). (3)
  • GitHub Check: Publish TypeScript components
  • GitHub Check: Verify TypeScript components
  • GitHub Check: Lint Code Base
🔇 Additional comments (24)
components/trengo/actions/get-message/get-message.mjs (1)

7-7: Version metadata update looks correct.

The action’s version bump to "0.0.3" is consistent with the rest of the Trengo changes; no behavioral issues spotted.

components/trengo/actions/find-contacts/find-contacts.mjs (1)

7-7: Find Contacts action version bump is appropriate.

Updating the version to "0.0.8" aligns with the wider release; existing streaming implementation remains valid.

components/trengo/actions/send-a-ticket-message/send-a-ticket-message.mjs (1)

5-5: Send A Ticket Message version bump is consistent.

Raising the action version to "0.0.2" is consistent with the Trengo package update; the existing props and run implementation remain coherent.

components/trengo/actions/create-contact/create-contact.mjs (1)

6-6: Create Contact action version bump looks good.

The version increment to "0.0.8" matches the broader Trengo release and doesn’t affect the existing behavior.

components/trengo/sources/ticket-reopened/ticket-reopened.mjs (1)

7-23: Ticket Reopened source version bump is appropriate.

The source version change to "0.0.5" is consistent with the rest of the Trengo updates. The existing getMeta implementation (ID/ts/summary) remains valid.

components/trengo/actions/list-messages/list-messages.mjs (1)

8-8: Version bump only – behavior unchanged

The version metadata increment to 0.0.5 is consistent with the rest of the Trengo actions and does not alter runtime behavior.

components/trengo/actions/list-labels/list-labels.mjs (1)

8-8: List Labels action version bump looks good

Incrementing the version to 0.0.3 aligns with the broader Trengo action updates and doesn’t affect behavior.

components/trengo/actions/list-articles/list-articles.mjs (1)

7-7: List Articles action metadata-only change

The version update to 0.0.6 is purely metadata and keeps the existing list-articles behavior intact.

components/trengo/actions/get-label/get-label.mjs (1)

7-7: Get Label action version increment is safe

Updating the version to 0.0.3 is consistent with other Trengo actions and introduces no behavioral changes.

components/trengo/actions/attach-label/attach-label.mjs (1)

7-7: Attach Label action version bump aligns with suite

The version change to 0.0.3 is metadata-only and keeps the attach-label behavior unchanged.

components/trengo/actions/list-tickets/list-tickets.mjs (1)

8-8: List Tickets action version update is non-breaking

The version bump to 0.0.5 matches other Trengo actions and does not modify the list-tickets behavior.

components/trengo/sources/voice-call-recorded/voice-call-recorded.mjs (1)

7-7: Voice Call Recorded source version bump is fine

Raising the version to 0.0.6 is a metadata-only change; webhook handling and dedupe behavior are unchanged.

components/trengo/actions/send-a-whatsapp-message-template/send-a-whatsapp-message-template.mjs (1)

7-7: Send WhatsApp Message Template action – version bump only

The version update to 0.0.8 is consistent with related actions and doesn’t affect the existing validation or request logic.

components/trengo/actions/send-a-team-chat-message/send-a-team-chat-message.mjs (1)

7-7: Version bump looks good.

The version increment aligns with the package-level version bump to 0.6.0.

components/trengo/sources/phone-call-ended/phone-call-ended.mjs (1)

7-7: Version bump looks good.

The version increment aligns with the package-level version bump to 0.6.0.

components/trengo/sources/phone-call-started/phone-call-started.mjs (1)

7-7: Version bump looks good.

The version increment aligns with the package-level version bump to 0.6.0.

components/trengo/sources/new-inbound-message/new-inbound-message.mjs (1)

7-7: Version bump looks good.

The version increment aligns with the package-level version bump to 0.6.0.

components/trengo/actions/send-a-message/send-a-message.mjs (1)

6-6: Version bump looks good.

The version increment aligns with the package-level version bump to 0.6.0.

components/trengo/package.json (1)

3-3: Package version bump is appropriate.

The minor version increment (0.5.0 → 0.6.0) correctly reflects the addition of new functionality (close ticket action) following semantic versioning conventions.

components/trengo/actions/log-a-voice-call/log-a-voice-call.mjs (1)

6-6: Version bump looks good.

The version increment aligns with the package-level version bump to 0.6.0.

components/trengo/sources/ticket-label-added/ticket-label-added.mjs (1)

7-7: Version bump looks good.

The version increment aligns with the package-level version bump to 0.6.0.

components/trengo/sources/ticket-closed/ticket-closed.mjs (1)

7-7: Version bump is appropriate and non-breaking

Patch version increment for this source is fine and does not affect runtime behavior.

components/trengo/trengo.app.mjs (2)

211-227: ticketResultId prop definition is consistent with existing patterns

The prop mirrors other ID props (pagination via page + 1, mapping name → label and id → value) and cleanly delegates to listTicketResults, so it should integrate well with the new action.


391-405: New closeTicket / listTicketResults helpers align with the rest of the app surface

Both helpers correctly reuse _makeRequest, match the existing naming conventions, and keep the interface minimal by passing through ticketId and other config, so they’re easy to consume from actions.

Copy link
Collaborator

@lcaresia lcaresia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@vunguyenhung
Copy link
Collaborator

Hi everyone, all test cases are passed! Ready for release!

Test reports

@jcortes jcortes merged commit e78a749 into master Nov 27, 2025
10 checks passed
@jcortes jcortes deleted the trengo-new-component-close-ticket branch November 27, 2025 19:06
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] Trengo - tickets

4 participants