GitLab provider: add support for group.sharedProjects (shared repositories)#442
Open
gdepuille wants to merge 4 commits intoorf:masterfrom
Open
GitLab provider: add support for group.sharedProjects (shared repositories)#442gdepuille wants to merge 4 commits intoorf:masterfrom
gdepuille wants to merge 4 commits intoorf:masterfrom
Conversation
Updates the wget URL in the update script to point to the new location for the GitHub public GraphQL schema.
Converts legacy .graphqlconfig files to graphql.config.yml for the GitHub and GitLab providers, updating environment variable syntax to the standard format.
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.
Add support for GitLab shared projects in group queries
Context
When using the GitLab provider with groups,
git-workspacecurrently only fetches projects that are owned by the group via thegroup.projectsGraphQL field. However, GitLab also allows projects to be shared with a group, which are exposed through thegroup.sharedProjectsfield.These shared projects are visible in the GitLab UI but are not currently cloned by
git-workspace, which leads to incomplete workspace synchronization when organizations rely heavily on shared repositories.Changes
This PR updates the GitLab GraphQL query and result handling to:
Add support for
group.sharedProjectsMerge results from:
group.projectsgroup.sharedProjectsPreserve existing behavior for
namespace.projectsKeep pagination handling consistent with existing implementation
Example
Before:
git-workspaceclones only 8 (group-owned)After:
Implementation details
Extend GraphQL query to include:
group.sharedProjectsUpdate response mapping to merge both result sets
Handle optional
shared_projectsfield safelyDeduplicate repositories implicitly via existing logic
Why this matters
Many GitLab organizations structure repositories using:
Without this change,
git-workspacesilently misses a large portion of accessible repositories.Backward compatibility
Tested
Tested against: