Skip to content

feat(import): trello attachment upload + non-interactive import script#1

Open
Jolg42 wants to merge 1 commit intomasterfrom
feat/trello-attachment-upload
Open

feat(import): trello attachment upload + non-interactive import script#1
Jolg42 wants to merge 1 commit intomasterfrom
feat/trello-attachment-upload

Conversation

@Jolg42
Copy link
Copy Markdown
Member

@Jolg42 Jolg42 commented Mar 25, 2026

Summary

Extends the Trello JSON importer with full attachment support and a non-interactive run script suitable for large board migrations.

Changes

Attachment upload pipeline

  • TrelloJsonImporter now accepts Trello API credentials and downloads card attachments using OAuth headers (Trello requires auth for binary downloads)
  • Attachments are cached to disk (attachments-cache/ next to the JSON export) so re-runs don't re-download
  • Cache lookup uses a single readdirSync scan upfront (O(1) map) instead of per-file existsSync calls
  • importIssues.ts uploads each attachment to Linear's asset storage and replaces Trello URLs in the issue description with Linear CDN URLs
  • Inline images are preserved at their original position; updateIssue is always called after uploads to overwrite any broken embeds that createIssue may have baked in

Non-interactive scripts

  • run-trello-import.mjs: reads .env, resolves team by key or UUID, resolves project by LINEAR_PROJECT_URL, supports --dry-run and resume-on-interrupt via import-progress.json
  • patch-trello-urls.mjs: scans all issues in a project for remaining Trello attachment URLs and replaces them (for issues created before upload support existed)

New types

  • IssueAttachment added to types.ts with trelloUrl, name, data: Buffer, mimeType

Docs & config

  • README updated with non-interactive workflow documentation
  • TRELLO_API_SETUP.md with step-by-step credential guide
  • .gitignore for import package (excludes .env, progress/cache files, debug scripts)
  • .env.example with all supported variables

- download Trello card attachments with OAuth auth and disk cache; re-upload
  to Linear asset storage and replace all Trello URLs in issue descriptions
  with Linear CDN URLs, preserving inline images at their original position
- add run-trello-import.mjs: non-interactive CLI that reads .env, resolves
  team by key or UUID, resolves project by LINEAR_PROJECT_URL, supports
  --dry-run and resume-on-interrupt via import-progress.json
- add patch-trello-urls.mjs: retroactively fixes existing issues that still
  contain Trello attachment URLs (configurable via .env)
- add IssueAttachment type to types.ts
- TrelloJsonImporter: accepts Trello API credentials, caches attachments to
  disk, uses a single readdirSync cache-map to avoid per-file existsSync
- importIssues.ts: skip replaceImagesInMarkdown for issues with attachments;
  always overwrite description via updateIssue after attachment upload so
  broken embeds from createIssue are replaced with correct Linear asset URLs
- add .gitignore for import package
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.

1 participant