IW-610: iw issue reports and prints an issue's comments #728

Merged
mph merged 23 commits from IW-610 into main 2026-10-07 07:32:01 +00:00
Member

Summary

iw issue <id> now tells a reader that an issue has comments, and can print them.

  • When the tracker reports a positive comment count, the status block shows Comments: N (iw issue <id> --comments). A count that is zero or not known prints no line — "none" and "not known" stay different facts.
  • --comments prints every comment after the issue, oldest first, with author and UTC time. Author and body pass through TerminalSafeText.strip.
  • All five trackers: Forgejo, GitHub, GitLab, Linear, YouTrack. If the issue or comment fetch fails, stdout stays empty and the command exits 1.

Changes

  • Domain: Issue.commentCount: Option[Int], new IssueComment with oldest-first ordering.
  • Infrastructure: each adapter reads the count from the issue payload (GitHub and Linear derive it from the comment list) and gets a paged comment-list fetch. Linear paging has a repeated-cursor guard and a page cap; GitLab uses glab api --paginate --output ndjson and drops system notes.
  • Application: --comments switch in core/commands/Issue.scala, comment fetch through CommandEnv/TrackerOps.
  • Presentation: IssueFormatter.format count line and IssueFormatter.formatComments.

Phase PRs: #694 (comment model + tracker adapters), #695 (--comments command + formatter).

Testing

  • Unit: adapter parser tests for all five trackers, IssueCommentTest, IssueFormatterTest, IssueHarnessTest for the command paths.
  • Contract: gh and glab adapter probes extended.
  • E2E: test/forgejo-issue.bats, test/gitlab-issue.bats.
  • CI ran the full suite on each phase PR.

Review packet: project-management/issues/IW-610/review-packet.md.
Follow-ups filed: #699, #700, #701; comments on #456 and #552.

Release notes

See project-management/issues/IW-610/release-notes.md (Czech).

Closes #610

🤖 Generated with Claude Code

## Summary `iw issue <id>` now tells a reader that an issue has comments, and can print them. - When the tracker reports a positive comment count, the status block shows `Comments: N (iw issue <id> --comments)`. A count that is zero or not known prints no line — "none" and "not known" stay different facts. - `--comments` prints every comment after the issue, oldest first, with author and UTC time. Author and body pass through `TerminalSafeText.strip`. - All five trackers: Forgejo, GitHub, GitLab, Linear, YouTrack. If the issue or comment fetch fails, stdout stays empty and the command exits 1. ## Changes - Domain: `Issue.commentCount: Option[Int]`, new `IssueComment` with oldest-first ordering. - Infrastructure: each adapter reads the count from the issue payload (GitHub and Linear derive it from the comment list) and gets a paged comment-list fetch. Linear paging has a repeated-cursor guard and a page cap; GitLab uses `glab api --paginate --output ndjson` and drops system notes. - Application: `--comments` switch in `core/commands/Issue.scala`, comment fetch through `CommandEnv`/`TrackerOps`. - Presentation: `IssueFormatter.format` count line and `IssueFormatter.formatComments`. Phase PRs: #694 (comment model + tracker adapters), #695 (`--comments` command + formatter). ## Testing - Unit: adapter parser tests for all five trackers, `IssueCommentTest`, `IssueFormatterTest`, `IssueHarnessTest` for the command paths. - Contract: gh and glab adapter probes extended. - E2E: `test/forgejo-issue.bats`, `test/gitlab-issue.bats`. - CI ran the full suite on each phase PR. Review packet: `project-management/issues/IW-610/review-packet.md`. Follow-ups filed: #699, #700, #701; comments on #456 and #552. ## Release notes See `project-management/issues/IW-610/release-notes.md` (Czech). Closes #610 🤖 Generated with [Claude Code](https://claude.com/claude-code)
iw issue can neither report nor print an issue's comments, so a reader cannot know a decision is in one

Artifacts:
- analysis.md
- issue.md

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
iw issue can neither report nor print an issue's comments, so a reader cannot know a decision is in one

Artifacts:
- tasks.md
- review-state.json (tasks_ready)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Issue: IW-610
Phase: 1 - Comment model + tracker adapters

This commit marks the checkpoint for phase 1 context generation.
Use wf-implement IW-610 to return to this point.

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Comment model + tracker adapters

Artifacts:
- phase-01-tasks.md

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Issue: IW-610
Phase: 2 - --comments command + formatter

This commit marks the checkpoint for phase 2 context generation.
Use wf-implement IW-610 to return to this point.

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
--comments command + formatter

Artifacts:
- phase-02-tasks.md

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The help claimed iw issue prints a URL; it prints title, status,
assignee and description. PURPOSE lines now name formatComments and
--comments.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LSefu2qCBPDzLjnvk1pMAr
Follow-ups filed: 3 (#699, #700, #701), commented: 2 (#456, #552), struck: 0
Fixed in branch: 2 (iw issue help text, PURPOSE lines — b1630126)
Lessons: 0 approved, 1 rejected, 0 still pending

Rejected:
- Exporting a missing env var does not reach an already-running Mill daemon: machine setup problem, already fixed

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LSefu2qCBPDzLjnvk1pMAr
# Conflicts:
#	core/adapters/ForgejoClient.scala
#	core/adapters/LinearClient.scala
#	core/commands/Issue.scala
#	core/test/ForgejoClientTest.scala
#	core/test/IssueHarnessTest.scala
#	core/test/fixtures/FakeCommandEnv.scala
#	test/forgejo-issue.bats
docs(IW-610): review packet and release notes
All checks were successful
CI / changes (pull_request) Successful in 5s
CI / contract (pull_request) Has been skipped
CI / format (pull_request) Successful in 11s
CI / lint (pull_request) Successful in 15s
CI / compile (pull_request) Successful in 1m42s
CI / dashboard-build (pull_request) Successful in 1m29s
CI / test (pull_request) Successful in 18m32s
b020d5fd9f
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
mph merged commit 225fd28919 into main 2026-10-07 07:32:01 +00:00
Sign in to join this conversation.
No description provided.