Summary
linear-release sync fails when running in a GitLab repository whose project path has nested groups, for example:
git@gitlab.com:my-org/my-group/my-repo.git
The CLI detects GitLab merge request references from commit messages, but cannot parse repository info from nested GitLab remote URLs. It then exits with:
Error: Repository info is required to sync a release with pull request references
Environment
linear-release version: v0.11.1
- CI: GitLab CI
- Remote URL format:
git@gitlab.com:<group>/<subgroup>/<repo>.git
Reproduction
Run linear-release sync in a GitLab CI job for a repository under a nested GitLab group, where the scanned commit range includes GitLab merge commit trailers like:
See merge request my-org/my-group/my-repo!1333
Root Cause
https://github.com/linear/linear-release/blob/v0.11.1/src/index.ts#L408
throw new Error("Repository info is required to sync a release with pull request references");
Root cause before that: repo URL parser rejects nested GitLab paths here:
https://github.com/linear/linear-release/blob/v0.11.1/src/git.ts#L435
https://github.com/linear/linear-release/blob/v0.11.1/src/git.ts#L449
Those regexes only allow host/owner/repo, not host/group/subgroup/repo
Summary
linear-release syncfails when running in a GitLab repository whose project path has nested groups, for example:git@gitlab.com:my-org/my-group/my-repo.gitThe CLI detects GitLab merge request references from commit messages, but cannot parse repository info from nested GitLab remote URLs. It then exits with:
Error: Repository info is required to sync a release with pull request referencesEnvironment
linear-releaseversion:v0.11.1git@gitlab.com:<group>/<subgroup>/<repo>.gitReproduction
Run
linear-release syncin a GitLab CI job for a repository under a nested GitLab group, where the scanned commit range includes GitLab merge commit trailers like:Root Cause
https://github.com/linear/linear-release/blob/v0.11.1/src/index.ts#L408
Root cause before that: repo URL parser rejects nested GitLab paths here:
https://github.com/linear/linear-release/blob/v0.11.1/src/git.ts#L435
https://github.com/linear/linear-release/blob/v0.11.1/src/git.ts#L449
Those regexes only allow host/owner/repo, not host/group/subgroup/repo