Skip to content

[Feature]: Add support for Gitlab subgroup nested repos #1174

@dairefagan

Description

@dairefagan

Feature Request: Add Support for GitLab Nested Groups/Subgroups

Summary

Context7's GitLab integration currently only supports repositories at the top level of a group (e.g., https://gitlab.com/owner/repo). It does not support repositories nested within subgroups, which is a common organisational pattern on GitLab.

Problem Description

When attempting to add a GitLab repository that exists within a subgroup, Context7 returns an error:

  • URL attempted: https://gitlab.com/astra-language/astra-tools/astra-activemq
  • Error received: "Please enter a valid GitLab repository URL"

This repository is valid and publicly accessible on GitLab, but the URL contains three path segments (astra-language/astra-tools/astra-activemq) rather than the two segments (owner/repo) that Context7 currently expects.

Additionally, when attempting to add a subgroup URL directly (e.g., https://gitlab.com/astra-language/astra-tools), the error "The repository is not found or access denied" is returned, as Context7 attempts to treat the subgroup as a repository.

GitLab's Group Structure

GitLab supports nested groups (subgroups) to help organise related projects. For example:

astra-language/                    ← Top-level group
├── astra-core                     ← Repository (works with Context7 ✓)
├── astra-tools/                   ← Subgroup
│   ├── astra-activemq             ← Repository (does NOT work ✗)
│   ├── astra-bspl                 ← Repository (does NOT work ✗)
│   └── astra-langchain4j          ← Repository (does NOT work ✗)
└── Examples/                      ← Subgroup
    └── astra-guides               ← Repository (does NOT work ✗)

Expected Behaviour

Context7 should accept GitLab repository URLs with any number of path segments, as GitLab allows unlimited nesting depth. Valid URL patterns include:

  • https://gitlab.com/owner/repo (2 segments)
  • https://gitlab.com/owner/subgroup/repo (3 segments)
  • https://gitlab.com/owner/subgroup1/subgroup2/repo (4+ segments)

Technical Notes

  • GitLab's API handles nested paths using URL encoding: the project path astra-language/astra-tools/astra-activemq becomes astra-language%2Fastra-tools%2Fastra-activemq in API calls
  • The GitLab API endpoint would be: https://gitlab.com/api/v4/projects/astra-language%2Fastra-tools%2Fastra-activemq
  • This is a well-documented GitLab feature: https://docs.gitlab.com/ee/user/group/subgroups/

Impact

Many organisations use subgroups to organise their repositories by team, project type, or domain. Without support for nested groups, a significant portion of GitLab's public repositories cannot be added to Context7.

Example Repositories That Cannot Be Added

  • https://gitlab.com/astra-language/astra-tools/astra-activemq
  • https://gitlab.com/astra-language/astra-tools/astra-bspl
  • https://gitlab.com/astra-language/astra-tools/astra-langchain4j
  • https://gitlab.com/astra-language/examples/astra-guides

All of these are valid, public GitLab repositories that would benefit from being indexed by Context7.

Thank you for considering this enhancement.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions