M7 — Jira write-back #17

Merged
david merged 1 commit from issue-8/stage-m7-jira-write-back into main 2026-07-25 03:00:19 +00:00
Owner

Summary

Implements M7 — Jira write-back (issue #8): after MR creation, reflect the MR back on the Jira ticket per JIRA_WRITEBACK_MODE — add a comment with the MR link and/or transition the issue to In Review. Write-back after MR is non-fatal.

Changes

  • New src/writeback/ module (vertical slice):
    • resolveTransition — maps JIRA_TRANSITION_IN_REVIEW (name→id, case-insensitive, id passthrough); not-configured / not-found outcomes.
    • runWriteback — per-mode orchestration (comment / transition / both); unresolved or failed transition degrades to a comment; never throws (records non-fatal errors).
    • formatWritebackSummary — one-line summary for the M8 final summary.
  • Extended the Jira seam: new JiraWriteClient interface (getTransitions, transitionIssue, addComment) implemented on JiraRestClient (REST v3, ADF comment body).
  • Added a shared private request() helper (retry + JiraError classification); refactored fetchIssue to reuse it.

Testing

  • All tests pass — 374 tests / 55 files (was 340; +34 new)
  • npm run build (tsc --noEmit) clean
  • npm run lint clean
  • Transition resolver unit-tested (name/id/case/missing/renamed/empty)
  • Write-back non-fatal paths unit-tested (getTransitions/transition/comment failures)

Checklist

  • Self-reviewed the diff
  • Follows vertical-slice module + barrel conventions (CODING_STANDARDS.md)
  • Descriptive naming; no secrets logged
  • Prettier-clean on all new/modified files

Closes #8.

## Summary Implements **M7 — Jira write-back** (issue #8): after MR creation, reflect the MR back on the Jira ticket per `JIRA_WRITEBACK_MODE` — add a comment with the MR link and/or transition the issue to *In Review*. Write-back after MR is **non-fatal**. ## Changes - **New `src/writeback/` module** (vertical slice): - `resolveTransition` — maps `JIRA_TRANSITION_IN_REVIEW` (name→id, case-insensitive, id passthrough); `not-configured` / `not-found` outcomes. - `runWriteback` — per-mode orchestration (`comment` / `transition` / `both`); unresolved or failed transition degrades to a comment; never throws (records non-fatal errors). - `formatWritebackSummary` — one-line summary for the M8 final summary. - **Extended the Jira seam**: new `JiraWriteClient` interface (`getTransitions`, `transitionIssue`, `addComment`) implemented on `JiraRestClient` (REST v3, ADF comment body). - Added a shared private `request()` helper (retry + `JiraError` classification); refactored `fetchIssue` to reuse it. ## Testing - [x] All tests pass — **374 tests / 55 files** (was 340; +34 new) - [x] `npm run build` (tsc --noEmit) clean - [x] `npm run lint` clean - [x] Transition resolver unit-tested (name/id/case/missing/renamed/empty) - [x] Write-back non-fatal paths unit-tested (getTransitions/transition/comment failures) ## Checklist - [x] Self-reviewed the diff - [x] Follows vertical-slice module + barrel conventions (CODING_STANDARDS.md) - [x] Descriptive naming; no secrets logged - [x] Prettier-clean on all new/modified files Closes #8.
Reflect a created MR back on the Jira ticket per JIRA_WRITEBACK_MODE:
- new writeback module: resolveTransition (name->id, case-insensitive,
  not-configured/not-found), runWriteback orchestrator (comment/transition/both,
  transition fallback to comment, never throws), formatWritebackSummary.
- extend JiraClient seam with JiraWriteClient (getTransitions, transitionIssue,
  addComment) implemented on JiraRestClient (REST v3, ADF comment body); shared
  private request() helper with retry+error classification (fetchIssue refactored
  to reuse it).

Closes #8.
david merged commit 824734a298 into main 2026-07-25 03:00:19 +00:00
david deleted branch issue-8/stage-m7-jira-write-back 2026-07-25 03:00:20 +00:00
david referenced this pull request from a commit 2026-07-25 03:00:20 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
david/pi-loop!17
No description provided.