Add first-class issue attachment download support#48
Merged
Conversation
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
Adds first-class issue attachment discovery and download support for #47.
Implemented user-facing flows:
linctl issue attachment list <issue-id>lists canonical Linear attachments plusuploads.linear.applinks found in issue descriptions and recent comments.linctl issue attachment download <issue-id>downloads a single attachment automatically when there is only one entry.linctl issue attachment download <issue-id> --all --output-dir <dir>downloads all downloadable entries.linctl issue attachment download <issue-id> --id <attachment-id>selects a canonical attachment by ID.linctl issue attachment download <issue-id> --name <filename> --output <path>selects by title or URL filename and writes to a specific path.linctl issue get <issue-id> --download-attachments --output-dir <dir>fetches issue details and downloads attachments in one command.Behavior notes:
--allinstead of failing the whole operation.Content-Disposition, attachment title, or URL path and sanitized before writing.uploads.linear.appdownloads, not arbitrary external attachment URLs.Docs and tests:
cmd/issue_cmd_test.gofor upload URL extraction, entry collection, selector behavior, skipped non-downloadable links, failure detection, flag registration, and auth-header handling for external downloads.Closes #47
Testing
go test ./...go run . issue attachment --helpgo run . issue get --helpNot Tested
uploads.linear.appattachment. The code path is covered with unit tests, but this environment does not have a live Linear attachment fixture.