Skip to content

feat(gitlab): add subGroups support#246

Open
sabasayer wants to merge 1 commit intounjs:mainfrom
sabasayer:feat-support-gitlab-subgroups
Open

feat(gitlab): add subGroups support#246
sabasayer wants to merge 1 commit intounjs:mainfrom
sabasayer:feat-support-gitlab-subgroups

Conversation

@sabasayer
Copy link

Support Gitlab Subgroups

#107

This PR fixes GitLab provider support for repositories under subgroups (e.g. group/subgroup/repo) and corrects the GitLab tarball URL format.

There was another PR which is open since 2024. Since we really need this feature in our Nuxt application ecosystem i've created this PR.

Problem

giget previously assumed Git URIs always used owner/repo, so GitLab subgroup paths were mis-parsed as a “subdir”, causing invalid tree/archive URLs and failed downloads.

Solution

  • Added GitLab target resolution that disambiguates repo vs subdir by probing GitLab’s archive endpoint.
  • Corrected GitLab tarball URL format to:
    /-/archive//-.tar.gz
  • Refactored the GitLab logic into small, named helpers in _utils.ts to keep the provider clean.

Tests

Added/expanded test/gitlab-provider.test.ts to cover:

  • subgroups
  • subpaths
  • default main / empty #
  • deep subgroup paths
  • multi-segment subdirs
  • 401/403 probe behavior (private repos)
  • fallback when probes return 404

Examples

  • gitlab:org/subgroup/repo#main
  • gitlab:org/repo/path/to/subdir#dev

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants