Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2022-11-15 03:08:29 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2022-11-15 03:08:29 +0300
commit38b948a54e00841b51c446beb0adf079af60c963 (patch)
tree2e9dfe54e2d0ec444223f773dc283b1c639baae9 /app/models/integrations
parent7f35b02e86cd3d2e8b4a81c5c3a8483ff6973c5a (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/models/integrations')
-rw-r--r--app/models/integrations/chat_message/pipeline_message.rb9
-rw-r--r--app/models/integrations/datadog.rb4
-rw-r--r--app/models/integrations/jenkins.rb4
-rw-r--r--app/models/integrations/packagist.rb6
4 files changed, 16 insertions, 7 deletions
diff --git a/app/models/integrations/chat_message/pipeline_message.rb b/app/models/integrations/chat_message/pipeline_message.rb
index b3502905bf7..88db40bea7f 100644
--- a/app/models/integrations/chat_message/pipeline_message.rb
+++ b/app/models/integrations/chat_message/pipeline_message.rb
@@ -126,6 +126,14 @@ module Integrations
}
end
+ def pipeline_name_field
+ {
+ title: s_("ChatMessage|Pipeline name"),
+ value: pipeline.name,
+ short: false
+ }
+ end
+
def attachments_fields
fields = [
{
@@ -143,6 +151,7 @@ module Integrations
fields << failed_stages_field if failed_stages.any?
fields << failed_jobs_field if failed_jobs.any?
fields << yaml_error_field if pipeline.has_yaml_errors?
+ fields << pipeline_name_field if Feature.enabled?(:pipeline_name, project) && pipeline.name.present?
fields
end
diff --git a/app/models/integrations/datadog.rb b/app/models/integrations/datadog.rb
index eecf6b3a60a..27bed5d3f76 100644
--- a/app/models/integrations/datadog.rb
+++ b/app/models/integrations/datadog.rb
@@ -168,8 +168,8 @@ module Integrations
result = execute(data)
{
- success: (200..299).cover?(result[:http_status]),
- result: result[:message]
+ success: (200..299).cover?(result.payload[:http_status]),
+ result: result.message
}
end
diff --git a/app/models/integrations/jenkins.rb b/app/models/integrations/jenkins.rb
index 24a7ff62e68..d2e8393ef95 100644
--- a/app/models/integrations/jenkins.rb
+++ b/app/models/integrations/jenkins.rb
@@ -44,12 +44,12 @@ module Integrations
def test(data)
begin
result = execute(data)
- return { success: false, result: result[:message] } if result[:http_status] != 200
+ return { success: false, result: result.message } if result.payload[:http_status] != 200
rescue StandardError => e
return { success: false, result: e }
end
- { success: true, result: result[:message] }
+ { success: true, result: result.message }
end
override :hook_url
diff --git a/app/models/integrations/packagist.rb b/app/models/integrations/packagist.rb
index 64dfef1a4ef..7148de66aee 100644
--- a/app/models/integrations/packagist.rb
+++ b/app/models/integrations/packagist.rb
@@ -54,12 +54,12 @@ module Integrations
def test(data)
begin
result = execute(data)
- return { success: false, result: result[:message] } if result[:http_status] != 202
+ return { success: false, result: result.message } if result.payload[:http_status] != 202
rescue StandardError => e
- return { success: false, result: e }
+ return { success: false, result: e.message }
end
- { success: true, result: result[:message] }
+ { success: true, result: result.message }
end
override :hook_url