pact_broker 2.0.4 → 2.0.5

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
  SHA1:
3
- metadata.gz: 8b8b4752ea480c1accb24a8ac99986695d2927e1
4
- data.tar.gz: d6cd4104ef81b44b089ee51f37d28d46de6edc11
3
+ metadata.gz: a2edb308c7e322351a0d87be210ccd4c9eaf4153
4
+ data.tar.gz: 24b63e6f8b5806bb363391f7b862ee3537855076
5
5
  SHA512:
6
- metadata.gz: a3369dc3103dc71184db705883000d0ac6a522ca1f7450bf9635ae0976be70eff8a655be909d002c3157a5d7955ab991f3ccd348fc2eedf4960d04548eb43184
7
- data.tar.gz: 7d863d3a17c5d4aa0dcf05fcbe7584a085792894263e1486db6d90570e5aa8d6341eea39e6f06d6b622332363c03c02f84d5f3c497f116bc8c9ed15d0632009f
6
+ metadata.gz: dc2bf80f0f162989597ff0046c506ba67d0020b4cf0210ac33bca85221e8bc1ca54ef59bd7b356915daeb533e041e45eafdf2e39b2823c54ffc7ab25506b2c20
7
+ data.tar.gz: 9c81983d516bb00fc61d6dae594b33c9202c3b2ba4e33d7ef6901d25800615c574578e9701c3ea16b8f70b526cdf8d9dc70ba61d16ec139232d31f9beb08b668
data/.travis.yml CHANGED
@@ -6,6 +6,8 @@ rvm:
6
6
  services:
7
7
  - postgresql
8
8
  - mysql
9
+ addons:
10
+ postgresql: "9.5"
9
11
  env:
10
12
  - DATABASE_ADAPTER=default RUBYOPT="-W0"
11
13
  - DATABASE_ADAPTER=postgres RUBYOPT="-W0"
data/CHANGELOG.md CHANGED
@@ -2,6 +2,9 @@ Do this to generate your change history
2
2
 
3
3
  $ git log --pretty=format:' * %h - %s (%an, %ad)'
4
4
 
5
+ #### 2.0.5 (2017-06-15)
6
+ * e924c96 - Fixed webhook deletion bug (Beth Skurrie, Tue Jun 13 10:04:33 2017 +1000)
7
+
5
8
  #### 2.0.4 (2017-06-02)
6
9
  * 99e1c25 - Turn off http_origin checking for https://github.com/pact-foundation/pact_broker/issues/108 (Beth Skurrie, Fri Jun 2 16:27:38 2017 +1000)
7
10
  * e58f609 - Add favicon.ico (Beth Skurrie, Mon May 29 15:02:22 2017 +1000)
data/README.md CHANGED
@@ -18,8 +18,9 @@ Features:
18
18
  * An embedded HAL browser for navigating the API.
19
19
  * Autogenerated documentation for each pact.
20
20
  * Dynamically generated network diagrams.
21
+ * Displays provider verificaton results.
21
22
  * Enables a pact version to be tagged (ie. "prod") so a provider can verify itself against a fixed version of a pact to ensure backwards compatibility.
22
- * Webhooks to trigger a provider build when a consumer publishes a change to a pact.
23
+ * Provides webhooks to trigger a provider build when a consumer publishes a change to a pact.
23
24
  * Tracks changes between Pact versions so you can tell when a consumer has changed its expectations.
24
25
  * [Docker Pact Broker][docker]
25
26
 
@@ -30,12 +31,14 @@ Travis CI Status: [![Build Status](https://travis-ci.org/pact-foundation/pact_br
30
31
  #### Step 1. Consumer CI build
31
32
  1. The consumer project runs its tests using the [Pact][pact] library to provide a mock service.
32
33
  2. While the tests run, the mock service writes the requests and the expected responses to a JSON "pact" file - this is the consumer contract.
33
- 3. The generated pact is then published to the Pact Broker. This is simply a PUT to a resource that specifies the consumer name and version, and the provider name. eg `http://my-pact-broker/pacts/provider/Animal%20Service/consumer/Zoo%20App/version/1.0.0`
34
+ 3. The generated pact is then published to the Pact Broker. This is simply a `PUT` to a resource that specifies the consumer name and version, and the provider name. eg `http://my-pact-broker/pacts/provider/Animal%20Service/consumer/Zoo%20App/version/1.0.0`
35
+ 4. When a pact is published, a webhook in the Pact Broker kicks off a build of the provider project if the pact content has changed since the previous version.
34
36
 
35
37
  #### Step 2. Provider CI build
36
- 1. The provider has a verification task that is configured with the URL to retrieve the dynamically calculated latest pact between itself and the consumer. eg `http://my-pact-broker/pacts/provider/Animal%20Service/consumer/Zoo%20App/latest`. The "latest" version is determined by the Pact Broker by inspecting the consumer version number specified when each pact was published.
38
+ 1. The provider has a verification task that is configured with the URL to retrieve the latest pact between itself and the consumer. eg `http://my-pact-broker/pacts/provider/Animal%20Service/consumer/Zoo%20App/latest`.
37
39
  2. The provider build runs the pact verification task, which retrieves the pact from the Pact Broker, replays each request against the provider, and checks that the responses match the expected responses.
38
40
  3. If the pact verification fails, the build fails. The [Pact Broker CI Nerf Gun][nerf] magically determines who caused the verification to fail, and shoots them.
41
+ 4. The results of the verification are published back to the Pact Broker by the pact verification tool, so the consumer team will know if the code they have written will work IRL.
39
42
 
40
43
  If you don't have a [Pact Broker CI Nerf Gun][nerf], you'll probably want to read about using pact when the consumer and provider are being written by [different teams][different-teams].
41
44
 
@@ -1,3 +1,3 @@
1
1
  module PactBroker
2
- VERSION = '2.0.4'
2
+ VERSION = '2.0.5'
3
3
  end
@@ -31,7 +31,7 @@ module PactBroker
31
31
  end
32
32
 
33
33
  def self.delete_by_uuid uuid
34
- webhook_repository.delete_executions_by_webhook_uuid uuid
34
+ webhook_repository.unlink_executions_by_webhook_uuid uuid
35
35
  webhook_repository.delete_by_uuid uuid
36
36
  end
37
37
 
@@ -0,0 +1,30 @@
1
+ require 'support/provider_state_builder'
2
+
3
+ describe "Delete a webhook" do
4
+
5
+ let!(:webhook) do
6
+ ProviderStateBuilder.new
7
+ .create_consumer("Some Consumer")
8
+ .create_consumer_version("Some Provider")
9
+ .create_provider
10
+ .create_pact
11
+ .create_webhook
12
+ .create_webhook_execution
13
+ .and_return(:webhook)
14
+ end
15
+
16
+ let(:path) { "/webhooks/#{webhook.uuid}" }
17
+ let(:response_body) { JSON.parse(last_response.body, symbolize_names: true)}
18
+ let(:webhook_json) { webhook_hash.to_json }
19
+
20
+ subject { delete path }
21
+
22
+ it "deletes the webhook" do
23
+ expect { subject }.to change { PactBroker::Webhooks::Webhook.count }.by(-1)
24
+ end
25
+
26
+ it "returns a 204 response" do
27
+ subject
28
+ expect(last_response.status).to eq 204
29
+ end
30
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pact_broker
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.4
4
+ version: 2.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bethany Skurrie
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2017-06-02 00:00:00.000000000 Z
13
+ date: 2017-06-15 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: httparty
@@ -670,6 +670,7 @@ files:
670
670
  - spec/features/create_webhook_spec.rb
671
671
  - spec/features/delete_pact_spec.rb
672
672
  - spec/features/delete_version_spec.rb
673
+ - spec/features/delete_webhook_spec.rb
673
674
  - spec/features/get_diff_spec.rb
674
675
  - spec/features/get_pact_spec.rb
675
676
  - spec/features/get_pact_versions_spec.rb
@@ -854,7 +855,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
854
855
  version: '0'
855
856
  requirements: []
856
857
  rubyforge_project:
857
- rubygems_version: 2.6.11
858
+ rubygems_version: 2.4.5
858
859
  signing_key:
859
860
  specification_version: 4
860
861
  summary: See description
@@ -862,6 +863,7 @@ test_files:
862
863
  - spec/features/create_webhook_spec.rb
863
864
  - spec/features/delete_pact_spec.rb
864
865
  - spec/features/delete_version_spec.rb
866
+ - spec/features/delete_webhook_spec.rb
865
867
  - spec/features/get_diff_spec.rb
866
868
  - spec/features/get_pact_spec.rb
867
869
  - spec/features/get_pact_versions_spec.rb