pact 1.67.4 → 1.67.5

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c9e528c0743a71175c5ce55b23a8fb1b6e174b03907870ebc57baf4cbe90e748
4
- data.tar.gz: 4a6da15a30218968f96c757faedf43d15af3f934f07a181c5c9f799dd66a8cb9
3
+ metadata.gz: 8be91a33981b95189c08f545d3746c76f2f2ad8642777f753cc3b414233986de
4
+ data.tar.gz: 1bc7d8a6e8a08c47b79e73f68e0caed9585a0eafb0bc316a4e589f2b3f9028a3
5
5
  SHA512:
6
- metadata.gz: 701150d00e3c0588733f6678e68668ad6d459feb89089e30bdfb4b0d4cc8d6a3eed64f94c192786fa69aba706f1a3696498c1202b073a59a1df73ac3b82f7d5c
7
- data.tar.gz: 227a26b4773be94b54d07bb51e2a6e5bac5b4a4401c816497b4a5b0b51ab3ae49cbea79ace2db4b81385161de1c81724740600aadda79c45f789147efbec4275
6
+ metadata.gz: a73f8cf2aa2956f7e0c7ed2dc8ab35fefbf1b7a2b0ab88d21bb3936a4761ae60d2fd622c4f2a767f2b6e75837556aeb055011667def9a90b8fbe1f9df74bf0f9
7
+ data.tar.gz: e27d62a8822b43ded6ccd48b926c2833292617834c7c2b8dda45d93a26a769d1093909d87921f8c15962445d3ef2012b1df2d5417ed7a07259a4275862c9f4b9
data/CHANGELOG.md CHANGED
@@ -1,3 +1,10 @@
1
+ <a name="v1.67.5"></a>
2
+ ### v1.67.5 (2026-02-13)
3
+
4
+ #### Bug Fixes
5
+
6
+ * retry HTTP requests on 5xx status codes (502, 503, 504) ([2174a31](/../../commit/2174a31))
7
+
1
8
  <a name="v1.67.4"></a>
2
9
  ### v1.67.4 (2026-02-09)
3
10
 
@@ -6,6 +6,18 @@ require 'openssl'
6
6
 
7
7
  module Pact
8
8
  module Hal
9
+ class RetriableHttpStatusError < StandardError
10
+ RETRIABLE_STATUS_CODES = [502, 503, 504].freeze
11
+
12
+ attr_reader :status_code, :response_body
13
+
14
+ def initialize status_code, response_body
15
+ @status_code = status_code
16
+ @response_body = response_body
17
+ super("HTTP #{status_code} error: #{response_body}")
18
+ end
19
+ end
20
+
9
21
  class HttpClient
10
22
  attr_accessor :username, :password, :verbose, :token
11
23
 
@@ -65,9 +77,15 @@ module Pact
65
77
  end
66
78
  http.verify_mode = OpenSSL::SSL::VERIFY_NONE
67
79
  end
68
- http.start do |http|
80
+ result = http.start do |http|
69
81
  http.request request
70
82
  end
83
+
84
+ # Raise error on specific 5xx status codes to trigger retry
85
+ status_code = result.code.to_i
86
+ raise RetriableHttpStatusError.new(status_code, result.body) if RetriableHttpStatusError::RETRIABLE_STATUS_CODES.include?(status_code)
87
+
88
+ result
71
89
  end
72
90
  Response.new(response)
73
91
  end
data/lib/pact/version.rb CHANGED
@@ -1,4 +1,4 @@
1
1
  # Remember to bump pact-provider-proxy when this changes major version
2
2
  module Pact
3
- VERSION = "1.67.4"
3
+ VERSION = "1.67.5"
4
4
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pact
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.67.4
4
+ version: 1.67.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Fraser