Skip to content

Gitlab SaaS support #6426

@Barneyjm

Description

@Barneyjm

Currently, the gitlab source supports self-hosted according to the documentation. It actually works fine with the SaaS option, only problem is it pulls ALL of gitlab which, while reveals interesting information about gitlab, probably isn't ideal behavior.

SaaS support could work by pre-filtering API calls to gitlab.com (bolded is preferred):

  1. first call /namespaces, grab the IDs of each namespace from the response, then call /groups/:namespaceid:/projects
  2. /projects?visibility=private would only return a given user's namespace projects. However if a user didn't have private projects, they'd still need to run visibility=public and they'd end up grabbing everything from gitlab again.
  3. /users/:userid:/projects returns information about a users owned projects, which is not always the case

Alternatively, we could just live with grabbing all of Gitlab.com and filter post-fetch, but that doesn't seem scalable as gitlab grows its public presence and doesn't seem like a "good api citizen" thing to do to Gitlab.

Additional context

spoke briefly with ben about this in discord.

found some issues recently closed, though i don't think the solution helps in this namespace-wide data gathering capability: https://gitlab.com/gitlab-org/gitlab/-/issues/16149

https://docs.gitlab.com/ee/api/namespaces.html

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions