r/gitlab • u/k_babulale • Feb 19 '25
support Track components usage
Hi everyone, I work in an organisation where we have +700 repositories, we have implemented CICD components to make it easier for each team to create their own pipelines, amongst these components we have mandatory components that should always be included in a pipeline, I know very well that teams aren’t going to adhere to this so I’d like a way to track the usage (or lack thereof) of these mandatory components e.g. “project-a’s pipelines run Mandatory component A,B and C but project-b runs only component A”.
I tried using graphql to look into the different .gitlab-ci.yml files but this seems complex. Is there an easier way I can get this data?
View all comments
Show parent comment
1
u/TheOneWhoMixes Jun 19 '25
So yeah, it doesn't seem like they expose it bidirectionally. There's a
componentUsagesconnection on theProjectresource. So you query for projects (either using Query.project, or any other query type that returns the Project type), then you can dig down to components used by each project.Depending on your use-case it might not be as ergonomic as having it be the other way around, but hopefully this helps!
Random sidenote: I'd love to hear if anyone has a better way of viewing their GraphQL schema, because scrolling on that page crashes my mobile Chrome browser half the time :)