summaryrefslogtreecommitdiff
path: root/app/graphql/mutations/alert_management/http_integration
diff options
context:
space:
mode:
authorRobert Speicher <rspeicher@gmail.com>2021-01-20 13:34:23 -0600
committerRobert Speicher <rspeicher@gmail.com>2021-01-20 13:34:23 -0600
commit6438df3a1e0fb944485cebf07976160184697d72 (patch)
tree00b09bfd170e77ae9391b1a2f5a93ef6839f2597 /app/graphql/mutations/alert_management/http_integration
parent42bcd54d971da7ef2854b896a7b34f4ef8601067 (diff)
downloadgitlab-ce-6438df3a1e0fb944485cebf07976160184697d72.tar.gz
Add latest changes from gitlab-org/gitlab@13-8-stable-eev13.8.0-rc42
Diffstat (limited to 'app/graphql/mutations/alert_management/http_integration')
-rw-r--r--app/graphql/mutations/alert_management/http_integration/create.rb19
-rw-r--r--app/graphql/mutations/alert_management/http_integration/destroy.rb2
-rw-r--r--app/graphql/mutations/alert_management/http_integration/http_integration_base.rb2
-rw-r--r--app/graphql/mutations/alert_management/http_integration/reset_token.rb2
-rw-r--r--app/graphql/mutations/alert_management/http_integration/update.rb6
5 files changed, 20 insertions, 11 deletions
diff --git a/app/graphql/mutations/alert_management/http_integration/create.rb b/app/graphql/mutations/alert_management/http_integration/create.rb
index ddb75e66bb4..ff165d7f302 100644
--- a/app/graphql/mutations/alert_management/http_integration/create.rb
+++ b/app/graphql/mutations/alert_management/http_integration/create.rb
@@ -10,32 +10,41 @@ module Mutations
argument :project_path, GraphQL::ID_TYPE,
required: true,
- description: 'The project to create the integration in'
+ description: 'The project to create the integration in.'
argument :name, GraphQL::STRING_TYPE,
required: true,
- description: 'The name of the integration'
+ description: 'The name of the integration.'
argument :active, GraphQL::BOOLEAN_TYPE,
required: true,
- description: 'Whether the integration is receiving alerts'
+ description: 'Whether the integration is receiving alerts.'
def resolve(args)
- project = authorized_find!(full_path: args[:project_path])
+ @project = authorized_find!(full_path: args[:project_path])
response ::AlertManagement::HttpIntegrations::CreateService.new(
project,
current_user,
- args.slice(:name, :active)
+ http_integration_params(args)
).execute
end
private
+ attr_reader :project
+
def find_object(full_path:)
resolve_project(full_path: full_path)
end
+
+ # overriden in EE
+ def http_integration_params(args)
+ args.slice(:name, :active)
+ end
end
end
end
end
+
+Mutations::AlertManagement::HttpIntegration::Create.prepend_if_ee('::EE::Mutations::AlertManagement::HttpIntegration::Create')
diff --git a/app/graphql/mutations/alert_management/http_integration/destroy.rb b/app/graphql/mutations/alert_management/http_integration/destroy.rb
index 45d4bd778da..d0420e2bcb5 100644
--- a/app/graphql/mutations/alert_management/http_integration/destroy.rb
+++ b/app/graphql/mutations/alert_management/http_integration/destroy.rb
@@ -8,7 +8,7 @@ module Mutations
argument :id, Types::GlobalIDType[::AlertManagement::HttpIntegration],
required: true,
- description: "The ID of the integration to remove"
+ description: "The ID of the integration to remove."
def resolve(id:)
integration = authorized_find!(id: id)
diff --git a/app/graphql/mutations/alert_management/http_integration/http_integration_base.rb b/app/graphql/mutations/alert_management/http_integration/http_integration_base.rb
index d328eabf244..147df982bec 100644
--- a/app/graphql/mutations/alert_management/http_integration/http_integration_base.rb
+++ b/app/graphql/mutations/alert_management/http_integration/http_integration_base.rb
@@ -7,7 +7,7 @@ module Mutations
field :integration,
Types::AlertManagement::HttpIntegrationType,
null: true,
- description: "The HTTP integration"
+ description: "The HTTP integration."
authorize :admin_operations
diff --git a/app/graphql/mutations/alert_management/http_integration/reset_token.rb b/app/graphql/mutations/alert_management/http_integration/reset_token.rb
index 3938b38260e..bf73a9eaae7 100644
--- a/app/graphql/mutations/alert_management/http_integration/reset_token.rb
+++ b/app/graphql/mutations/alert_management/http_integration/reset_token.rb
@@ -8,7 +8,7 @@ module Mutations
argument :id, Types::GlobalIDType[::AlertManagement::HttpIntegration],
required: true,
- description: "The ID of the integration to mutate"
+ description: "The ID of the integration to mutate."
def resolve(id:)
integration = authorized_find!(id: id)
diff --git a/app/graphql/mutations/alert_management/http_integration/update.rb b/app/graphql/mutations/alert_management/http_integration/update.rb
index 98e0f7eb14f..431fccaa5e5 100644
--- a/app/graphql/mutations/alert_management/http_integration/update.rb
+++ b/app/graphql/mutations/alert_management/http_integration/update.rb
@@ -8,15 +8,15 @@ module Mutations
argument :id, Types::GlobalIDType[::AlertManagement::HttpIntegration],
required: true,
- description: "The ID of the integration to mutate"
+ description: "The ID of the integration to mutate."
argument :name, GraphQL::STRING_TYPE,
required: false,
- description: "The name of the integration"
+ description: "The name of the integration."
argument :active, GraphQL::BOOLEAN_TYPE,
required: false,
- description: "Whether the integration is receiving alerts"
+ description: "Whether the integration is receiving alerts."
def resolve(args)
integration = authorized_find!(id: args[:id])