Skip CustomersDot subscription queries when the proxy is absent

What does this MR do and why?

Fix console errors and Sentry noise on usage quotas pages in self-managed instances and tests.

Six usage quota components query subscriptionPermissions through GitLab's CustomersDot proxy. The proxy returns 404 as HTML when the feature is unavailable (everywhere except GitLab.com). Apollo cannot parse HTML as JSON and logs parse errors to the console and Sentry. The query answers only control UI labels, so skipping it when unavailable gives the same behavior as a failed request but without the noise.

Changes:

  • Backend: expose a gon flag telling the frontend whether the proxy exists
  • Backend: return JSON error from the proxy instead of HTML
  • Frontend: skip the query when the flag indicates the proxy is unavailable
  • Tests: verify the flag and query skipping work

References

Screenshots or screen recordings

Not applicable. No visible change. Only console errors and Sentry noise are removed.

How to set up and validate locally

  1. Run yarn jest ee/spec/frontend/lib/customers_dot_graphql_spec.js ee/spec/frontend/usage_quotas
  2. Run bundle exec rspec ee/spec/lib/ee/gitlab/gon_helper_spec.rb ee/spec/requests/customers_dot/proxy_controller_spec.rb
  3. In a GDK that is not simulating GitLab.com, open a group's Settings > Usage quotas, Pipelines tab, with the browser network and console panels open
  4. On master there is a request to /-/customers_dot/proxy/graphql that returns 404 and a console error. On this branch there is no such request and no console error.
  5. Optionally set GITLAB_SIMULATE_SAAS=1 and confirm the request is made again.

MR acceptance checklist

This MR has been evaluated against the acceptance checklist.

Merge request reports

Loading
Loading