Skip to content

[FR] Dynamic GitLab project selection via API queries #679

@philippe-granet

Description

@philippe-granet

Description

Add support for configuring which GitLab projects are mirrored/synchronized by using GitLab API queries.

Introduce a new optional parameter called projectQuery, which allows users to dynamically select projects to mirror based on GitLab API endpoints.

Proposed Configuration

The projectQuery parameter would be an array of strings.
Each string represents a GitLab API URL path (including query parameters) that returns a list of projects.

Example:

{
  "connections": {
    "gitlab-connection": {
      "type": "gitlab",
      "groups": [
        "..."
      ],
      "projects": [
        "..."
      ],
      "projectQuery": [
        "groups/group1/projects?include_subgroups=true",
        "groups/group2/projects?include_subgroups=false",
        "groups/group3/projects?include_subgroups=true&archived=false",
        "search?scope=projects&search=flight",
        "projects?topic=devops"
      ]
    }
  }
}

Here are a few endpoints that return a list of projects:

Expected Behavior

All projects returned by the specified API queries should be mirrored in Sourcebot.
If a project is matched by multiple query strings, it must be imported only once (deduplication).
This feature should complement existing groups and projects configuration options.

Motivation

This would make GitLab synchronization more flexible and scalable, especially for organizations with:

  • Large numbers of projects
  • Complex group and subgroup structures

It would also reduce configuration maintenance by relying on GitLab’s API filtering capabilities.

Metadata

Metadata

Labels

FeatureenhancementNew feature or requestgitlabIssues related to integrating or supporting GitLab functionality.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions