Commit 88e21ff5 authored by João Cunha's avatar João Cunha

Deprecate EnvironmentsCanaryIngressUpdate mutation

- Puts the mutation behind a FF
- Updates documentation to highlight the endpoint's deprecation
parent 4c05bcaf
......@@ -5,6 +5,7 @@ module Mutations
module CanaryIngress
class Update < ::Mutations::BaseMutation
graphql_name 'EnvironmentsCanaryIngressUpdate'
description '**Deprecated** This endpoint is planned to be removed along with certificate-based clusters. [See this epic](https://gitlab.com/groups/gitlab-org/configure/-/epics/8) for more information.'
authorize :update_environment
......@@ -18,7 +19,13 @@ module Mutations
required: true,
description: 'Weight of the Canary Ingress.'
REMOVAL_ERR_MSG = 'This endpoint was deactivated as part of the certificate-based' \
'kubernetes integration removal. See Epic:' \
'https://gitlab.com/groups/gitlab-org/configure/-/epics/8'
def resolve(id:, **kwargs)
return { errors: [REMOVAL_ERR_MSG] } if cert_based_clusters_ff_disabled?
environment = authorized_find!(id: id)
result = ::Environments::CanaryIngress::UpdateService
......@@ -33,6 +40,12 @@ module Mutations
id = ::Types::GlobalIDType[::Environment].coerce_isolated_input(id)
GitlabSchema.find_by_gid(id)
end
private
def cert_based_clusters_ff_disabled?
Feature.disabled?(:certificate_based_clusters, default_enabled: :yaml, type: :ops)
end
end
end
end
......
......@@ -2372,6 +2372,8 @@ Input type: `EnableDevopsAdoptionNamespaceInput`
### `Mutation.environmentsCanaryIngressUpdate`
**Deprecated** This endpoint is planned to be removed along with certificate-based clusters. [See this epic](https://gitlab.com/groups/gitlab-org/configure/-/epics/8) for more information.
Input type: `EnvironmentsCanaryIngressUpdateInput`
#### Arguments
......@@ -36,6 +36,20 @@ RSpec.describe Mutations::Environments::CanaryIngress::Update do
it 'returns no errors' do
expect(subject[:errors]).to be_empty
end
context 'with certificate_based_clusters disabled' do
before do
stub_feature_flags(certificate_based_clusters: false)
end
it 'returns notice about feature removal' do
expect(subject[:errors]).to match_array([
'This endpoint was deactivated as part of the certificate-based' \
'kubernetes integration removal. See Epic:' \
'https://gitlab.com/groups/gitlab-org/configure/-/epics/8'
])
end
end
end
context 'when service encounters a problem' do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment