shipit-engine 0.43.3 → 0.44.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 66eab74ac8acc7bb806d26984fe9d221983da860661eff6d6ae7e263f71da2f4
|
|
4
|
+
data.tar.gz: 3b9b797b5bf0ea20278ad9d0145ab2c42e02a6053b0efdc7f30c9838ff81b382
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 23fbda676f424e7660165c46636901490b636645b1b51f9dc9755ff24c71ea5cd09f09ac4f734a9708bdc687affb5536a4aaf18849f9606998581aeef6b0b472
|
|
7
|
+
data.tar.gz: 89878c82e92b1b8780f7198800135fd18cc190ec5276b08bb48a7b1ffba65d4add8013f9e65b4e0af7910b8956c92dbb8b2f3043650e24c419eccdf825cce611
|
|
@@ -36,6 +36,16 @@ module Shipit
|
|
|
36
36
|
"signature=#{request.headers['X-Hub-Signature']}",
|
|
37
37
|
"status=#{status}"
|
|
38
38
|
].join(' '))
|
|
39
|
+
rescue Shipit::GithubOrganizationUnknown => e
|
|
40
|
+
head(422)
|
|
41
|
+
Rails.logger.warn([
|
|
42
|
+
'WebhookController#verify_signature',
|
|
43
|
+
'Webhook from unknown organization',
|
|
44
|
+
"event=#{event}",
|
|
45
|
+
"repository_owner=#{repository_owner}",
|
|
46
|
+
"unknown_organization=#{e.message}",
|
|
47
|
+
"status=#{status}"
|
|
48
|
+
].join(' '))
|
|
39
49
|
end
|
|
40
50
|
|
|
41
51
|
def check_if_ping
|
data/lib/shipit/version.rb
CHANGED
|
@@ -106,6 +106,26 @@ module Shipit
|
|
|
106
106
|
assert_response :unprocessable_entity
|
|
107
107
|
end
|
|
108
108
|
|
|
109
|
+
test "unknown github organization logs and returns unprocessable entity" do
|
|
110
|
+
@request.headers['X-Github-Event'] = 'push'
|
|
111
|
+
|
|
112
|
+
payload = JSON.parse(payload(:push_master))
|
|
113
|
+
payload["repository"]["owner"]["login"] = "unknown-org"
|
|
114
|
+
|
|
115
|
+
Shipit.stubs(:github).raises(Shipit::GithubOrganizationUnknown.new("unknown-org"))
|
|
116
|
+
Rails.logger.expects(:warn).with([
|
|
117
|
+
'WebhookController#verify_signature',
|
|
118
|
+
'Webhook from unknown organization',
|
|
119
|
+
"event=push",
|
|
120
|
+
"repository_owner=unknown-org",
|
|
121
|
+
"unknown_organization=unknown-org",
|
|
122
|
+
"status=422"
|
|
123
|
+
].join(' '))
|
|
124
|
+
|
|
125
|
+
post :create, body: payload.to_json, as: :json
|
|
126
|
+
assert_response :unprocessable_entity
|
|
127
|
+
end
|
|
128
|
+
|
|
109
129
|
test ":membership creates the mentioned team on the fly" do
|
|
110
130
|
@request.headers['X-Github-Event'] = 'membership'
|
|
111
131
|
assert_difference -> { Team.count }, 1 do
|
|
@@ -71,7 +71,7 @@ module Shipit
|
|
|
71
71
|
--retry 2
|
|
72
72
|
).gsub(/\s+/, ' ').strip
|
|
73
73
|
config_command = "bundle config set --local path #{@spec.bundle_path}"
|
|
74
|
-
without_command = "bundle config set without 'default:production:development:test:staging:benchmark:debug'"
|
|
74
|
+
without_command = "bundle config set --local without 'default:production:development:test:staging:benchmark:debug'"
|
|
75
75
|
|
|
76
76
|
assert_equal command, @spec.bundle_install.last
|
|
77
77
|
assert @spec.bundle_install.include?(config_command)
|
|
@@ -87,7 +87,7 @@ module Shipit
|
|
|
87
87
|
--retry 2
|
|
88
88
|
).gsub(/\s+/, ' ').strip
|
|
89
89
|
assert_equal command, @spec.bundle_install.last
|
|
90
|
-
without_command = "bundle config set without 'some:custom:groups'"
|
|
90
|
+
without_command = "bundle config set --local without 'some:custom:groups'"
|
|
91
91
|
assert @spec.bundle_install.include?(without_command)
|
|
92
92
|
end
|
|
93
93
|
|