Default Graphql complexity limit for unauthenticated users is too low for viewing pipelines
Summary
It's unclear right now exactly when it was introduced but it appears the Graphql query used when visiting a pipeline's page as an unauthenticated user has a complexity score that is higher than default limit of 200 defined in app/graphql/gitlab_schema.rb
This is leading to some of our users who don't have accounts and only need access to the pipeline pages to no longer be able to view them.
Steps to reproduce
- Create a pipeline and run it
- In a private browser window, open the link to the pipelines page and note the error
What is the current bug behavior?
When opening the main page for a pipeline, if a user is unauthenticated, the interface will show an error stating it cannot fetch the data. Inspecting the network tab in your browser will show the error message below in the response to the Graphql query:
{
"errors": [
{
"message": "Query has complexity of 201, which exceeds max complexity of 200"
}
]
}
What is the expected correct behavior?
The pipeline details page should load the pipeline data and display it.
Relevant logs and/or screenshots
Output of checks
Results of GitLab environment info
Expand for output related to GitLab environment info
System information System: Ubuntu 22.04 Proxy: no Current User: git Using RVM: no Ruby Version: 3.1.5p253 Gem Version: 3.5.11 Bundler Version:2.5.11 Rake Version: 13.0.6 Redis Version: 7.0.15 Sidekiq Version:7.1.6 Go Version: unknown GitLab information Version: 17.1.1-ee Revision: d0ac56e0be2 Directory: /opt/gitlab/embedded/service/gitlab-rails DB Adapter: PostgreSQL DB Version: 14.11 URL: HTTP Clone URL: SSH Clone URL: Elasticsearch: Geo: Using LDAP: Using Omniauth: Omniauth Providers: GitLab Shell Version: 14.36.0 Repository storages: - default: unix:/var/opt/gitlab/gitaly/gitaly.socket GitLab Shell path: /opt/gitlab/embedded/service/gitlab-shell Gitaly - default Address: unix:/var/opt/gitlab/gitaly/gitaly.socket - default Version: 17.1.1 - default Git Version: 2.45.1
Results of GitLab application Check
N/A
Possible fixes
- Increase the unauthenticated limit here: https://gitlab.com/gitlab-org/gitlab/-/blob/master/app/graphql/gitlab_schema.rb?ref_type=heads#L6
- Rework the Graphql API call to bring it below the 200 complexity score limit.
Edited by Ricky Grassmuck
