fix(connectors/gitlab): resolve subgroup path parsing dynamically#36
Open
mhajder wants to merge 1 commit into
Open
fix(connectors/gitlab): resolve subgroup path parsing dynamically#36mhajder wants to merge 1 commit into
mhajder wants to merge 1 commit into
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
project:pathseparator format (e.g.,gitlab:group/subgroup/project:docs/api) inparse_gitlab_source._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.Should fix #14