Repository navigation
feat(comment): expand comment subcommand to full CRUD - #112
Merged
Merged
Conversation
Extend the comment command group to full CRUD so routine comment edits no longer require raw Jira REST calls (#81). - list: table of comments (id, author, date, first body line) with global --format json support - show: full body of a single comment - update: replace the body; without text the editor opens prefilled with the current body (parity with comment add) - delete: confirmation prompt, --force to skip Jira often reports missing delete/edit permission as a 400 error instead of 403; CommentService maps both to PermissionError and points to comment update as the reliable path.
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
Closes #81.
The
commentcommand group previously exposed onlyadd. This PR converges it to the CRUD shape of the other subcommands so routine comment edits no longer require raw Jira REST calls:comment list <issue-key>— table of comments (id, author, creation date, first body line); supports the global--format jsoncomment show <issue-key> <comment-id>— full comment body (also JSON-capable)comment update <issue-key> <comment-id> [TEXT] [--editor]— replaces the body; exact parity withcomment add: without TEXT the editor opens prefilled with the current body, so fixing wording in place is one commandcomment delete <issue-key> <comment-id> [--force]— confirmation prompt, mirroringtempo delete-worklogField notes from #81 addressed
updateis the high-value operation — the editor prefill makes "tighten the phrasing of a posted status comment" the smoothest path.400 {"errorMessages":["You do not have permission to delete comment with id: ..."]}rather than 403.CommentServicemaps both 403 and the 400 permission variant to a clearPermissionErrorwhose message points atbudjira comment update <key> <id>as the reliable fallback. README and AI usage prompt document the same guidance.Implementation notes
CommentServiceextended withlist/get/update/deleteon top of thejiralibrary (client.comments(),client.comment(),Comment.update(body=...),Comment.delete()); error mapping follows the existingBaseJiraServicepattern.comment add— the description dialect (Descriptions authored in wiki markup are rewritten on upload (# ordered lists become h1) #106) applies to descriptions only.Tests & quality
tests/services/test_comments.py): happy paths, 404/403/500 mappings, the 400-permission quirk for both update and delete, unexpected-error wrappingtests/cli/test_comment.py): table/JSON output, editor prefill behavior, abort on empty editor without API call, confirm/cancel/--forceflows, permission error surfacing the update hintpre-commit run --all-filesgreen (ruff, mypy strict, bandit, pytest-cov, AI prompt freshness)Docs: README comment section, AI prompt template + regenerated
.claude/ai-usage-prompt.md(separate commit per hook rule),context.md. Also includes a tinychore(deps)commit syncing uv.lock with project version 1.23.0 (drift from the last bump).