shipit-engine 0.43.4 → 0.44.1

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: 7812fd5a848ac639a91c1d460deb46036e486d5b867c8944b22694fa36d11b80
4
- data.tar.gz: e41e95e8c766fd7e20461d21d5463fd37ab8cc2e9cfa2e6c38958e68bc48da32
3
+ metadata.gz: 6517a0e3d74705ce7d69cd7b3a5f2cc7f87ef7770aac3be6e35b20622d1e1638
4
+ data.tar.gz: e516a886a2221e94ace6047b53c5e85668b9dd8aa4b92df4e8482438c8c77fd7
5
5
  SHA512:
6
- metadata.gz: ba03564e83d57ff223597c80c14eb99b62ef8831cc3396f55a9def306905e996314699fed00f1a5ea04b1841535d980ff1fb87d9fc8fb05d8849e04e9414e0ee
7
- data.tar.gz: 17a7dbaffb9443dcf3b7e341af447f954c7e3fa2c931a4701d70a1747a4b815b0e7e7566d5e9686848887669cf3939b1ce05c560eb5dddc0487eebbafd80d652
6
+ metadata.gz: 252425e0adcc5c66f84313fce38216ba1a99f0fd54108d471fd56cd1f73288b253715aba1520abc5c0213930456d813663be714c12d52d5a14fd85c552273eb6
7
+ data.tar.gz: 6b1becf5a4dd25784ab1b7d900cf24eb877e25c54ca92a7603ee3f4f76ab1dfe54d8f615d1c920a2d6df9486a3a2503e1741ca76d21b28a24b6fdcbad136e0ee
@@ -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
@@ -70,7 +70,11 @@
70
70
  <p class="banner__text">
71
71
  Continuous Delivery for this stack is currently paused because
72
72
 
73
- <%= link_to_if stack.deployment_checks_passed?, 'the pre-deploy checks failed', stack_commit_checks_path(stack, sha: stack.next_commit_to_deploy.sha) %>.
73
+ <% if stack.next_commit_to_deploy %>
74
+ <%= link_to_if stack.deployment_checks_passed?, 'the pre-deploy checks failed', stack_commit_checks_path(stack, sha: stack.next_commit_to_deploy.sha) %>.
75
+ <% else %>
76
+ the pre-deploy checks failed.
77
+ <% end %>
74
78
  You can either wait for them to pass, or trigger a deploy manually.
75
79
  </p>
76
80
  </div>
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Shipit
4
- VERSION = '0.43.4'
4
+ VERSION = '0.44.1'
5
5
  end
@@ -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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: shipit-engine
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.43.4
4
+ version: 0.44.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jean Boussier
@@ -1051,7 +1051,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
1051
1051
  - !ruby/object:Gem::Version
1052
1052
  version: '0'
1053
1053
  requirements: []
1054
- rubygems_version: 4.0.4
1054
+ rubygems_version: 4.0.5
1055
1055
  specification_version: 4
1056
1056
  summary: Application deployment software
1057
1057
  test_files: