Skip to content

feat(comment): expand comment subcommand to full CRUD - #112

Merged
f3rdy merged 4 commits into
masterfrom
feat/issue-81-comment-crud
Aug 24, 2026
Merged

f3rdy merged 4 commits into
masterfrom
feat/issue-81-comment-crud

Conversation

@f3rdy

@f3rdy f3rdy commented Aug 23, 2026

Copy link
Copy Markdown
Contributor

Summary

Closes #81.

The comment command group previously exposed only add. 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 json
  • comment show <issue-key> <comment-id> — full comment body (also JSON-capable)
  • comment update <issue-key> <comment-id> [TEXT] [--editor] — replaces the body; exact parity with comment add: without TEXT the editor opens prefilled with the current body, so fixing wording in place is one command
  • comment delete <issue-key> <comment-id> [--force] — confirmation prompt, mirroring tempo delete-worklog

Field notes from #81 addressed

  • update is the high-value operation — the editor prefill makes "tighten the phrasing of a posted status comment" the smoothest path.
  • Delete is frequently not permitted. Jira reports this as 400 {"errorMessages":["You do not have permission to delete comment with id: ..."]} rather than 403. CommentService maps both 403 and the 400 permission variant to a clear PermissionError whose message points at budjira comment update <key> <id> as the reliable fallback. README and AI usage prompt document the same guidance.

Implementation notes

Tests & quality

  • 22 new service tests (tests/services/test_comments.py): happy paths, 404/403/500 mappings, the 400-permission quirk for both update and delete, unexpected-error wrapping
  • 17 new CLI tests (tests/cli/test_comment.py): table/JSON output, editor prefill behavior, abort on empty editor without API call, confirm/cancel/--force flows, permission error surfacing the update hint
  • Full suite: 1034 passed, coverage 87.4%; pre-commit run --all-files green (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 tiny chore(deps) commit syncing uv.lock with project version 1.23.0 (drift from the last bump).

f3rdy added 4 commits August 23, 2026 15:41
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.
@f3rdy
f3rdy merged commit a6e27ce into master Aug 24, 2026
5 checks passed
@f3rdy
f3rdy deleted the feat/issue-81-comment-crud branch August 24, 2026 04:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(comment): expand comment subcommand to full CRUD

1 participant