feat(import): trello attachment upload + non-interactive import script#1
Open
feat(import): trello attachment upload + non-interactive import script#1
Conversation
- 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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
TrelloJsonImporternow accepts Trello API credentials and downloads card attachments using OAuth headers (Trello requires auth for binary downloads)attachments-cache/next to the JSON export) so re-runs don't re-downloadreaddirSyncscan upfront (O(1) map) instead of per-fileexistsSynccallsimportIssues.tsuploads each attachment to Linear's asset storage and replaces Trello URLs in the issue description with Linear CDN URLsupdateIssueis always called after uploads to overwrite any broken embeds thatcreateIssuemay have baked inNon-interactive scripts
run-trello-import.mjs: reads.env, resolves team by key or UUID, resolves project byLINEAR_PROJECT_URL, supports--dry-runand resume-on-interrupt viaimport-progress.jsonpatch-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
IssueAttachmentadded totypes.tswithtrelloUrl,name,data: Buffer,mimeTypeDocs & config
TRELLO_API_SETUP.mdwith step-by-step credential guide.gitignorefor import package (excludes.env, progress/cache files, debug scripts).env.examplewith all supported variables