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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d04543119f56e452c3c57968e73850a026d249e4db7a179b07d7fd9e08b1b39e
4
- data.tar.gz: e29701ac23814dc00deea077e9dc318e21dcad486b5e01f28e3b422e0394310c
3
+ metadata.gz: c39e09b6dd262ec6baa6da53747ac6adfcac1b83e87050973d10624d6d0dbc85
4
+ data.tar.gz: 817e36de371bb43762e42c8103735f291a1645a782541581cbff501a70b309da
5
5
  SHA512:
6
- metadata.gz: 79f0f70224a4991f745e25b04251831f6a57872247780a9c0a4de75f3c1e04116534f42501a0c5fec982305fe235887ab21b7d915651be9275f706fba334a097
7
- data.tar.gz: 007d7e79f2ffe068775cecb79324f811371bec604f18d657befebbe597391e70fda5bca489719dcd1fc395d673518b2dcc5a11537a94155562d353a8fc37fa11
6
+ metadata.gz: 68d61e0fef6e96bd4acce08bc781aee2895b209cecbb0e3f453fe8e7e3843f417e5f3f62604dfda8ed5bee803c382c49eb552d17cc5fe06101fcab9848e1e34e
7
+ data.tar.gz: bf36dbe78ff7fdd10af8983be7130928389175c8b6770ee1772f9a31ccac6920d6316890850d33d8c179a8e9ce3dd1467338810e2879dd71079c751bc2e117a4
@@ -0,0 +1,6 @@
1
+ version: 2
2
+ updates:
3
+ - package-ecosystem: "github-actions"
4
+ directory: "/"
5
+ schedule:
6
+ interval: "monthly"
@@ -31,7 +31,7 @@ jobs:
31
31
  - uses: actions/checkout@v3
32
32
  with:
33
33
  fetch-depth: 0
34
- - uses: pact-foundation/release-gem@v0.0.13
34
+ - uses: pact-foundation/release-gem@v0.0.14
35
35
  id: release
36
36
  env:
37
37
  GEM_HOST_API_KEY: '${{ secrets.RUBYGEMS_API_KEY }}'
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(matrix)
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(matrix)
59
- (matrix[:matrix] || []).collect do | row |
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(matrix)
71
- text = self.verification_results_urls_and_successes(matrix).each_with_index.collect do |(url, success), i|
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
@@ -1,5 +1,5 @@
1
1
  module PactBroker
2
2
  module Client
3
- VERSION = '1.69.0'
3
+ VERSION = '1.70.0'
4
4
  end
5
5
  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 | 4 | Bar | 5 | ??? |
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.69.0
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"