Skip to content

Add config param all to enable syncing all projects in GitLab instance #84

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Nov 20, 2024

Conversation

brendan-kellam
Copy link
Contributor

@brendan-kellam brendan-kellam commented Nov 20, 2024

This PR adds the option all to the GitLab index config. When enabled, all projects within the GitLab instance that are visible to the provided token (if any) will be indexed.

Example:

{
    "$schema": "./schemas/v2/index.json",
    "repos": [
        {
            "type": "gitlab",
            "url": "https://gitlab.example.com",
            "token": {
                "env": "GITLAB_TOKEN"
            },
            "all": true
        }
    ]
}

Note: I've made this option no-op when using https://gitlab.com . I tested it, and if all is enabled, all projects hosted on gitlab.com are fetched, resulting in the get request never completing. We could use the visibility param of the GET /projects api to limit things to just private or internal (limiting things to only the projects the token can see), but I will leave that as a future improvement if there are requests for it.

Fixes #49

@msukkari msukkari self-requested a review November 20, 2024 21:28
@brendan-kellam brendan-kellam merged commit f3d5fa6 into main Nov 20, 2024
2 checks passed
@brendan-kellam brendan-kellam deleted the bkellam/gitlab_sync_all_visible branch November 20, 2024 22:29
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.

Sync all GitLab repos visible to the token
2 participants