pact_broker 2.113.2 → 2.115.0
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/CHANGELOG.md +19 -0
- data/db/migrations/20240112_add_client_language_verified_by_to_verification.rb +7 -0
- data/lib/pact_broker/api/decorators/provider_states_decorator.rb +21 -4
- data/lib/pact_broker/api/decorators/verification_decorator.rb +3 -0
- data/lib/pact_broker/doc/views/pact/publish-verification-results.markdown +18 -0
- data/lib/pact_broker/domain/verification.rb +3 -0
- data/lib/pact_broker/labels/repository.rb +1 -1
- data/lib/pact_broker/pacts/provider_state_service.rb +1 -1
- data/lib/pact_broker/verifications/service.rb +3 -0
- data/lib/pact_broker/version.rb +1 -1
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5d60c3b6a432bf6499e5167d6c1b06a6799ef58fb3cf5464000ebe6712352653
|
4
|
+
data.tar.gz: e8b326e736249b6de4cf47baca16f0551e4a45de24d61a9839ba91b077577959
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b1973fc6c1f1b44ab6fa5ea7c7986cb588f7e69cd6bc3a25c5abca52675c5cfeb453c1ee2db261ebeb4d53ffdf5d6d7e4985010c7a89dc8a162521f13728af3e
|
7
|
+
data.tar.gz: 06c0d372bc3f97fa958d74e064033d89e3dd096a835290c44c59fa7b7331deeb2b50653b5b4be23f194db933250520696feba15b8e24bac5ef3669ca53f52289
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,22 @@
|
|
1
|
+
<a name="v2.115.0"></a>
|
2
|
+
### v2.115.0 (2025-03-17)
|
3
|
+
|
4
|
+
#### Features
|
5
|
+
|
6
|
+
* group provider states by consumers ([e39860a9](/../../commit/e39860a9))
|
7
|
+
|
8
|
+
#### Bug Fixes
|
9
|
+
|
10
|
+
* dedupe non unique provider states #789 ([3cf22169](/../../commit/3cf22169))
|
11
|
+
* explicitly order labels by name ([d25746c1](/../../commit/d25746c1))
|
12
|
+
|
13
|
+
<a name="v2.114.0"></a>
|
14
|
+
### v2.114.0 (2025-03-06)
|
15
|
+
|
16
|
+
#### Features
|
17
|
+
|
18
|
+
* support extended verification results (#778) ([18f571c8](/../../commit/18f571c8))
|
19
|
+
|
1
20
|
<a name="v2.113.2"></a>
|
2
21
|
### v2.113.2 (2025-03-05)
|
3
22
|
|
@@ -6,13 +6,30 @@ module PactBroker
|
|
6
6
|
class ProviderStateDecorator < BaseDecorator
|
7
7
|
camelize_property_names
|
8
8
|
|
9
|
-
property :name
|
10
|
-
property :params
|
11
|
-
|
9
|
+
property :name, getter: -> (context) { context[:represented][:name] }
|
10
|
+
property :params, getter: -> (context) { context[:represented][:params] }
|
11
|
+
property :consumers, getter: -> (context) { context[:represented][:consumers] }
|
12
12
|
end
|
13
13
|
|
14
14
|
class ProviderStatesDecorator < BaseDecorator
|
15
|
-
collection :providerStates, getter: -> (context) {
|
15
|
+
collection :providerStates, getter: -> (context) {
|
16
|
+
consumers_map = {}
|
17
|
+
|
18
|
+
context[:represented].each do |item|
|
19
|
+
item["providerStates"].each do |provider_state|
|
20
|
+
provider_state = provider_state.to_h
|
21
|
+
provider_state[:consumers] ||= []
|
22
|
+
provider_state[:consumers] << item["consumer"]
|
23
|
+
consumers_map[[provider_state[:name], provider_state[:params]]] ||= []
|
24
|
+
consumers_map[[provider_state[:name], provider_state[:params]]] += provider_state[:consumers]
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
consumers_map.map do |(name, params), consumers|
|
29
|
+
{ name: name, params: params, consumers: consumers.uniq }.transform_keys(&:to_sym)
|
30
|
+
end
|
31
|
+
.sort_by { |provider_state| provider_state[:name] }
|
32
|
+
}, :extend => PactBroker::Api::Decorators::ProviderStateDecorator
|
16
33
|
end
|
17
34
|
end
|
18
35
|
end
|
@@ -18,6 +18,9 @@ module PactBroker
|
|
18
18
|
nested :verifiedBy do
|
19
19
|
property :verified_by_implementation, as: :implementation
|
20
20
|
property :verified_by_version, as: :version
|
21
|
+
property :verified_by_client_implementation, as: :client_implementation
|
22
|
+
property :verified_by_client_test_framework, as: :client_test_framework
|
23
|
+
property :verified_by_client_version, as: :client_version
|
21
24
|
end
|
22
25
|
|
23
26
|
link :self do | options |
|
@@ -11,3 +11,21 @@ Use a `POST` request to the `pb:publish-verification-results` link (`$['_links']
|
|
11
11
|
}
|
12
12
|
|
13
13
|
Multiple verification results may be published for the same pact resource. The most recently published one will be considered to reflect the current status of verification.
|
14
|
+
|
15
|
+
Optionally the body can contain details about the Pact implementation which performed the verification, and test results, which support arbitrary json
|
16
|
+
|
17
|
+
{
|
18
|
+
"providerApplicationVersion": "1",
|
19
|
+
"success": true,
|
20
|
+
"buildUrl": "http://build-url",
|
21
|
+
"testResults": [],
|
22
|
+
"verifiedBy": {
|
23
|
+
"implementation": "Pact-Rust",
|
24
|
+
"version": "1.0.0",
|
25
|
+
"clientLanguage": {
|
26
|
+
"testFramework": "TEST",
|
27
|
+
"name": "TESTER",
|
28
|
+
"version": "1.2.3"
|
29
|
+
}
|
30
|
+
}
|
31
|
+
}
|
@@ -259,6 +259,9 @@ end
|
|
259
259
|
# pact_pending | boolean |
|
260
260
|
# verified_by_implementation | text |
|
261
261
|
# verified_by_version | text |
|
262
|
+
# verified_by_client_implementation| text |
|
263
|
+
# verified_by_client_version | text |
|
264
|
+
# verified_by_client_test_framework| text |
|
262
265
|
# Indexes:
|
263
266
|
# verifications_pkey | PRIMARY KEY btree (id)
|
264
267
|
# verifications_pact_version_id_number_index | UNIQUE btree (pact_version_id, number)
|
@@ -5,7 +5,7 @@ module PactBroker
|
|
5
5
|
class Repository
|
6
6
|
|
7
7
|
def get_all_unique_labels pagination_options = {}
|
8
|
-
PactBroker::Domain::Label.distinct.select(:name).all_with_pagination_options(pagination_options)
|
8
|
+
PactBroker::Domain::Label.distinct.select(:name).order(:name).all_with_pagination_options(pagination_options)
|
9
9
|
end
|
10
10
|
|
11
11
|
def create args
|
@@ -14,7 +14,7 @@ module PactBroker
|
|
14
14
|
def self.list_provider_states(provider)
|
15
15
|
query = scope_for(PactPublication).eager_for_domain_with_content.for_provider_and_consumer_version_selector(provider, PactBroker::Pacts::Selector.latest_for_main_branch)
|
16
16
|
query.all.flat_map do | pact_publication |
|
17
|
-
pact_publication.to_domain.content_object.provider_states
|
17
|
+
{ "providerStates" => pact_publication.to_domain.content_object.provider_states, "consumer" => pact_publication.to_domain.consumer.name }
|
18
18
|
end
|
19
19
|
end
|
20
20
|
end
|
@@ -46,6 +46,9 @@ module PactBroker
|
|
46
46
|
verification.number = next_verification_number
|
47
47
|
verification.verified_by_implementation = params.dig("verifiedBy", "implementation")
|
48
48
|
verification.verified_by_version = params.dig("verifiedBy", "version")
|
49
|
+
verification.verified_by_client_implementation = params.dig("verifiedBy", "clientLanguage", "name")
|
50
|
+
verification.verified_by_client_version = params.dig("verifiedBy", "clientLanguage", "version")
|
51
|
+
verification.verified_by_client_test_framework = params.dig("verifiedBy", "clientLanguage", "testFramework")
|
49
52
|
verification.consumer_version_selector_hashes = event_context[:consumer_version_selectors]
|
50
53
|
pact_version = pact_repository.find_pact_version(first_verified_pact.consumer, first_verified_pact.provider, first_verified_pact.pact_version_sha)
|
51
54
|
verification = verification_repository.create(verification, provider_version_number, pact_version)
|
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.
|
4
|
+
version: 2.115.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Bethany Skurrie
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
- Warner Godfrey
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: json
|
@@ -528,6 +528,7 @@ files:
|
|
528
528
|
- db/migrations/20230616_set_integrations_contract_data_updated_at.rb
|
529
529
|
- db/migrations/20231002_add_version_id_index_to_released_version.rb
|
530
530
|
- db/migrations/20231003_add_version_id_index_to_deployed_version.rb
|
531
|
+
- db/migrations/20240112_add_client_language_verified_by_to_verification.rb
|
531
532
|
- db/migrations/migration_helper.rb
|
532
533
|
- docs/CONFIGURATION.md
|
533
534
|
- docs/api/PACTICIPANTS.md
|
@@ -1226,7 +1227,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
1226
1227
|
- !ruby/object:Gem::Version
|
1227
1228
|
version: '0'
|
1228
1229
|
requirements: []
|
1229
|
-
rubygems_version: 3.6.
|
1230
|
+
rubygems_version: 3.6.7
|
1230
1231
|
specification_version: 4
|
1231
1232
|
summary: See description
|
1232
1233
|
test_files: []
|