feat: multi-platform BASE_BRANCH_DETECT (GitHub + GitLab + GHE + git-native)

Update the shared BASE_BRANCH_DETECT resolver to support GitHub, GitLab,
GitHub Enterprise, self-hosted GitLab, and a git-native fallback chain.
Platform detection uses remote URL matching plus CLI auth status for
custom domains. Add glab issue create alternative in test failure triage.

Add 7 new test assertions covering GitLab CLI presence, git symbolic-ref
fallback, and platform-specific output in retro and ship generated files.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Garry Tan
2026-03-26 00:19:44 -06:00
parent 3501f5dd03
commit 3867ee6171
3 changed files with 79 additions and 18 deletions
+33
View File
@@ -333,6 +333,39 @@ describe('BASE_BRANCH_DETECT resolver', () => {
test('resolver output uses "the base branch" phrasing', () => {
expect(shipContent).toContain('the base branch');
});
test('resolver output contains GitLab CLI commands', () => {
expect(shipContent).toContain('glab');
});
test('resolver output contains git-native fallback', () => {
expect(shipContent).toContain('git symbolic-ref');
});
test('resolver output mentions GitLab platform', () => {
expect(shipContent).toMatch(/gitlab/i);
});
});
describe('GitLab support in generated skills', () => {
const retroContent = fs.readFileSync(path.join(ROOT, 'retro', 'SKILL.md'), 'utf-8');
const shipSkillContent = fs.readFileSync(path.join(ROOT, 'ship', 'SKILL.md'), 'utf-8');
test('retro contains GitLab MR number extraction', () => {
expect(retroContent).toContain('[#!]');
});
test('retro uses BASE_BRANCH_DETECT (contains glab)', () => {
expect(retroContent).toContain('glab');
});
test('ship contains glab mr create', () => {
expect(shipSkillContent).toContain('glab mr create');
});
test('ship checks .gitlab-ci.yml', () => {
expect(shipSkillContent).toContain('.gitlab-ci.yml');
});
});
/**