pact_broker 2.89.0 → 2.89.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +10 -0
- data/lib/pact_broker/api/resources/publish_contracts.rb +20 -3
- data/lib/pact_broker/db/clean/selector.rb +1 -1
- data/lib/pact_broker/doc/views/provider-pacts-for-verification.markdown +1 -1
- data/lib/pact_broker/pacts/service.rb +1 -1
- data/lib/pact_broker/tasks/clean_task.rb +2 -2
- data/lib/pact_broker/version.rb +1 -1
- data/lib/pact_broker/versions/branch_version.rb +2 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4932100e3772127c1bccbb90c5db0e943678d14577bf163e90e61a0cd32f8685
|
4
|
+
data.tar.gz: 9b136a90d19d213f7a28c10ad518dabf0a974be80e11f6d06e199584bef2ca28
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d6820acb97cc28b5a94e7ae939b0ee5c87e96e626956c721b19484407771735fa33f07ae61bf3d4e4cab3bb17176d348a804715a670e925ffb47d5ece07efccc
|
7
|
+
data.tar.gz: 947e0f04cd880ee4dec65eceaf1bd0d82c0975338bcf0ed1efe309f3716b70d3e666be7b36814ce0382fcf462a0cf38156b22611332ee56135622cdbf6c4ef0e
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,13 @@
|
|
1
|
+
<a name="v2.89.1"></a>
|
2
|
+
### v2.89.1 (2021-10-28)
|
3
|
+
|
4
|
+
#### Bug Fixes
|
5
|
+
|
6
|
+
* **clean**
|
7
|
+
* honour max_age when set in clean selector ([828420d4](/../../commit/828420d4))
|
8
|
+
|
9
|
+
* null safe navigation in case a branch head does not exist for a branch version ([4b259a81](/../../commit/4b259a81))
|
10
|
+
|
1
11
|
<a name="v2.89.0"></a>
|
2
12
|
### v2.89.0 (2021-10-15)
|
3
13
|
|
@@ -68,13 +68,17 @@ module PactBroker
|
|
68
68
|
end
|
69
69
|
|
70
70
|
def schema
|
71
|
-
|
71
|
+
api_contract_class(:publish_contracts_schema)
|
72
72
|
end
|
73
73
|
|
74
74
|
def decode_and_parse_content(contract)
|
75
|
-
contract["decodedContent"] =
|
75
|
+
contract["decodedContent"] = base64_decode(contract["content"])
|
76
76
|
if contract["decodedContent"]
|
77
|
-
contract["
|
77
|
+
if contract["contentType"]&.include?("json")
|
78
|
+
contract["decodedParsedContent"] = parse_json(contract["decodedContent"])
|
79
|
+
elsif contract["contentType"]&.include?("yml")
|
80
|
+
contract["decodedParsedContent"] = parse_yaml(contract["decodedContent"])
|
81
|
+
end
|
78
82
|
end
|
79
83
|
end
|
80
84
|
|
@@ -98,6 +102,19 @@ module PactBroker
|
|
98
102
|
def conflict_notices
|
99
103
|
@conflict_notices ||= contract_service.conflict_notices(parsed_contracts)
|
100
104
|
end
|
105
|
+
|
106
|
+
def base64_decode(content)
|
107
|
+
Base64.strict_decode64(content) rescue nil
|
108
|
+
end
|
109
|
+
|
110
|
+
# TODO put this somewhere shareable
|
111
|
+
def parse_yaml(content)
|
112
|
+
YAML.safe_load(content, [Time, Date, DateTime]) rescue nil
|
113
|
+
end
|
114
|
+
|
115
|
+
def parse_json(content)
|
116
|
+
PactBroker::Pacts::Parse.call(content) rescue nil
|
117
|
+
end
|
101
118
|
end
|
102
119
|
end
|
103
120
|
end
|
@@ -42,7 +42,7 @@ Example: This data structure represents the way a user might specify "I want to
|
|
42
42
|
|
43
43
|
`consumerVersionSelectors.environment`: the name of the environment containing the consumer versions for which to return the pacts. Used to further qualify `{ "deployed": true }` or `{ "released": true }`. Normally, this would not be needed, as it is recommended to verify the pacts for all currently deployed/currently supported released versions.
|
44
44
|
|
45
|
-
`consumerVersionSelectors.latest`: true. Used in conjuction with the
|
45
|
+
`consumerVersionSelectors.latest`: true. Used in conjuction with the tag property. If a tag is specified, and latest is true, then the latest pact for each of the consumers with that tag will be returned. If a tag is specified and the latest flag is not set to true, all the pacts with the specified tag will be returned. (This might seem a bit weird, but it's done this way to match the syntax used for the matrix query params. See https://docs.pact.io/selectors).
|
46
46
|
|
47
47
|
`consumerVersionSelectors.consumer`: allows a selector to only be applied to a certain consumer.
|
48
48
|
|
@@ -156,7 +156,7 @@ module PactBroker
|
|
156
156
|
|
157
157
|
# Overwriting an existing pact with the same consumer/provider/consumer version number
|
158
158
|
def create_pact_revision params, existing_pact
|
159
|
-
logger.info "Updating existing pact publication
|
159
|
+
logger.info "Updating existing pact publication", payload: params.reject{ |k, _v| k == :json_content }
|
160
160
|
logger.debug "Content #{params[:json_content]}"
|
161
161
|
pact_version_sha = generate_sha(params[:json_content])
|
162
162
|
json_content = add_interaction_ids(params[:json_content])
|
@@ -17,9 +17,9 @@ module PactBroker
|
|
17
17
|
end
|
18
18
|
|
19
19
|
def keep_version_selectors=(keep_version_selectors)
|
20
|
-
require "pact_broker/
|
20
|
+
require "pact_broker/db/clean/selector"
|
21
21
|
@keep_version_selectors = [*keep_version_selectors].collect do | hash |
|
22
|
-
PactBroker::
|
22
|
+
PactBroker::DB::Clean::Selector.from_hash(hash)
|
23
23
|
end
|
24
24
|
end
|
25
25
|
|
data/lib/pact_broker/version.rb
CHANGED
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.89.
|
4
|
+
version: 2.89.1
|
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: 2021-10-
|
13
|
+
date: 2021-10-27 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: httparty
|
@@ -1836,7 +1836,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
1836
1836
|
- !ruby/object:Gem::Version
|
1837
1837
|
version: '0'
|
1838
1838
|
requirements: []
|
1839
|
-
rubygems_version: 3.2.
|
1839
|
+
rubygems_version: 3.2.30
|
1840
1840
|
signing_key:
|
1841
1841
|
specification_version: 4
|
1842
1842
|
summary: See description
|