feat(attachments): work item attachments and inline description images - #12
Open
Liewzheng wants to merge 4 commits into
Open
feat(attachments): work item attachments and inline description images#12Liewzheng wants to merge 4 commits into
Liewzheng wants to merge 4 commits into
Conversation
Add an `attachment` sub-app with `attach`/`ls` commands, backed by a
three-step upload flow (register for a presigned S3 URL, PUT the binary,
PATCH is_uploaded and verify the write — see ADRs 0003 and 0007).
Duplicate asset names are rejected unless the user confirms.
`wi create`/`wi update` gain repeatable `-i/--image` flags that upload an
image and append it to the description. The img src stores only the
asset UUID — the web editor resolves it via getAssetSrc, so storing a
full path breaks image rendering ("Error loading image").
The v2 app upload endpoint (ISSUE_DESCRIPTION) is preferred and
automatically falls back to v1 when the server rejects API-token auth;
asset UUIDs stay interchangeable across both paths.
comment create/update wrapped the whole body in a single p tag; the editor collapses whitespace inside a paragraph, so multi-line comments (numbered items, link lists) rendered as one long line. Blank lines now split into separate paragraphs, single newlines become br tags.
The API stores comment HTML verbatim and does not auto-link URLs — only the web editor does — so links posted via the CLI rendered as plain text. Bare http(s) URLs now become anchors; trailing sentence punctuation stays outside the link, and URLs already inside an anchor are left alone.
The editor stores HTML and does not parse markdown, so `branch` and fenced blocks posted via the CLI showed literal backticks. Inline code becomes an escaped code tag (never linkified); fenced blocks become pre-wrapped code and keep their own paragraph.
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.
What
Adds work item attachment support and inline description images:
attachmentsub-app (registered inapp.py)attachment attach -p <project> <issue> -f <file>— uploads a file via the API's three-step flow: register an asset (presigned S3 URL) →PUTthe binary →PATCH is_uploaded=true, then re-read the asset to verify the write (per ADR-0007, a200is not always a write). If an asset with the same name already exists on the issue, the user must confirm (or pass--force); non-interactive runs are rejected.attachment ls -p <project> <issue>— lists assets on the issue.wi create/wi update: repeatable-i/--imageflag uploads an image and appends it to the description.wi createcreates the issue first, uploads, then patches the description.Conventions followed
cached_list_*reads andinvalidate_resource("attachment", ...)after mutations, matching ADR-0004.NOTE:comments, per ADR-0003.imgtag'ssrcstores only the asset UUID — the web editor resolves it at render time; a full path renders as "Error loading image".Tests
make check— 196 passed (16 new intests/test_commands/test_attachments.py), lint clean.Closes #11