issue-300: use Closes keyword in MR description so merges auto-close the issue #302
Loading…
Reference in a new issue
No description provided.
Delete branch "feature/issue-300/mr-description-closes-keyword-auto-close"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What & why
The deterministic MR-description builder opened every MR/PR body with:
Implementsis not a closing keyword on GitLab, GitHub, or Forgejo, so merging a pi-loop MR left the source issue open — operators had to close every issue by hand.closeIssueAfterAutoMerge(src/orchestrator/services/runPipeline.ts) only fires on the--auto-mergepath, so the default Draft-MR flow — the documented human checkpoint — had no issue-closing mechanism at all.Git-platform issues now get a real closing reference; Jira keeps the descriptive wording because it has no MR-body closing mechanism and its keys are not
#-references (Jira is handled by write-back).Before / after
Jira is unchanged:
Implements [ABC-1](…).Cross-repo issues get the qualified form all three platforms require:
Closes acme/tracker#42.Per-file breakdown
Modified
src/mr/helpers/buildMrDescription.ts— newbuildIssueReference()helper picks the wording by provider; new optionalmrRepoinput onBuildMrDescriptionInputso the builder can tell same-repo from cross-repo and emit the qualified reference only when needed.src/mr/services/runMrStage.ts— passesoriginRepothrough asmrRepo.src/mr/helpers/buildMrDescription.test.ts— 7 new cases: closing keyword for each of gitlab/github/forgejo, Jira keeps non-closing wording, issue URL still present, cross-repo qualification, and the two unknown-repo fallbacks.DESIGN.md— §Stage 4 documents the closing-keyword rule and the Jira exception.Verification
npm test— 2083 passed / 144 filesnpm run lint— cleannpm run build— cleanRemaining
tsc --noEmiterrors are pre-existing in unrelated test files (gitState.test.ts,authenticatedFetch.test.ts,runStage.test.ts) and untouched here.Note on scope
This fixes the description text. Worth a separate look:
closeIssueAfterAutoMergeremains auto-merge-only, so on platforms/repos where closing keywords are disabled the Draft flow still relies on a human.Closes #300
WIP: issue-300: use Closes keyword in MR description so merges auto-close the issueto issue-300: use Closes keyword in MR description so merges auto-close the issue