feat: add per-repo GraphQL fallback before REST for GitLab (#765)#767
Draft
maciekbanas wants to merge 1 commit intomasterfrom
Draft
feat: add per-repo GraphQL fallback before REST for GitLab (#765)#767maciekbanas wants to merge 1 commit intomasterfrom
maciekbanas wants to merge 1 commit intomasterfrom
Conversation
Member
Author
|
For the time being querying per repo with GraphQL as a fallback does not seem very time-efficient. I will wait with this PR for next releases. |
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.
Description
When
get_repos()fails for a large GitLab group with therepos_by_orgGraphQL query, the code now tries per-repo GraphQL queries before falling back to REST.Fallback order:
repos_by_orgquery → per-repo GraphQL → RESTThe per-repo approach works in two steps:
repos_by_org_minimal) lists only projectfullPathvalues from the group — no languages, issues, or repository details — so it succeeds even for very large groups.repo_by_fullpath_light) that omitslanguagesandissueStatusCountsto stay under complexity limits.REST is only used as a last resort if the minimal listing query itself fails. Individual per-repo query failures are skipped gracefully (the repo is omitted from results with a warning).
Changes
R/GQLQueryGitLab.Rrepos_by_org_minimal()andrepo_by_fullpath_light()queriesR/EngineGraphQLGitLab.Rget_repos_from_org_per_repo()+ privateget_repo_paths_from_org()R/GitHostGitLab.Rget_repos_from_orgs()with three-tier fallback; updatesget_repos_data()tests/testthat/Related Issue(s)
Fixes #765
How to test
devtools::test(filter = "01-get_repos-GitLab")and accept new snapshots.Switching to per-repo GraphQL queries...before any REST fallback.