feat: add comment moderation CLI #89

Merged
erik merged 1 commit from feat/task-593beb41-comment-cli into main 2026-06-03 23:20:51 -05:00
Owner

Summary

Implement comment listing and moderation commands for the Slugkit CLI using the approved singular comment command structure.

Task

#task-593beb41

Changes

  • Add slug comment list [--post <slug>] [--status pending|approved|hidden|all] [--json]
  • Add slug comment approve <id> [--json] and slug comment hide <id> [--json]
  • Route post-scoped listing to /posts/{slug}/comments and pending/all listing to /comments
  • Display target API before human moderation mutations
  • Preserve valid JSON output for list and moderation commands
  • Add mocked CLI coverage for success, filtering, JSON, missing resources, auth/network/API failures, 501, and invalid usage

Testing

  • Unit tests added/updated
  • Manual testing performed

Checklist

  • ./scripts/pre-pr.sh passes
  • Documentation updated (CLI help)
  • No unrelated changes included
## Summary Implement comment listing and moderation commands for the Slugkit CLI using the approved singular `comment` command structure. ## Task #task-593beb41 ## Changes - Add `slug comment list [--post <slug>] [--status pending|approved|hidden|all] [--json]` - Add `slug comment approve <id> [--json]` and `slug comment hide <id> [--json]` - Route post-scoped listing to `/posts/{slug}/comments` and pending/all listing to `/comments` - Display target API before human moderation mutations - Preserve valid JSON output for list and moderation commands - Add mocked CLI coverage for success, filtering, JSON, missing resources, auth/network/API failures, `501`, and invalid usage ## Testing - [x] Unit tests added/updated - [ ] Manual testing performed ## Checklist - [x] `./scripts/pre-pr.sh` passes - [x] Documentation updated (CLI help) - [x] No unrelated changes included
feat: add comment moderation CLI
All checks were successful
CI / build-lint-test (pull_request) Successful in 30s
ff33189756
Task: #task-593beb41
Author
Owner

PR Review

Summary

Reviewed PR #89 against task task-593beb41, with the approved command-structure override to use singular slug comment ... commands instead of the original spec examples. The PR adds comment listing, pending queue listing, approve/hide moderation commands, JSON output, target display for human moderation mutations, and mocked CLI tests for success and common failures.

Acceptance criteria

  • Can list comments for a post. — slug comment list --post <slug> routes to /posts/{slug}/comments; tests assert path, status filter, auth header, and output.
  • Can list pending comments. — slug comment list --status pending routes to /comments?status=pending; tests assert valid JSON output.
  • Can approve a comment. — slug comment approve <id> posts to /comments/{id}/approve; tests assert path and output.
  • Can hide a comment. — slug comment hide <id> posts to /comments/{id}/hide; tests assert path and JSON output.
  • Missing posts/comments display a clear error. — tests cover missing post and missing comment API messages.
  • JSON output is valid when requested. — tests parse JSON output for list and hide moderation.
  • 501 Not Implemented responses are displayed clearly. — tests assert clear propagated message.
  • Tests cover success and common API errors. — tests cover success, auth, network, not found, 501, and invalid usage.
  • Relevant lint/test checks pass. — ./scripts/pre-pr.sh passed locally and Forgejo CI succeeded.

Blocking issues

None.

Warnings

None.

Verification

  • ./scripts/pre-pr.sh passed locally.
  • Forgejo CI status for CI / build-lint-test (pull_request) is success.

Verdict

Approved. Ready for human merge approval.

## PR Review ### Summary Reviewed PR #89 against task `task-593beb41`, with the approved command-structure override to use singular `slug comment ...` commands instead of the original spec examples. The PR adds comment listing, pending queue listing, approve/hide moderation commands, JSON output, target display for human moderation mutations, and mocked CLI tests for success and common failures. ### Acceptance criteria - [x] Can list comments for a post. — `slug comment list --post <slug>` routes to `/posts/{slug}/comments`; tests assert path, status filter, auth header, and output. - [x] Can list pending comments. — `slug comment list --status pending` routes to `/comments?status=pending`; tests assert valid JSON output. - [x] Can approve a comment. — `slug comment approve <id>` posts to `/comments/{id}/approve`; tests assert path and output. - [x] Can hide a comment. — `slug comment hide <id>` posts to `/comments/{id}/hide`; tests assert path and JSON output. - [x] Missing posts/comments display a clear error. — tests cover missing post and missing comment API messages. - [x] JSON output is valid when requested. — tests parse JSON output for list and hide moderation. - [x] `501 Not Implemented` responses are displayed clearly. — tests assert clear propagated message. - [x] Tests cover success and common API errors. — tests cover success, auth, network, not found, `501`, and invalid usage. - [x] Relevant lint/test checks pass. — `./scripts/pre-pr.sh` passed locally and Forgejo CI succeeded. ### Blocking issues None. ### Warnings None. ### Verification - `./scripts/pre-pr.sh` passed locally. - Forgejo CI status for `CI / build-lint-test (pull_request)` is `success`. ### Verdict Approved. Ready for human merge approval.
erik merged commit 14a9247541 into main 2026-06-03 23:20:51 -05:00
erik deleted branch feat/task-593beb41-comment-cli 2026-06-03 23:20:51 -05:00
Sign in to join this conversation.
No description provided.