gitlab-qa 5.1.0 → 5.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 77a9207808fc033a918c2096734e3511fe8cf5126ddc791f16477c4062c13e8f
4
- data.tar.gz: 62c66c8604fcb5a73825a0e0e8e8c34aec1eca0e58e20c5effe17d2078fc82c6
3
+ metadata.gz: 30e6e754d6c1e8272e5e82f3601895f64f1612a5f1ca8a2b7255d1276114dee4
4
+ data.tar.gz: b7c4ad654f11d2a7adbbb893cfbb4bf839fa9858bf97e87bfd3b89b3ae53525e
5
5
  SHA512:
6
- metadata.gz: db859779d4aba13388c527e9183998d80e64422fa30fabd1446af46d2a6af540165ae3d0b5932059159c245104ecb528213977d281684fb75034e240efe48807
7
- data.tar.gz: 5f3160b6db99a7c4f0ae247b4990971a162b4728560c353842b79cf872a348c915ecf836be1549547aedd29ea4d0c2ea358276fe03a1e3df2c7fa3008f9a7d93
6
+ metadata.gz: 03516d22897b193f7748422519b52cfa70465cedeaf1ef405afdc88ea399ca748bb054723d67238bf0983c1fafbd23c469757ac4dc39b26481bc3813116407f7
7
+ data.tar.gz: 7df1fe3331bec065736ad9491d71c9eecdef50f2a7270dc0b94dbf6a72eff7ae9eb4d7575f976676f615a239fdca419a8155e8f4ab8e806864fdae56e061eafa
@@ -73,7 +73,8 @@ module Gitlab
73
73
  'QA_CAN_TEST_ADMIN_FEATURES' => :qa_can_test_admin_features,
74
74
  'MAILHOG_HOSTNAME' => :mailhog_hostname,
75
75
  'SLACK_QA_CHANNEL' => :slack_qa_channel,
76
- 'SLACK_QA_BOT_TOKEN' => :slack_qa_bot_token
76
+ 'CI_SLACK_WEBHOOK_URL' => :ci_slack_webhook_url,
77
+ 'SLACK_ICON_EMOJI' => :slack_icon_emoji
77
78
  }.freeze
78
79
 
79
80
  ENV_VARIABLES.each_value do |accessor|
@@ -96,6 +97,18 @@ module Gitlab
96
97
  ENV['CI_PROJECT_NAME']
97
98
  end
98
99
 
100
+ def ci_slack_webhook_url
101
+ ENV['CI_SLACK_WEBHOOK_URL']
102
+ end
103
+
104
+ def slack_qa_channel
105
+ ENV['SLACK_QA_CHANNEL']
106
+ end
107
+
108
+ def slack_icon_emoji
109
+ ENV['SLACK_ICON_EMOJI']
110
+ end
111
+
99
112
  def run_id
100
113
  @run_id ||= "gitlab-qa-run-#{Time.now.strftime('%Y-%m-%d-%H-%M-%S')}-#{SecureRandom.hex(4)}"
101
114
  end
@@ -165,10 +178,10 @@ module Gitlab
165
178
  raise ArgumentError, "Please provide SLACK_QA_CHANNEL"
166
179
  end
167
180
 
168
- def require_slack_qa_bot_token!
169
- return unless ENV['SLACK_QA_BOT_TOKEN'].to_s.strip.empty?
181
+ def require_ci_slack_webhook_url!
182
+ return unless ENV['CI_SLACK_WEBHOOK_URL'].to_s.strip.empty?
170
183
 
171
- raise ArgumentError, "Please provide SLACK_QA_BOT_TOKEN"
184
+ raise ArgumentError, "Please provide CI_SLACK_WEBHOOK_URL"
172
185
  end
173
186
 
174
187
  def require_kubernetes_environment!
@@ -8,14 +8,15 @@ module Gitlab
8
8
 
9
9
  def invoke!
10
10
  Runtime::Env.require_slack_qa_channel!
11
- Runtime::Env.require_slack_qa_bot_token!
11
+ Runtime::Env.require_ci_slack_webhook_url!
12
12
 
13
13
  params = {}
14
- params['token'] = Runtime::Env.slack_qa_bot_token
15
14
  params['channel'] = Runtime::Env.slack_qa_channel
15
+ params['username'] = "GitLab QA Bot"
16
+ params['icon_emoji'] = Runtime::Env.slack_icon_emoji
16
17
  params['text'] = @message
17
18
 
18
- url = "https://slack.com/api/chat.postMessage"
19
+ url = Runtime::Env.ci_slack_webhook_url
19
20
 
20
21
  Support::HttpRequest.make_http_request(method: 'post', url: url, params: params)
21
22
  end
@@ -9,7 +9,7 @@ module Gitlab
9
9
  def self.make_http_request(method: 'get', url: nil, params: {}, headers: {}, show_response: false, fail_on_error: true)
10
10
  raise "URL not defined for making request. Exiting..." unless url
11
11
 
12
- res = HTTP.follow.method(method).call(url, form: params, headers: headers)
12
+ res = HTTP.follow.method(method).call(url, json: params, headers: headers)
13
13
 
14
14
  if show_response
15
15
  if res.content_type.mime_type == "application/json"
@@ -1,5 +1,5 @@
1
1
  module Gitlab
2
2
  module QA
3
- VERSION = '5.1.0'.freeze
3
+ VERSION = '5.1.1'.freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gitlab-qa
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.1.0
4
+ version: 5.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Grzegorz Bizon
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-03-18 00:00:00.000000000 Z
11
+ date: 2020-03-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: climate_control