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 +4 -4
- data/.travis.yml +2 -0
- data/CHANGELOG.md +3 -0
- data/README.md +6 -3
- data/lib/pact_broker/version.rb +1 -1
- data/lib/pact_broker/webhooks/service.rb +1 -1
- data/spec/features/delete_webhook_spec.rb +30 -0
- metadata +5 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a2edb308c7e322351a0d87be210ccd4c9eaf4153
|
4
|
+
data.tar.gz: 24b63e6f8b5806bb363391f7b862ee3537855076
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dc2bf80f0f162989597ff0046c506ba67d0020b4cf0210ac33bca85221e8bc1ca54ef59bd7b356915daeb533e041e45eafdf2e39b2823c54ffc7ab25506b2c20
|
7
|
+
data.tar.gz: 9c81983d516bb00fc61d6dae594b33c9202c3b2ba4e33d7ef6901d25800615c574578e9701c3ea16b8f70b526cdf8d9dc70ba61d16ec139232d31f9beb08b668
|
data/.travis.yml
CHANGED
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
|
-
*
|
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
|
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
|
|
data/lib/pact_broker/version.rb
CHANGED
@@ -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
|
+
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-
|
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.
|
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
|