Skip to content

Parse nested GitLab group paths in parseRepoUrl#84

Merged
RomainCscn merged 1 commit into
mainfrom
romain/lin-70947-linear-release-fails-on-gitlab-repositories-in-nested-groups
May 19, 2026
Merged

Parse nested GitLab group paths in parseRepoUrl#84
RomainCscn merged 1 commit into
mainfrom
romain/lin-70947-linear-release-fails-on-gitlab-repositories-in-nested-groups

Conversation

@RomainCscn

Copy link
Copy Markdown
Collaborator

Fixes #83

@RomainCscn RomainCscn requested a review from axelniklasson May 19, 2026 07:07
@linear-code

linear-code Bot commented May 19, 2026

Copy link
Copy Markdown

@linear-code linear-code Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. The regex changes are minimal, backward-compatible for GitHub/Bitbucket (2-segment paths produce identical captures), and correctly parse nested GitLab group paths for both HTTPS and SSH URLs. No blocking issues found.

@RomainCscn RomainCscn force-pushed the romain/lin-70947-linear-release-fails-on-gitlab-repositories-in-nested-groups branch 2 times, most recently from 26dbed1 to 65a5f6c Compare May 19, 2026 07:27
GitLab supports subgroup nesting up to 20 levels, so a remote URL like
`git@gitlab.com:my-org/my-group/my-repo.git` is valid but the existing
`[^/]+/([^/]+?)` regex rejected it. `parseRepoUrl` returned null and,
once GitLab MR-trailer detection (#72) fires for a sync, syncRelease
threw "Repository info is required to sync a release with pull
request references" (src/index.ts:407).

The split keeps the first path segment as owner and folds the rest
into name (e.g. owner=group, name=subgroup/repo). This matches the
identifier Linear's API uses for GitLab merge requests during release
sync, so the (owner, name) pair we send up joins correctly against
stored MR metadata.

Single-segment URLs (GitHub, Bitbucket, simple GitLab) are symmetric
under this split, so behavior is unchanged for them - all existing
tests pass without modification.

Fixes #83
@RomainCscn RomainCscn force-pushed the romain/lin-70947-linear-release-fails-on-gitlab-repositories-in-nested-groups branch from 65a5f6c to 9ac2938 Compare May 19, 2026 07:39
@RomainCscn RomainCscn merged commit 16832d6 into main May 19, 2026
10 checks passed
@RomainCscn RomainCscn deleted the romain/lin-70947-linear-release-fails-on-gitlab-repositories-in-nested-groups branch May 19, 2026 07:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants