Repository navigation
feat(attachments): work item attachments and inline description images - #12
Conversation
|
Thanks for this. I've been running it on a fork. Two tests fail on a machine with no Plane config (
Both changes are in commit cf8115c on nogara/plane-cli |
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.
…d last, enrich once (cpatrickalves#11) wi create -i sent no description in the create call and enriched the item twice (blank priority, doubled sequence_id prefix). wi update -i uploaded before resolving state and labels. Both now check every -i path before any API call, and --force leaves wi create, where a new item has no attachments to collide with.
…prompt in ADR-0008 (cpatrickalves#11)
…ckalves#11) Some Plane servers reject text/markdown with 400 "Invalid file type.", and platforms without /etc/mime.types know none of these extensions. text/plain is accepted everywhere.
…items and test gaps (cpatrickalves#11) A storage timeout or refused connection now exits 4 instead of a traceback. attachment ls hides deleted attachments, as the duplicate guard already did, and keeps a top-level name when attributes lack one. A file named just .md uploads as text/plain. wi create resolves --module before creating the item. Tests: load the MIME table before patching os.path.isfile/open (four tests hung when run alone), assert the register and PATCH payloads and the exact error messages, and cover the TTY answer through upload_attachment, the 401/403/404 fallback with --force, the deleted-duplicate case and the remaining exit codes.
…the exit-4 mapping (cpatrickalves#11)
df13a92 to
b898f2c
Compare
|
@Liewzheng thanks for this feature. A heads-up before it merges: I rebased your branch onto
If you have local work on |
cpatrickalves
left a comment
There was a problem hiding this comment.
Approved after the rebase and review fixes: make check, CI on 3.11–3.13 and a live run against a self-hosted Plane pass.
Summary
Closes #11. Rebased onto
main(v0.6.0). The three comment-converter commits are dropped, becausemainalready hasutils/body_html.py; #40 tracks the work they covered. @Liewzheng's commit is kept as is, and the review fixes sit on top of it.Review fixes on top of the original commit:
-dis kept in the create call. Before,wi create -d ... -icreated the item with no description, and a failed upload left it that way.priorityand doubled the prefix (ABC-ABC-5)..md,.markdownand.logupload astext/plain. A self-hosted server rejectedtext/markdownwith400 Invalid file type.attachment lshides deleted attachments.wi createloses--force, since a new item can't have duplicate names. Onwi update, the help says--forceonly applies to the v1 fallback.wi create --moduleis resolved before the create, so a mistyped module no longer leaves an item behind.NOTE:.skills/(version 1.9.x), the command reference, CHANGELOG anddocs/caching.mdare updated.Evidence
uv run pytest tests/test_commands/test_attachments.pywith no Plane config gave1 failed, 13 passed:test_attach_rejects_missing_fileraisedAuthenticationError: Missing base URL.ruff format --checkflagged 3 files.After:
make checkpasses with noPLANE_*vars and no~/.plane_api: 304 tests pass, plus lint and format-check.wi create "Bug" -p P --priority high -d "Steps" -i shot.png --jsonreturned"priority": ""and a description without<p>Steps</p>.After: live run against a self-hosted Plane:
The test item was deleted afterwards.
Merge Danger
Door: two-way. Everything is new code paths and docs, with no schema or cache changes. The one thing that's hard to take back is the
attachmentcommand name and its--jsonshape (name,typeandsizeat the top level), which scripts will start to depend on.Blast Radius: small.
Existing commands change in two places:
wi create/wi updategain-i/--image, andwi create --modulenow resolves before the item is created. Without-i,-dbehaves exactly as before.