Skip to content

fix(connectors/gitlab): resolve subgroup path parsing dynamically#36

Open
mhajder wants to merge 1 commit into
open-webui:mainfrom
mhajder:fix/connectors/gitlab
Open

fix(connectors/gitlab): resolve subgroup path parsing dynamically#36
mhajder wants to merge 1 commit into
open-webui:mainfrom
mhajder:fix/connectors/gitlab

Conversation

@mhajder

@mhajder mhajder commented Jun 6, 2026

Copy link
Copy Markdown

Previously, GitLab source parser used a simple split limit to extract the owner namespace and repository name (e.g. source.split("/", 2)). This caused parsing failures for repositories located in nested subgroups (e.g., gitlab:group/subgroup/project/docs/api), as the subgroup path would get incorrectly split.

This PR fixes subgroup parsing by:

  1. Supporting an explicit project:path separator format (e.g., gitlab:group/subgroup/project:docs/api) in parse_gitlab_source.
  2. Adding a lazy resolution helper _ensure_resolved() to the connector. It probes the segments against the GitLab API (/projects/{candidate}) to dynamically identify the boundary between the project path and the repository file path.
  3. Merging paths safely and falling back to the default split behavior if the API check fails or the client is offline.

Should fix #14

Previously, GitLab source parser used a simple split limit to extract the owner namespace and repository name (e.g. `source.split("/", 2)`). This caused parsing failures for repositories located in nested subgroups (e.g., `gitlab:group/subgroup/project/docs/api`), as the subgroup path would get incorrectly split.

This commit fixes subgroup parsing by:
1. Supporting an explicit `project:path` separator format (e.g., `gitlab:group/subgroup/project:docs/api`) in `parse_gitlab_source`.
2. Adding a lazy resolution helper `_ensure_resolved()` to the connector. It probes the segments against the GitLab API (`/projects/{candidate}`) to dynamically identify the boundary between the project path and the repository file path.
3. Merging paths safely and falling back to the default split behavior if the API check fails or the client is offline.
@mhajder mhajder marked this pull request as ready for review June 15, 2026 19:51
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.

GitLab connector does not support nested/multi-level group project paths

1 participant