Skip to content

linear-release fails on GitLab repositories in nested groups #83

@amirzahavi

Description

@amirzahavi

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

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions