Skip to content

Conversation

@michelle0927
Copy link
Collaborator

@michelle0927 michelle0927 commented Sep 30, 2025

Resolves #18491

Summary by CodeRabbit

  • New Features

    • Added a Freshdesk action to download ticket attachments.
    • Lets you pick an attachment from a ticket and download it as a file.
    • Returns the saved file path plus attachment metadata for downstream use.
  • Chores

    • Bumped Freshdesk package version to 0.5.0.

@vercel
Copy link

vercel bot commented Sep 30, 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 Sep 30, 2025 4:41pm
pipedream-docs-redirect-do-not-edit Ignored Ignored Sep 30, 2025 4:41pm

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Sep 30, 2025

Walkthrough

Adds a new Freshdesk action to download a ticket attachment (fetches ticket, selects attachment, downloads binary, writes to /tmp) and bumps the Freshdesk component version to 0.5.0.

Changes

Cohort / File(s) Summary
Freshdesk download attachment action
components/freshdesk/actions/download-attachment/download-attachment.mjs
New action module exporting a default object with props (freshdesk, ticketId, attachmentId, syncDir), method listTicketAttachments(opts), and run entry. Fetches ticket attachments, resolves the chosen attachment, downloads via axios as arraybuffer, writes a Buffer to /tmp, and returns file data plus attachment metadata.
Package metadata
components/freshdesk/package.json
Package version bumped from 0.4.0 to 0.5.0.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor User
  participant Action as Download Attachment Action
  participant Freshdesk as Freshdesk API
  participant HTTP as axios
  participant FS as fs (/tmp)

  User->>Action: invoke run({ ticketId, attachmentId, syncDir })
  Action->>Freshdesk: getTicket(ticketId)
  Freshdesk-->>Action: ticket (with attachments[])
  Action->>Action: find attachment by id (or prompt via listTicketAttachments)
  Action->>HTTP: GET attachment.attachment_url (responseType: arraybuffer)
  HTTP-->>Action: binary data (arraybuffer)
  Action->>Action: Buffer.from(arraybuffer)
  Action->>FS: writeFileSync(/tmp/<name>, Buffer)
  FS-->>Action: write confirmed
  Action-->>User: return [name, path] and attachment metadata
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

I hop to the ticket, nose to the trace,
Find a tucked-away attachment, hidden in place.
I nibble the bytes and stash them with care,
/tmp holds the treasure I carried back here.
Happy hare, file in paw — go fetch, if you dare! 🐇💾

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Description Check ⚠️ Warning The pull request description only includes “Resolves #18491” and does not populate the required “## WHY” section from the repository’s description template, leaving out the motivation and context for the change. Please update the description to include the “## WHY” section and explain the motivation, context, and intended impact of the new download-attachment action in line with the repository’s template.
✅ Passed checks (4 passed)
Check name Status Explanation
Title Check ✅ Passed The pull request title succinctly identifies the addition of a Freshdesk download-attachment action, directly reflecting the core functionality introduced in this changeset.
Linked Issues Check ✅ Passed The implementation adds a download-attachment action that accepts ticketId and attachmentId props, uses the Freshdesk API to list and fetch attachments, downloads the specified file via axios, and returns the file path and metadata, fully satisfying the requirements of issue #18491.
Out of Scope Changes Check ✅ Passed All code changes are focused on adding the new download-attachment action and updating the package version, and there are no modifications outside the scope of implementing Freshdesk attachment download support.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch issue-18491

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 7cb15c9 and 5718d79.

📒 Files selected for processing (1)
  • components/freshdesk/actions/download-attachment/download-attachment.mjs (1 hunks)
⏰ 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: pnpm publish
  • GitHub Check: Lint Code Base
  • GitHub Check: Publish TypeScript components
  • GitHub Check: Verify TypeScript components
🔇 Additional comments (2)
components/freshdesk/actions/download-attachment/download-attachment.mjs (2)

1-3: LGTM!

The imports are appropriate for the action's functionality.


39-46: LGTM!

The helper method correctly fetches and returns ticket attachments.


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
🧪 Early access (Sonnet 4.5): enabled

We are currently testing the Sonnet 4.5 model, which is expected to improve code review quality. However, this model may lead to increased noise levels in the review comments. Please disable the early access features if the noise level causes any inconvenience.

Note:

  • Public repositories are always opted into early access features.
  • You can enable or disable early access features from the CodeRabbit UI or by updating the CodeRabbit configuration file.

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: 5

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 61d0151 and 7cb15c9.

📒 Files selected for processing (2)
  • components/freshdesk/actions/download-attachment/download-attachment.mjs (1 hunks)
  • components/freshdesk/package.json (1 hunks)
⏰ 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: pnpm publish
  • GitHub Check: Publish TypeScript components
  • GitHub Check: Lint Code Base
  • GitHub Check: Verify TypeScript components
🔇 Additional comments (5)
components/freshdesk/package.json (1)

3-3: LGTM! Appropriate version bump for new feature.

The minor version increment from 0.4.0 to 0.5.0 correctly reflects the addition of a new action capability.

components/freshdesk/actions/download-attachment/download-attachment.mjs (4)

1-10: LGTM! Well-structured action metadata.

The imports, key, name, description, and version are appropriate for this action.


13-18: LGTM! Proper prop definition for ticket selection.

The ticketId prop correctly leverages the prop definition from the Freshdesk app.


19-32: LGTM! Dynamic attachment selection.

The attachmentId prop with async options provides a good UX by allowing users to select from available attachments.


40-46: LGTM! Clean method to fetch ticket attachments.

The listTicketAttachments method appropriately delegates to the Freshdesk app's getTicket method and returns the attachments array.

@vunguyenhung vunguyenhung merged commit 315b385 into master Oct 1, 2025
10 checks passed
@vunguyenhung vunguyenhung deleted the issue-18491 branch October 1, 2025 01:50
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.

[APP] Freshdesk get attachment

4 participants