control: issues and merge requests share their thread code !209

merged merged by cmc on 2026-09-04 01:17 UTC · krz/gitbay:issue-mr-dedup into main

Discussion

cmc

runIssueComment and runMRComment were the same fifty lines with the noun swapped, as were issueRef and mrRef, the commentOut type declared in both files, and the author-or-write check written out five times.

thread.go holds each once: refArgs resolves <owner/name> <n>, authorOrWrite admits the author or write access with the action named in the refusal, commentOut is one type, and runComment takes the noun's resolver, comment insert and participant query. Behaviour, messages and JSON shapes are unchanged; the control unit tests pass and the e2e suite runs here.

Stacked on !208; depends on its parser.

Closes #110

retargeted from flag-parser to main: !208 merged

2026-09-04 01:05 UTC