-
Notifications
You must be signed in to change notification settings - Fork 199
Description
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:
- https://docs.gitlab.com/api/projects.html#list-all-projects
- https://docs.gitlab.com/api/groups.html#list-a-groups-projects
- https://docs.gitlab.com/api/search.html#scope-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.