Skip to content

jira: add read and list support for the per-issue layout - #370

Open
anish749 wants to merge 1 commit into
mainfrom
worktree-jira-read-list
Open

jira: add read and list support for the per-issue layout#370
anish749 wants to merge 1 commit into
mainfrom
worktree-jira-read-list

Conversation

@anish749

@anish749 anish749 commented May 5, 2026

Copy link
Copy Markdown
Owner

Problem

After #365 split Jira issues from comments into per-issue directories, two read-side gaps remained:

  • pigeon list -p jira -a X fell through to s.ListConversations and printed top-level project keys (ENG, OPS) as if they were conversations.
  • pigeon read -p jira -a X -c KEY fell through to the slack/whatsapp conversation flow and silently failed.

Solution

  • paths.JiraIssueFile: add Key() and CommentsFile() so the per-issue dir name and sibling-comments fact stay inside the typed registry.
  • paths.JiraIssueFileGlobs / JiraIssueFileGlobsForKey: expose the rg glob shape (mirrors DriveMetaFileGlobsSince).
  • read.ListJiraIssues / FindJiraIssue: discovery via GlobFiles, results routed through paths.Classify to typed JiraIssueFile values — no path-string manipulation in consumers.
  • commands/list.go listJiraAccount: prints flat issue keys.
  • commands/read.go runReadJira: streams issue.jsonl + comments.jsonl through modelv1.Parse/Marshal. The round-trip validates structure on read; missing comments.jsonl is tolerated. Rejects --date/--last/--since upfront.

Tests

  • paths/jira_test.go: Key(), CommentsFile(), glob shape.
  • read/jira_test.go: List + Find with on-disk fixture, ambiguous-cross-projects guard.
  • commands/list_test.go, commands/read_test.go: end-to-end via PIGEON_DATA_DIR override; streamModelLines parse-error and tolerate-missing cases.

go test ./..., go vet ./..., gofmt clean.

Context

Replaces #325, which was built against the pre-#365 single-file-per-issue layout and is now obsolete.

`pigeon list -p jira -a X` printed top-level project keys as if they were
conversations; `pigeon read -p jira -a X -c KEY` fell through to the
slack/whatsapp conversation flow and silently failed. Both gaps remained
after #365 split issues from comments into per-issue dirs.

- paths.JiraIssueFile gets Key() and CommentsFile() so layout knowledge
  (per-issue dir name, sibling comments file) stays in the registry.
- paths.JiraIssueFileGlobs / JiraIssueFileGlobsForKey expose the rg
  glob shape, mirroring DriveMetaFileGlobsSince.
- read.ListJiraIssues / FindJiraIssue do discovery via GlobFiles and
  return typed JiraIssueFile values via Classify, no path string
  manipulation in the consumer.
- commands/list.go listJiraAccount prints flat issue keys.
- commands/read.go runReadJira streams issue.jsonl + comments.jsonl
  through modelv1.Parse / Marshal. Round-trip validates structure on
  read; missing comments.jsonl is tolerated.

go test ./..., go vet ./..., gofmt clean.
@anish749
anish749 force-pushed the worktree-jira-read-list branch from cac8d4e to 402acf2 Compare May 28, 2026 21:43
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.

1 participant