pact_broker-client 1.69.0 → 1.70.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/dependabot.yml +6 -0
- data/.github/workflows/release_gem.yml +1 -1
- data/CHANGELOG.md +8 -0
- data/lib/pact_broker/client/hal/http_client.rb +1 -0
- data/lib/pact_broker/client/matrix/text_formatter.rb +19 -6
- data/lib/pact_broker/client/version.rb +1 -1
- data/spec/lib/pact_broker/client/matrix/text_formatter_spec.rb +10 -1
- data/spec/support/matrix_with_results.txt +2 -2
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c39e09b6dd262ec6baa6da53747ac6adfcac1b83e87050973d10624d6d0dbc85
|
4
|
+
data.tar.gz: 817e36de371bb43762e42c8103735f291a1645a782541581cbff501a70b309da
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 68d61e0fef6e96bd4acce08bc781aee2895b209cecbb0e3f453fe8e7e3843f417e5f3f62604dfda8ed5bee803c382c49eb552d17cc5fe06101fcab9848e1e34e
|
7
|
+
data.tar.gz: bf36dbe78ff7fdd10af8983be7130928389175c8b6770ee1772f9a31ccac6920d6316890850d33d8c179a8e9ce3dd1467338810e2879dd71079c751bc2e117a4
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,11 @@
|
|
1
|
+
<a name="v1.70.0"></a>
|
2
|
+
### v1.70.0 (2023-08-29)
|
3
|
+
|
4
|
+
#### Features
|
5
|
+
|
6
|
+
* sort can-i-deploy table by consumer name, then provider name ([83412e7](/../../commit/83412e7))
|
7
|
+
* do not accept gzip responses when VERBOSE=true ([a72a529](/../../commit/a72a529))
|
8
|
+
|
1
9
|
<a name="v1.69.0"></a>
|
2
10
|
### v1.69.0 (2023-08-29)
|
3
11
|
|
@@ -50,6 +50,7 @@ module PactBroker
|
|
50
50
|
request['Content-Type'] ||= "application/json" if ['Post', 'Put'].include?(http_method)
|
51
51
|
request['Content-Type'] ||= "application/merge-patch+json" if ['Patch'].include?(http_method)
|
52
52
|
request['Accept'] = "application/hal+json"
|
53
|
+
request['Accept-Encoding'] = nil if verbose?
|
53
54
|
headers.each do | key, value |
|
54
55
|
request[key] = value
|
55
56
|
end
|
@@ -12,11 +12,11 @@ module PactBroker
|
|
12
12
|
Line = Struct.new(:consumer, :consumer_version, :provider, :provider_version, :success, :ref, :ignored)
|
13
13
|
|
14
14
|
def self.call(matrix)
|
15
|
-
matrix_rows = matrix[:matrix]
|
15
|
+
matrix_rows = sort_matrix_rows(matrix[:matrix] || [])
|
16
16
|
return "" if matrix_rows.size == 0
|
17
17
|
data = prepare_data(matrix_rows)
|
18
18
|
printer = TablePrint::Printer.new(data, tp_options(data))
|
19
|
-
printer.table_print + verification_result_urls_text(
|
19
|
+
printer.table_print + verification_result_urls_text(matrix_rows)
|
20
20
|
end
|
21
21
|
|
22
22
|
def self.prepare_data(matrix_rows)
|
@@ -55,8 +55,8 @@ module PactBroker
|
|
55
55
|
default
|
56
56
|
end
|
57
57
|
|
58
|
-
def self.verification_results_urls_and_successes(
|
59
|
-
|
58
|
+
def self.verification_results_urls_and_successes(matrix_rows)
|
59
|
+
matrix_rows.collect do | row |
|
60
60
|
url = row.dig(:verificationResult, :_links, :self, :href)
|
61
61
|
if url
|
62
62
|
success = row.dig(:verificationResult, :success)
|
@@ -67,8 +67,8 @@ module PactBroker
|
|
67
67
|
end.compact
|
68
68
|
end
|
69
69
|
|
70
|
-
def self.verification_result_urls_text(
|
71
|
-
text = self.verification_results_urls_and_successes(
|
70
|
+
def self.verification_result_urls_text(matrix_rows)
|
71
|
+
text = self.verification_results_urls_and_successes(matrix_rows).each_with_index.collect do |(url, success), i|
|
72
72
|
status = success ? 'success' : 'failure'
|
73
73
|
"#{i+1}. #{url} (#{status})"
|
74
74
|
end.join("\n")
|
@@ -83,6 +83,19 @@ module PactBroker
|
|
83
83
|
def self.max_width(data, column, title)
|
84
84
|
(data.collect{ |row| row.send(column) } + [title]).compact.collect(&:size).max
|
85
85
|
end
|
86
|
+
|
87
|
+
def self.sort_matrix_rows(matrix_rows)
|
88
|
+
matrix_rows&.sort { |row_1, row_2| sortable_attributes(row_1) <=> sortable_attributes(row_2) }
|
89
|
+
end
|
90
|
+
|
91
|
+
def self.sortable_attributes(matrix_row)
|
92
|
+
[
|
93
|
+
matrix_row.dig(:consumer, :name)&.downcase || "",
|
94
|
+
matrix_row.dig(:provider, :name)&.downcase || "",
|
95
|
+
matrix_row.dig(:consumer, :version, :number) || "",
|
96
|
+
matrix_row.dig(:provider, :version, :number) || ""
|
97
|
+
]
|
98
|
+
end
|
86
99
|
end
|
87
100
|
end
|
88
101
|
end
|
@@ -36,9 +36,18 @@ module PactBroker
|
|
36
36
|
line_1 = line_creator.call
|
37
37
|
line_2 = line_creator.call
|
38
38
|
line_3 = line_creator.call
|
39
|
+
|
40
|
+
# ensure the data is as expected
|
41
|
+
expect(line_1.dig(:consumer, :version, :number)).to_not be nil
|
42
|
+
expect(line_1.dig(:provider, :version, :number)).to_not be nil
|
43
|
+
|
44
|
+
line_1[:consumer][:version][:number] = "4"
|
45
|
+
line_2[:consumer][:version][:number] = "3"
|
46
|
+
line_3[:consumer][:version][:number] = "5"
|
47
|
+
|
39
48
|
line_2[:verificationResult] = nil
|
40
49
|
line_3[:verificationResult][:success] = false
|
41
|
-
[line_1, line_2, line_3]
|
50
|
+
[line_1, line_2, line_3].shuffle
|
42
51
|
end
|
43
52
|
|
44
53
|
let(:matrix) { PactBroker::Client::Matrix::Resource.new(matrix: matrix_lines) }
|
@@ -1,8 +1,8 @@
|
|
1
1
|
CONSUMER | C.VERSION | PROVIDER | P.VERSION | SUCCESS? | RESULT#
|
2
2
|
---------|-----------|----------|-----------|----------|--------
|
3
|
+
Foo | 3 | Bar | 5 | ??? |
|
3
4
|
Foo | 4 | Bar | 5 | true | 1
|
4
|
-
Foo |
|
5
|
-
Foo | 4 | Bar | 5 | false | 2
|
5
|
+
Foo | 5 | Bar | 5 | false | 2
|
6
6
|
|
7
7
|
VERIFICATION RESULTS
|
8
8
|
--------------------
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pact_broker-client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.70.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Beth Skurrie
|
@@ -214,6 +214,7 @@ executables:
|
|
214
214
|
extensions: []
|
215
215
|
extra_rdoc_files: []
|
216
216
|
files:
|
217
|
+
- ".github/dependabot.yml"
|
217
218
|
- ".github/workflows/release_gem.yml"
|
218
219
|
- ".github/workflows/smartbear-issue-label-added.yml"
|
219
220
|
- ".github/workflows/test.yml"
|