pact_broker 1.9.1 → 1.9.2
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 +4 -4
- data/.ruby-version +1 -1
- data/.travis.yml +3 -4
- data/CHANGELOG.md +26 -0
- data/RELEASING.md +14 -0
- data/lib/pact_broker/api/resources/base_resource.rb +13 -4
- data/lib/pact_broker/api/resources/pact_webhooks.rb +2 -2
- data/lib/pact_broker/api/resources/webhook_execution.rb +1 -1
- data/lib/pact_broker/version.rb +1 -1
- data/spec/features/create_webhook_spec.rb +2 -2
- data/spec/features/publish_pact_spec.rb +2 -2
- data/spec/integration/app_spec.rb +2 -2
- data/spec/lib/pact_broker/api/resources/group_spec.rb +1 -1
- data/spec/lib/pact_broker/api/resources/latest_pact_spec.rb +1 -1
- data/spec/lib/pact_broker/api/resources/pact_spec.rb +1 -1
- data/spec/lib/pact_broker/api/resources/pact_webhooks_spec.rb +4 -4
- data/spec/lib/pact_broker/api/resources/pacticipants_spec.rb +2 -2
- data/spec/spec_helper.rb +0 -1
- data/spec/support/shared_examples_for_responses.rb +4 -4
- metadata +4 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: c285071df8a34453dd1c3ff0cbb5f1e751c549be
|
|
4
|
+
data.tar.gz: 96255aae9d7e98bedea99a8cf23300f2a2f80e0a
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: f04fc6ca50dab13939566f3411200775f233ce60da0fdb1b8e13bcebb0887c0b68a4915e411ed040aae3e0feed5a15ab74fea59c7e02ae569197b0bf56b27809
|
|
7
|
+
data.tar.gz: ef91a1fdafba7d7ed1d51fad040229f3a23e156854aeb042d1c5440bcacb4b63b88e4dde3f5a3cb2b393792eea60160d46cf1963453bcb4c70271ed7360dd7ae
|
data/.ruby-version
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
2.
|
|
1
|
+
2.3.0
|
data/.travis.yml
CHANGED
data/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,32 @@ Do this to generate your change history
|
|
|
2
2
|
|
|
3
3
|
$ git log --pretty=format:' * %h - %s (%an, %ad)' vX.Y.Z..HEAD
|
|
4
4
|
|
|
5
|
+
#### 1.9.2 (2016-04-29)
|
|
6
|
+
* 6d4ce4f - Update default dev ruby version to 2.3.0 (Sergei Matheson, Fri Apr 29 11:39:59 2016 +1000)
|
|
7
|
+
* 039fce9 - Add release instructions (Sergei Matheson, Fri Apr 29 10:42:17 2016 +1000)
|
|
8
|
+
* d48a1fa - Append `charset=utf-8` in json error response (Taiki Ono, Tue Mar 15 21:11:59 2016 +0900)
|
|
9
|
+
* 7f34940 - Remove unused variable (Taiki Ono, Tue Mar 15 21:06:23 2016 +0900)
|
|
10
|
+
* e932c28 - Append `charset=utf-8` to `Content-Type` header (Taiki Ono, Tue Mar 15 17:54:48 2016 +0900)
|
|
11
|
+
* 6252c1c - Does not change YAML::ENGINE.yamler (Taiki Ono, Sun Mar 13 22:03:41 2016 +0900)
|
|
12
|
+
* 9f02474 - Update Travis CI setting with new Rubies (Taiki Ono, Sun Mar 13 21:19:17 2016 +0900)
|
|
13
|
+
* 5a506dc - Belatedly, updated changelog (Sergei Matheson, Fri Feb 26 09:30:46 2016 +1100)
|
|
14
|
+
|
|
15
|
+
#### 1.9.1 (2016-02-26)
|
|
16
|
+
* e6e6d49 - Release version 1.9.1 (Sergei Matheson, Fri Feb 26 09:26:52 2016 +1100)
|
|
17
|
+
* 5ea7607 - Merge pull request #44 from sigerber/master (Beth Skurrie, Thu Feb 25 14:39:17 2016 +1100)
|
|
18
|
+
* ade2599 - Fix performance of groupify (Horia Musat and Simon Gerber, Wed Feb 24 14:50:39 2016 +1100)
|
|
19
|
+
* 38869ad - Return a 409 when there is a potential duplicate pacticipant name when publishing a pact. (Beth, Thu Nov 5 17:43:32 2015 +1100)
|
|
20
|
+
* 2991441 - Merge pull request #42 from bethesque/issue-41 (Beth Skurrie, Fri Oct 23 15:52:39 2015 +1100)
|
|
21
|
+
* 933981c - Now supports HTTPS webhooks (Warner Godfrey, Fri Oct 23 14:48:28 2015 +1100)
|
|
22
|
+
* 2123ff1 - Merge pull request #40 from elgalu/travis-badge (Beth Skurrie, Thu Oct 15 06:40:09 2015 +1100)
|
|
23
|
+
* 88cea3f - Add TravisCI badge in README.md (Leo Gallucci, Wed Oct 14 17:02:52 2015 +0200)
|
|
24
|
+
* b54c5c6 - Merge pull request #38 from gitter-badger/gitter-badge (Beth Skurrie, Tue Sep 29 15:37:27 2015 +1000)
|
|
25
|
+
* 42e9bc2 - Add Gitter badge (The Gitter Badger, Tue Sep 29 04:51:17 2015 +0000)
|
|
26
|
+
* 711ac85 - Merge pull request #37 from elgalu/ruby-2.1.3 (Beth Skurrie, Fri Sep 18 06:42:47 2015 +1000)
|
|
27
|
+
* 40ddb97 - Add ruby 2.1.3 and set as default (Leo Gallucci, Thu Sep 17 16:19:09 2015 +0200)
|
|
28
|
+
* a1fa248 - Updated example with postgres details (Beth, Thu Sep 17 09:25:09 2015 +1000)
|
|
29
|
+
* 383d137 - Create LICENSE.txt (Beth Skurrie, Mon Aug 24 06:29:50 2015 +1000)
|
|
30
|
+
|
|
5
31
|
#### 1.9.0 (2015-08-19)
|
|
6
32
|
|
|
7
33
|
* eda171e - Allow pact broker API to be run using Rack map at an arbitrary path. e.g. "/foo/pacts". Note, this does not work for the UI. (Beth, Wed Aug 19 08:44:21 2015 +1000)
|
data/RELEASING.md
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# Releasing
|
|
2
|
+
|
|
3
|
+
1. Increment the version in `lib/pact/support/version.rb`
|
|
4
|
+
2. Update the `CHANGELOG.md` using:
|
|
5
|
+
|
|
6
|
+
$ git log --pretty=format:' * %h - %s (%an, %ad)' vX.Y.Z..HEAD
|
|
7
|
+
|
|
8
|
+
3. Add files to git
|
|
9
|
+
|
|
10
|
+
$ git add CHANGELOG.md lib/pact_broker/version.rb
|
|
11
|
+
|
|
12
|
+
3. Release:
|
|
13
|
+
|
|
14
|
+
$ bundle exec rake release
|
|
@@ -42,6 +42,15 @@ module PactBroker
|
|
|
42
42
|
request.base_uri.to_s.chomp('/')
|
|
43
43
|
end
|
|
44
44
|
|
|
45
|
+
def charsets_provided
|
|
46
|
+
[['utf-8', :encode]]
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
# We only use utf-8 so leave encoding as it is
|
|
50
|
+
def encode(body)
|
|
51
|
+
body
|
|
52
|
+
end
|
|
53
|
+
|
|
45
54
|
def resource_url
|
|
46
55
|
request.uri.to_s
|
|
47
56
|
end
|
|
@@ -59,12 +68,12 @@ module PactBroker
|
|
|
59
68
|
end
|
|
60
69
|
|
|
61
70
|
def set_json_error_message message
|
|
62
|
-
response.headers['Content-Type'] = 'application/json'
|
|
71
|
+
response.headers['Content-Type'] = 'application/json;charset=utf-8'
|
|
63
72
|
response.body = {error: message}.to_json
|
|
64
73
|
end
|
|
65
74
|
|
|
66
75
|
def set_json_validation_error_messages errors
|
|
67
|
-
response.headers['Content-Type'] = 'application/json'
|
|
76
|
+
response.headers['Content-Type'] = 'application/json;charset=utf-8'
|
|
68
77
|
response.body = {errors: errors}.to_json
|
|
69
78
|
end
|
|
70
79
|
|
|
@@ -87,7 +96,7 @@ module PactBroker
|
|
|
87
96
|
rescue StandardError => e
|
|
88
97
|
logger.error "Error parsing JSON #{e} - #{request_body}"
|
|
89
98
|
set_json_error_message "Error parsing JSON - #{e.message}"
|
|
90
|
-
response.headers['Content-Type'] = 'application/json'
|
|
99
|
+
response.headers['Content-Type'] = 'application/json;charset=utf-8'
|
|
91
100
|
true
|
|
92
101
|
end
|
|
93
102
|
end
|
|
@@ -111,4 +120,4 @@ module PactBroker
|
|
|
111
120
|
end
|
|
112
121
|
end
|
|
113
122
|
end
|
|
114
|
-
end
|
|
123
|
+
end
|
|
@@ -36,7 +36,7 @@ module PactBroker
|
|
|
36
36
|
|
|
37
37
|
def validation_errors? webhook
|
|
38
38
|
if (errors = webhook_service.errors(webhook)).any?
|
|
39
|
-
response.headers['Content-Type'] = 'application/json'
|
|
39
|
+
response.headers['Content-Type'] = 'application/json;charset=utf-8'
|
|
40
40
|
response.body = {errors: errors.full_messages }.to_json
|
|
41
41
|
end
|
|
42
42
|
errors.any?
|
|
@@ -90,4 +90,4 @@ module PactBroker
|
|
|
90
90
|
end
|
|
91
91
|
end
|
|
92
92
|
end
|
|
93
|
-
end
|
|
93
|
+
end
|
|
@@ -13,7 +13,7 @@ module PactBroker
|
|
|
13
13
|
|
|
14
14
|
def process_post
|
|
15
15
|
webhook_execution_result = webhook_service.execute_webhook_now webhook
|
|
16
|
-
response.headers['Content-Type'] = 'application/hal+json'
|
|
16
|
+
response.headers['Content-Type'] = 'application/hal+json;charset=utf-8'
|
|
17
17
|
response.body = post_response_body webhook_execution_result
|
|
18
18
|
webhook_execution_result.success? ? true : 500
|
|
19
19
|
end
|
data/lib/pact_broker/version.rb
CHANGED
|
@@ -24,7 +24,7 @@ describe "Creating a webhook" do
|
|
|
24
24
|
|
|
25
25
|
it "returns a JSON content type" do
|
|
26
26
|
subject
|
|
27
|
-
expect(last_response.headers['Content-Type']).to eq 'application/json'
|
|
27
|
+
expect(last_response.headers['Content-Type']).to eq 'application/json;charset=utf-8'
|
|
28
28
|
end
|
|
29
29
|
|
|
30
30
|
it "returns the validation errors" do
|
|
@@ -65,7 +65,7 @@ describe "Creating a webhook" do
|
|
|
65
65
|
|
|
66
66
|
it "returns a JSON Content Type" do
|
|
67
67
|
subject
|
|
68
|
-
expect(last_response.headers['Content-Type']).to eq 'application/hal+json'
|
|
68
|
+
expect(last_response.headers['Content-Type']).to eq 'application/hal+json;charset=utf-8'
|
|
69
69
|
end
|
|
70
70
|
|
|
71
71
|
it "returns the newly created webhook" do
|
|
@@ -12,7 +12,7 @@ describe "Publishing a pact" do
|
|
|
12
12
|
end
|
|
13
13
|
|
|
14
14
|
it "returns a json body" do
|
|
15
|
-
expect(subject.headers['Content-Type']).to eq "application/json"
|
|
15
|
+
expect(subject.headers['Content-Type']).to eq "application/json;charset=utf-8"
|
|
16
16
|
end
|
|
17
17
|
|
|
18
18
|
it "returns the pact in the body" do
|
|
@@ -31,7 +31,7 @@ describe "Publishing a pact" do
|
|
|
31
31
|
end
|
|
32
32
|
|
|
33
33
|
it "returns an application/json Content-Type" do
|
|
34
|
-
expect(subject.headers['Content-Type']).to eq "application/json"
|
|
34
|
+
expect(subject.headers['Content-Type']).to eq "application/json;charset=utf-8"
|
|
35
35
|
end
|
|
36
36
|
|
|
37
37
|
it "returns the pact in the response body" do
|
|
@@ -15,7 +15,7 @@ module PactBroker
|
|
|
15
15
|
let(:enable_diagnostic_endpoints) { false }
|
|
16
16
|
|
|
17
17
|
let(:app) do
|
|
18
|
-
|
|
18
|
+
PactBroker::App.new do | config |
|
|
19
19
|
config.auto_migrate_db = false
|
|
20
20
|
config.use_hal_browser = hal_browser_enabled
|
|
21
21
|
config.database_connection = ::DB::PACT_BROKER_DB
|
|
@@ -126,7 +126,7 @@ module PactBroker
|
|
|
126
126
|
|
|
127
127
|
it "returns the CSV Content-Type" do
|
|
128
128
|
expect(subject.status).to eq 200
|
|
129
|
-
expect(subject.headers['Content-Type']).to eq "text/csv"
|
|
129
|
+
expect(subject.headers['Content-Type']).to eq "text/csv;charset=utf-8"
|
|
130
130
|
end
|
|
131
131
|
end
|
|
132
132
|
|
|
@@ -52,7 +52,7 @@ module PactBroker::Api
|
|
|
52
52
|
|
|
53
53
|
it "returns a CSV content type" do
|
|
54
54
|
subject
|
|
55
|
-
expect(last_response.headers['Content-Type']).to eq 'text/csv'
|
|
55
|
+
expect(last_response.headers['Content-Type']).to eq 'text/csv;charset=utf-8'
|
|
56
56
|
end
|
|
57
57
|
|
|
58
58
|
it "returns a CSV of pacticipants that are in the same group as the given pacticipant" do
|
|
@@ -28,7 +28,7 @@ module PactBroker::Api
|
|
|
28
28
|
end
|
|
29
29
|
|
|
30
30
|
it "returns a JSON content type" do
|
|
31
|
-
expect(response.headers['Content-Type']).to eq "application/json"
|
|
31
|
+
expect(response.headers['Content-Type']).to eq "application/json;charset=utf-8"
|
|
32
32
|
end
|
|
33
33
|
|
|
34
34
|
it "returns an error message" do
|
|
@@ -90,7 +90,7 @@ module PactBroker::Api
|
|
|
90
90
|
|
|
91
91
|
it "returns a JSON content type" do
|
|
92
92
|
subject
|
|
93
|
-
expect(last_response.headers['Content-Type']).to eq 'application/json'
|
|
93
|
+
expect(last_response.headers['Content-Type']).to eq 'application/json;charset=utf-8'
|
|
94
94
|
end
|
|
95
95
|
|
|
96
96
|
it "returns an error message" do
|
|
@@ -108,7 +108,7 @@ module PactBroker::Api
|
|
|
108
108
|
|
|
109
109
|
it "returns a JSON content type" do
|
|
110
110
|
subject
|
|
111
|
-
expect(last_response.headers['Content-Type']).to eq 'application/json'
|
|
111
|
+
expect(last_response.headers['Content-Type']).to eq 'application/json;charset=utf-8'
|
|
112
112
|
end
|
|
113
113
|
|
|
114
114
|
it "returns an error message" do
|
|
@@ -129,7 +129,7 @@ module PactBroker::Api
|
|
|
129
129
|
|
|
130
130
|
it "returns a JSON content type" do
|
|
131
131
|
subject
|
|
132
|
-
expect(last_response.headers['Content-Type']).to eq 'application/json'
|
|
132
|
+
expect(last_response.headers['Content-Type']).to eq 'application/json;charset=utf-8'
|
|
133
133
|
end
|
|
134
134
|
|
|
135
135
|
it "returns the validation errors" do
|
|
@@ -165,7 +165,7 @@ module PactBroker::Api
|
|
|
165
165
|
|
|
166
166
|
it "returns a JSON content type" do
|
|
167
167
|
subject
|
|
168
|
-
expect(last_response.headers['Content-Type']).to eq 'application/hal+json'
|
|
168
|
+
expect(last_response.headers['Content-Type']).to eq 'application/hal+json;charset=utf-8'
|
|
169
169
|
end
|
|
170
170
|
|
|
171
171
|
it "generates the JSON response body" do
|
|
@@ -63,7 +63,7 @@ module PactBroker
|
|
|
63
63
|
|
|
64
64
|
it "returns a Content-Type of application/hal+json" do
|
|
65
65
|
subject
|
|
66
|
-
expect(last_response.headers['Content-Type']).to eq 'application/hal+json'
|
|
66
|
+
expect(last_response.headers['Content-Type']).to eq 'application/hal+json;charset=utf-8'
|
|
67
67
|
end
|
|
68
68
|
|
|
69
69
|
it "creates a JSON representation of the new pacticipant" do
|
|
@@ -88,4 +88,4 @@ module PactBroker
|
|
|
88
88
|
end
|
|
89
89
|
|
|
90
90
|
end
|
|
91
|
-
end
|
|
91
|
+
end
|
data/spec/spec_helper.rb
CHANGED
|
@@ -14,20 +14,20 @@ require 'rspec/expectations'
|
|
|
14
14
|
RSpec::Matchers.define :be_a_hal_json_success_response do
|
|
15
15
|
match do | actual |
|
|
16
16
|
expect(actual.status).to be 200
|
|
17
|
-
expect(actual.headers['Content-Type']).to eq 'application/hal+json'
|
|
17
|
+
expect(actual.headers['Content-Type']).to eq 'application/hal+json;charset=utf-8'
|
|
18
18
|
end
|
|
19
19
|
end
|
|
20
20
|
|
|
21
21
|
RSpec::Matchers.define :be_a_json_response do
|
|
22
22
|
match do | actual |
|
|
23
|
-
expect(actual.headers['Content-Type']).to eq 'application/json'
|
|
23
|
+
expect(actual.headers['Content-Type']).to eq 'application/json;charset=utf-8'
|
|
24
24
|
end
|
|
25
25
|
end
|
|
26
26
|
|
|
27
27
|
RSpec::Matchers.define :be_a_json_error_response do | message |
|
|
28
28
|
match do | actual |
|
|
29
29
|
expect(actual.status).to be 400
|
|
30
|
-
expect(actual.headers['Content-Type']).to eq 'application/json'
|
|
30
|
+
expect(actual.headers['Content-Type']).to eq 'application/json;charset=utf-8'
|
|
31
31
|
expect(actual.body).to include message
|
|
32
32
|
end
|
|
33
33
|
end
|
|
@@ -36,4 +36,4 @@ RSpec::Matchers.define :be_a_404_response do
|
|
|
36
36
|
match do | actual |
|
|
37
37
|
expect(actual.status).to be 404
|
|
38
38
|
end
|
|
39
|
-
end
|
|
39
|
+
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: 1.9.
|
|
4
|
+
version: 1.9.2
|
|
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: 2016-
|
|
13
|
+
date: 2016-04-29 00:00:00.000000000 Z
|
|
14
14
|
dependencies:
|
|
15
15
|
- !ruby/object:Gem::Dependency
|
|
16
16
|
name: httparty
|
|
@@ -358,6 +358,7 @@ files:
|
|
|
358
358
|
- Gemfile
|
|
359
359
|
- LICENSE.txt
|
|
360
360
|
- README.md
|
|
361
|
+
- RELEASING.md
|
|
361
362
|
- Rakefile
|
|
362
363
|
- bethtest.rb
|
|
363
364
|
- config.ru
|
|
@@ -715,7 +716,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
715
716
|
version: '0'
|
|
716
717
|
requirements: []
|
|
717
718
|
rubyforge_project:
|
|
718
|
-
rubygems_version: 2.
|
|
719
|
+
rubygems_version: 2.5.1
|
|
719
720
|
signing_key:
|
|
720
721
|
specification_version: 4
|
|
721
722
|
summary: See description
|