issue-296: MR titles use issue- prefix for git-platform issues #297

Merged
david merged 1 commit from feature/issue-296/mr-titles-use-issue-prefix-for-git-platform-issues into main 2026-08-21 01:49:19 +00:00
Owner

What & why

The MR/PR title built in the mr stage was always <key>: <summary> using the raw issue key. For GitHub/GitLab/Forgejo issues that produced ambiguous bare-number titles (e.g. 13: Add login page), while Jira keys were self-evident (ABC-123: ...).

This change makes git-platform MR titles use the same key convention as branch names: issue-<number>: <summary> (e.g. issue-13: Add login page). Jira titles are unchanged. The convention now lives in one shared helper, so branch names and MR titles can't drift apart.

Changes

Modified:

  • src/shared/git/helpers/branchNaming.ts — new buildIssueKeyLabel(key, provider): Jira key as-is; GitHub/Forgejo/GitLab → issue-<number>. buildBranchName now uses it (behaviour unchanged).
  • src/mr/services/runMrStage.ts — MR title is now `${buildIssueKeyLabel(context.key, context.provider)}: ${context.summary}`; comment updated.
  • src/shared/git/index.ts, src/mr/helpers/buildBranchName.ts, src/mr/index.ts — re-export the new helper.

Tests (modified):

  • src/mr/helpers/buildBranchName.test.ts — 4 unit tests for buildIssueKeyLabel (one per provider family).
  • src/mr/services/runMrStage.test.ts — integration test: a GitHub issue #13 produces title issue-13: Add login page and branch feature/issue-13/add-login-page.

Verification

  • npm run build
  • Full suite: 2075/2075 tests passing ✓
  • eslint clean on all touched files ✓
  • No new tsc errors (pre-existing test-file type errors unchanged)

Closes #296

## What & why The MR/PR title built in the mr stage was always `<key>: <summary>` using the raw issue key. For GitHub/GitLab/Forgejo issues that produced ambiguous bare-number titles (e.g. `13: Add login page`), while Jira keys were self-evident (`ABC-123: ...`). This change makes git-platform MR titles use the same key convention as branch names: `issue-<number>: <summary>` (e.g. `issue-13: Add login page`). Jira titles are unchanged. The convention now lives in one shared helper, so branch names and MR titles can't drift apart. ## Changes **Modified:** - `src/shared/git/helpers/branchNaming.ts` — new `buildIssueKeyLabel(key, provider)`: Jira key as-is; GitHub/Forgejo/GitLab → `issue-<number>`. `buildBranchName` now uses it (behaviour unchanged). - `src/mr/services/runMrStage.ts` — MR title is now `` `${buildIssueKeyLabel(context.key, context.provider)}: ${context.summary}` ``; comment updated. - `src/shared/git/index.ts`, `src/mr/helpers/buildBranchName.ts`, `src/mr/index.ts` — re-export the new helper. **Tests (modified):** - `src/mr/helpers/buildBranchName.test.ts` — 4 unit tests for `buildIssueKeyLabel` (one per provider family). - `src/mr/services/runMrStage.test.ts` — integration test: a GitHub issue #13 produces title `issue-13: Add login page` and branch `feature/issue-13/add-login-page`. ## Verification - `npm run build` ✓ - Full suite: 2075/2075 tests passing ✓ - eslint clean on all touched files ✓ - No new tsc errors (pre-existing test-file type errors unchanged) Closes #296
david merged commit cff2e20c65 into main 2026-08-21 01:49:19 +00:00
david deleted branch feature/issue-296/mr-titles-use-issue-prefix-for-git-platform-issues 2026-08-21 01:49:19 +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!297
No description provided.