Check visibility of integrations dynamically in GraphQL ServiceTypeEnum
Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.
Summary
The available integrations are defined statically at https://gitlab.com/gitlab-org/gitlab/blob/6697a934fb5002bdb3a429f6299395541f7cdcea/app/graphql/types/projects/service_type_enum.rb#L8-10.
This means if we want to include an integration dynamically (e.g. by checking a feature flag in Integration.integration_names), the list in ServiceTypeEnum won't reflect this.
This came up in the MR for the new Zentao integration, which we want to keep disabled until it's ready: !67941 (comment 653940446)
Improvements
We need to change the definition of the enum so each value checks at runtime if it's visible.
I think we can use the visible? method from graphql-ruby for this: https://graphql-ruby.org/authorization/visibility.html
Involved components
app/graphql/types/projects/service_type_enum.rb-
app/graphql/types/base_enum.rb(maybe)