pact_broker 2.11.0 → 2.12.0

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: 2be4a315bf32e66c226b7c5535fc5cab4f946ce7
4
- data.tar.gz: 010232f4eb580f069a8894a8c8a0f2186e16824a
3
+ metadata.gz: d063090dbbc3a73389a38780a8fab42eb34c79ed
4
+ data.tar.gz: 3e8ad44036962e66ec75ab114fe67f650011a239
5
5
  SHA512:
6
- metadata.gz: 4090832d24ec979af748a4652423f15f3e4904d0de88ecd66878311973f22d5af10ae87d9a4e8892e3e9f0f172f14cd4203d7c2e3869ea9ad485e34e53a34b6e
7
- data.tar.gz: 1598b04e3e30b92706a6435d6bb12209ccd93a92b3129ebfd3394a0f5b29e5f075db7c8aab5b8e9b03e2faa4bc6c322e99b86bcdbe0856c4818bd1dcdcfeb0e2
6
+ metadata.gz: 06ea287eb052baf4e753222b1c4424f944fa80efaba076cd123ff866a7f1a84d0bcd3b87ce1961fb6586058988b040ab7bd1013e7d0fa9fc78a36dca64fdcbdd
7
+ data.tar.gz: 34db45d125d6c0921bcfc23918aa6b173e0d3868e5b702511d460f0530e1374be0be185937120e35ac9f1851f3b30f47712a6b8bb83caa02ec624bec60fd8304
@@ -1,3 +1,13 @@
1
+ <a name="v2.12.0"></a>
2
+ ### v2.12.0 (2017-11-29)
3
+
4
+ #### Features
5
+ * changed date published to time ago in words, with full date as mouseover (#145) ([b28f9c3](/../../commit/b28f9c3))
6
+
7
+ #### Bug Fixes
8
+
9
+ * fixed issue that caused uninitialized constant PactBroker::Api::Resources::BaseResource (NameError) when running pact_broker with passenger.. ([0b21a62](/../../commit/0b21a62))
10
+
1
11
  <a name="v2.10.0"></a>
2
12
  ### v2.10.0 (2017-11-11)
3
13
 
data/README.md CHANGED
@@ -6,28 +6,34 @@
6
6
  [![Issue Count](https://codeclimate.com/github/pact-foundation/pact_broker/badges/issue_count.svg)](https://codeclimate.com/github/pact-foundation/pact_broker)
7
7
  [![Dependency Status](https://gemnasium.com/badges/github.com/pact-foundation/pact_broker.svg)](https://gemnasium.com/github.com/pact-foundation/pact_broker)
8
8
 
9
- The Pact Broker provides a repository for consumer driven contracts created using the pact gem.
9
+ The Pact Broker is an application for sharing for consumer driven contracts. It is optimised for use with "pacts" (contracts created by the [Pact][pact-docs] framework), but can be used for any type of contract that can be serialized to JSON.
10
+
10
11
 
11
12
  It:
12
13
 
13
- * solves the problem of how to share pacts between consumer and provider projects
14
- * allows you to [decouple your service release cycles][decouple]
15
- * provides API documentation that is guaranteed to be up-to date
14
+ * allows you to release customer value quickly and confidently by [deploying your services independently][decouple] and avoiding the bottleneck of integration tests
15
+ * solves the problem of how to share contracts and verification results between consumer and provider projects
16
+ * tells you which versions of your applications can be deployed safely together
17
+ * automatically versions your contracts
18
+ * allows you to ensure backwards compatibility between multiple consumer and provider versions (eg. in a mobile or multi-tenant environment)
19
+ * provides API documentation of your applications that is guaranteed to be up-to date
16
20
  * shows you real examples of how your services interact
17
21
  * allows you to visualise the relationships between your services
18
22
 
19
23
  Features:
20
24
 
21
25
  * A RESTful API for publishing and retrieving pacts.
22
- * An embedded HAL browser for navigating the API.
26
+ * An embedded API browser for navigating the API.
23
27
  * Autogenerated documentation for each pact.
24
28
  * Dynamically generated network diagrams so you can visualise your microservice network.
25
29
  * Displays provider verificaton results so you know if you can deploy safely.
30
+ * Provides a "matrix" of compatible consumer and provider versions, so you know which versions can be safely deployed together.
26
31
  * Provides badges to display pact verification statuses in your READMEs.
27
- * 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.
28
- * Provides webhooks to trigger a provider build when a consumer publishes a change to a pact.
32
+ * Enables an application version to be tagged (ie. "prod", "feat/customer-preferences") to allow repository-like workflows.
33
+ * Provides webhooks to trigger actions when pacts change eg. run provider build, notify a Slack channel.
29
34
  * View diffs between Pact versions so you can tell what expectations have changed.
30
35
  * [Docker Pact Broker][docker]
36
+ * A [CLI][cli] for encorporating the Pact workflow into your continuous integration process.
31
37
 
32
38
  ### How would I use the Pact Broker?
33
39
 
@@ -42,10 +48,17 @@ Features:
42
48
  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`.
43
49
  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.
44
50
  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.
45
- 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.
51
+ 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 in real life.
46
52
 
47
53
  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].
48
54
 
55
+ #### Step 3. Back to the Consumer CI build
56
+
57
+ The following funcationality is in beta release. Your feedback would be appreciated.
58
+
59
+ 1. The Consumer CI determines if the pact has been verified by running `pact-broker can-i-deploy --pacticipant CONSUMER_NAME --version CONSUMER_VERSION ...` (see documentation [here](https://github.com/pact-foundation/pact_broker-client#can-i-deploy))
60
+ 1. If the pact has been verified, the deployment can proceed.
61
+
49
62
  ## Documentation
50
63
 
51
64
  See the [wiki][wiki] for documentation on the Pact Broker.
@@ -142,3 +155,5 @@ Please read the [UPGRADING.md](UPGRADING.md) documentation before upgrading your
142
155
  [twitter]: https://twitter.com/pact_up
143
156
  [gitter]: https://gitter.im/realestate-com-au/pact
144
157
  [issues]: https://github.com/pact-foundation/pact_broker/issues
158
+ [pact-docs]: http://docs.pact.io
159
+ [cli]: https://github.com/pact-foundation/pact-ruby-standalone/releases
@@ -57,8 +57,8 @@ module PactBroker
57
57
  <span class='value'>#{@pact.consumer_version_number}#{tags}</span>
58
58
  </li>
59
59
  <li>
60
- <span class='name'>Date published:</span>
61
- <span class='value'>#{published_date}</span>
60
+ <span class='name' title='#{published_date}'>Date published:</span>
61
+ <span class='value' title='#{published_date}'>#{published_date_in_words}</span>
62
62
  </li>
63
63
  <li>
64
64
  <a href=\"#{json_url}\">View in API Browser</a>
@@ -108,6 +108,10 @@ module PactBroker
108
108
  @pact.created_at.to_time.localtime.to_datetime.strftime("%a %d %b %Y, %l:%M%P %:z")
109
109
  end
110
110
 
111
+ def published_date_in_words
112
+ PactBroker::DateHelper.distance_of_time_in_words(@pact.created_at.to_time, DateTime.now) + " ago"
113
+ end
114
+
111
115
  def json_url
112
116
  PactBroker::Api::PactBrokerUrls.hal_browser_url pact_url
113
117
  end
@@ -1,5 +1,6 @@
1
1
  require 'pact_broker/services'
2
2
  require 'pact_broker/api/decorators/version_decorator'
3
+ require 'pact_broker/api/resources/base_resource'
3
4
 
4
5
  module PactBroker
5
6
  module Api
@@ -2,9 +2,8 @@
2
2
 
3
3
  Allowed methods: POST
4
4
 
5
- Use the `pb:publish-verification-results` link in the pact resource to publish the result (either success or failure) of a pact verification. The body of the request must include the success (true or false) and the provider application version that the pact was verified against. It may also include the build URL to facilitate debugging when failures occur.
6
-
7
- POST http://broker/pacts/provider/Foo/consumer/Bar/pact-version/1234
5
+ Use a `POST` request to the `pb:publish-verification-results` link (`$['_links']['pb:publish-verification-results']['href']`) in the pact resource to publish the result (either success or failure) of a pact verification. The body of the request must include the success (true or false) and the provider application version that the pact was verified against. It may also include the build URL to facilitate debugging when failures occur.
6
+
8
7
  {
9
8
  "success": true,
10
9
  "providerApplicationVersion": "4.5.6",
@@ -1,3 +1,3 @@
1
1
  module PactBroker
2
- VERSION = '2.11.0'
2
+ VERSION = '2.12.0'
3
3
  end
@@ -52,4 +52,5 @@ Gem::Specification.new do |gem|
52
52
  gem.add_development_dependency 'pg', '~>0.21'
53
53
  gem.add_development_dependency 'conventional-changelog', '~>1.3'
54
54
  gem.add_development_dependency 'bump', '~> 0.5'
55
+ gem.add_development_dependency 'timecop', '~> 0.9'
55
56
  end
@@ -1,5 +1,6 @@
1
1
  require 'spec_helper'
2
2
  require 'pact_broker/api/renderers/html_pact_renderer'
3
+ require 'timecop'
3
4
 
4
5
  module PactBroker
5
6
  module Api
@@ -10,10 +11,13 @@ module PactBroker
10
11
  ENV['BACKUP_TZ'] = ENV['TZ']
11
12
  ENV['TZ'] = "Australia/Melbourne"
12
13
  PactBroker.configuration.enable_public_badge_access = true
14
+
15
+ Timecop.freeze(created_at + 3)
13
16
  end
14
17
 
15
18
  after do
16
19
  ENV['TZ'] = ENV['BACKUP_TZ']
20
+ Timecop.return
17
21
  end
18
22
 
19
23
  let(:consumer) { double('consumer', name: 'Consumer')}
@@ -47,6 +51,7 @@ module PactBroker
47
51
  expect(subject).to match /<h\d>.*Some Provider/
48
52
  expect(subject).to include("Date published:")
49
53
  expect(subject).to include("Thu 27 Feb 2014, 11:00am +11:00")
54
+ expect(subject).to include("3 days ago")
50
55
  expect(subject).to match /title.*Pact between Consumer and Provider/
51
56
  expect(subject).to match /prod, master/
52
57
  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.11.0
4
+ version: 2.12.0
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-11-11 00:00:00.000000000 Z
13
+ date: 2017-12-09 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: httparty
@@ -444,6 +444,20 @@ dependencies:
444
444
  - - "~>"
445
445
  - !ruby/object:Gem::Version
446
446
  version: '0.5'
447
+ - !ruby/object:Gem::Dependency
448
+ name: timecop
449
+ requirement: !ruby/object:Gem::Requirement
450
+ requirements:
451
+ - - "~>"
452
+ - !ruby/object:Gem::Version
453
+ version: '0.9'
454
+ type: :development
455
+ prerelease: false
456
+ version_requirements: !ruby/object:Gem::Requirement
457
+ requirements:
458
+ - - "~>"
459
+ - !ruby/object:Gem::Version
460
+ version: '0.9'
447
461
  description: A server that stores and returns pact files generated by the pact gem.
448
462
  It enables head/prod cross testing of the consumer and provider projects.
449
463
  email: