Skip to content

feat(jira): show a ticket as Markdown - #41

Merged
Bakhomious merged 1 commit into
mainfrom
step/jira-text
Nov 4, 2026
Merged

Bakhomious merged 1 commit into
mainfrom
step/jira-text

Conversation

@Bakhomious

Copy link
Copy Markdown
Contributor

Step jira-text (plan row 64): the first of three Jira steps. internal/jira reads a ticket's fields as Jira's REST API v3 gives them, and renders the ticket as Markdown for the orchestrator to read.

What changes

  • The ticket's fields as Jira gives them: key, summary, type, status, parent, description (ADF), subtasks and links. Comments come from their own endpoint, so Ticket.Comments isn't read from the issue's JSON.
    • The JSON tags spell Jira's names exactly: issuetype and issuelinks. encoding/json/v2 matches names by case, so issueType would read nothing.
  • Ticket.Markdown():
    • The key and summary are the title. Type, status and parent (if any) form a list.
    • Description, subtasks, links and comments (oldest first) each get a ## heading. A part the ticket lacks shows nothing, heading included.
    • A subtask, a link's other ticket and the parent show as key, summary and status.
    • A link shows its type from the ticket's side: blocks DEMO-4, is blocked by DEMO-5.
    • A comment's heading names its author, or Someone when Jira gives none, and its time as Jira gives it. The description and comment bodies go through internal/adf.
  • Docs:
    • The plan splits row 64 into jira-text, jira-client and jira. adf-blocks is Done (feat(adf): give a ticket's blocks their Markdown shape #40).
    • Fact 40: the shapes of Jira's answers, from the OpenAPI spec and the API's introduction.
      • The spec doesn't describe parent and subtasks; jira-cli's types fill that gap.
      • Comment pages can come empty.
      • orderBy=created gives the oldest first.
    • Decision 58: what the text shows, and what it leaves out for now (people, priority, labels, sprint, a site's own fields).
    • The design's Jira paragraph and Sources are updated.

Checks

  • mise run check: green. Coverage 99.4%; internal/jira 100%.
  • Golden tests: a full made-up ticket, DEMO-1, and a bare one, DEMO-6. DEMO-1 has a parent, a description, two subtasks, an inward and an outward link, and three comments: one with an author, one without, and one with an empty body. DEMO-6 has no parent, a null description, no subtasks, links or comments.
  • Mutation probes: 47 mutants, all caught. They cover each JSON tag, each part and its heading, the parent's check, the Someone fallback, the joins and separators, the list markers, and each link side's text. One mutant didn't compile at first (an unused import) and was rewritten.
  • Smoke run: through a throwaway test, a made-up ticket with a table in its description, a clone link and a comment full of inline nodes. It rendered as expected.

Not in this PR:

  • jira-client (the HTTP client) comes next, then jira (baton jira <KEY>, the config section and the Keychain).
  • Two nudge asks are still open for those: the Keychain read's G204 handling, and a live check against one real ticket.

internal/jira gets a ticket's fields as Jira's REST API v3 gives them,
and renders the ticket as Markdown for the orchestrator to read: its key
and summary, type, status and parent, then its description, subtasks,
links and comments, each under its own heading, and nothing for a part
that the ticket lacks (decision 58, fact 40).

The plan splits the jira step in three: jira-text, jira-client and jira.
@sonarqubecloud

sonarqubecloud Bot commented Nov 4, 2026

Copy link
Copy Markdown

@Bakhomious
Bakhomious merged commit ffd41be into main Nov 4, 2026
3 checks passed
@Bakhomious
Bakhomious deleted the step/jira-text branch November 4, 2026 20:07
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