pact_broker 2.109.0 → 2.109.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 +8 -0
- data/README.md +1 -2
- data/lib/pact_broker/locale/en.yml +1 -1
- data/lib/pact_broker/matrix/matrix_row.rb +0 -1
- data/lib/pact_broker/matrix/resolved_selector.rb +0 -1
- data/lib/pact_broker/pacts/pact_publication_dataset_module.rb +1 -0
- data/lib/pact_broker/pacts/pact_publication_wip_dataset_module.rb +59 -79
- data/lib/pact_broker/pacts/pacts_for_verification_repository.rb +1 -0
- data/lib/pact_broker/version.rb +1 -1
- data/lib/pact_broker/versions/branch_service.rb +1 -0
- 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: a4c49978b4312049fd2e394ce46bcf90f64125ff50556f9bb01f9610e1310546
|
4
|
+
data.tar.gz: 43f24ab98f5ce7bd757a52a085d653668d83395b6889921e8dc0d4aac5982b73
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3211f2cc4b2e9fbae7dd8a07bd1c49dc9d672fa46f6f4c83b6652b2266dc9498d4858a9a7714f91b09914d872e522affc5e96753cf3317e39228fecc620404c1
|
7
|
+
data.tar.gz: 36a5bc3f3ecc827cd6e24fa21b4d4bc9f943ec75bfdb3db8cdcdd1399533739bf0a2c15c68df816ae995fa58987fa43d4da45dcb72a2d68fff12f7594a69906a
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,11 @@
|
|
1
|
+
<a name="v2.109.1"></a>
|
2
|
+
### v2.109.1 (2024-02-21)
|
3
|
+
|
4
|
+
#### Bug Fixes
|
5
|
+
|
6
|
+
* improve performance for 'pacts for verification' queries ([299a6abe](/../../commit/299a6abe))
|
7
|
+
* correct spelling in message when pact is modified ([ae62ae7a](/../../commit/ae62ae7a))
|
8
|
+
|
1
9
|
<a name="v2.109.0"></a>
|
2
10
|
### v2.109.0 (2024-02-01)
|
3
11
|
|
data/README.md
CHANGED
@@ -2,7 +2,6 @@
|
|
2
2
|
[![Gem Version](https://badge.fury.io/rb/pact_broker.svg)](http://badge.fury.io/rb/pact_broker)
|
3
3
|
![Build status](https://github.com/pact-foundation/pact_broker/workflows/Test/badge.svg)
|
4
4
|
[![Join the chat at https://pact-foundation.slack.com/](https://img.shields.io/badge/chat-on%20slack-blue.svg?logo=slack)](https://slack.pact.io)
|
5
|
-
[![security](https://hakiri.io/github/pact-foundation/pact_broker/master.svg)](https://hakiri.io/github/pact-foundation/pact_broker/master)
|
6
5
|
|
7
6
|
The Pact Broker is an application for sharing of consumer driven contracts and verification results. It is optimised for use with "pacts" (contracts created by the [Pact][pact-docs] framework), but can be used for any type of contract that can be serialized to JSON.
|
8
7
|
|
@@ -151,7 +150,7 @@ You can use the [Pact Broker Docker image][docker] or [Terraform on AWS][terrafo
|
|
151
150
|
|
152
151
|
* Are you sure you don't just want to use the [Pact Broker Docker image][docker]? No Docker at your company yet? Ah well, keep reading.
|
153
152
|
* Create a PostgreSQL database.
|
154
|
-
* To ensure you're on a supported version of the database that you choose, check the [
|
153
|
+
* To ensure you're on a supported version of the database that you choose, check the [.github/workflows/test.yml](.github/workflows/test.yml) file to see which versions we're currently running our tests against.
|
155
154
|
* MySQL was supported for the native Ruby application until around 2021, but the official `pactfoundation/pact-broker` Docker image does not support it. New features will not be optimised for MySQL, and some new features may not even be supported on it (eg. the database clean feature).
|
156
155
|
* You'll find a sample database creation script in the [example/config.ru](https://github.com/pact-foundation/pact_broker/blob/master/example/config.ru).
|
157
156
|
* Install ruby 2.7 and the latest version of bundler (if you've come this far, I'm assuming you know how to do both of these. Did I mention there was a [Docker][docker] image?)
|
@@ -50,7 +50,7 @@ en:
|
|
50
50
|
contract:
|
51
51
|
pact_published: Pact successfully published for %{consumer_name} version %{consumer_version_number} and provider %{provider_name}.
|
52
52
|
same_pact_content_published: Pact successfully republished for %{consumer_name} version %{consumer_version_number} and provider %{provider_name} with no content changes.
|
53
|
-
pact_modified_for_same_version: Pact with changed content published over existing content for %{consumer_name} version %{consumer_version_number} and provider %{provider_name}. This is not recommended in normal
|
53
|
+
pact_modified_for_same_version: Pact with changed content published over existing content for %{consumer_name} version %{consumer_version_number} and provider %{provider_name}. This is not recommended in normal circumstances and may indicate that you have not configured your Pact pipeline correctly. For more information see https://docs.pact.io/go/versioning
|
54
54
|
pact_merged: Pact content merged with existing content for %{consumer_name} version %{consumer_version_number} and provider %{provider_name}.
|
55
55
|
events:
|
56
56
|
pact_published_unchanged_with_single_tag: pact content is the same as previous version with tag %{tag_name} and no new tags were applied
|
@@ -1,35 +1,76 @@
|
|
1
1
|
module PactBroker
|
2
2
|
module Pacts
|
3
3
|
module PactPublicationWipDatasetModule
|
4
|
+
|
5
|
+
# Use a cut down model of the verifications table just for the WIP calculations.
|
6
|
+
# Don't need all the associations and normal domain methods.
|
7
|
+
class VerificationForWipCalculations < Sequel::Model(:verifications)
|
8
|
+
dataset_module do
|
9
|
+
def successful_non_wip_by_provider(provider_id)
|
10
|
+
distinct.where(success: true, wip: false, provider_id: provider_id)
|
11
|
+
end
|
12
|
+
|
13
|
+
def verified_before_creation_date_of(record)
|
14
|
+
if record
|
15
|
+
verified_before_date(record.created_at)
|
16
|
+
else
|
17
|
+
self
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
def join_branch_versions_excluding_branch(provider_id, branch_name)
|
22
|
+
branch_versions_join = {
|
23
|
+
Sequel[:verifications][:provider_version_id] => Sequel[:branch_versions][:version_id],
|
24
|
+
Sequel[:branch_versions][:pacticipant_id] => provider_id
|
25
|
+
}
|
26
|
+
join(:branch_versions, branch_versions_join) do
|
27
|
+
Sequel.lit("branch_versions.branch_name != ?", branch_name)
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
def join_provider_versions_for_provider_id_and_branch(provider_id, provider_version_branch)
|
32
|
+
branch_versions_join = {
|
33
|
+
Sequel[:verifications][:provider_version_id] => Sequel[:branch_versions][:version_id],
|
34
|
+
Sequel[:branch_versions][:pacticipant_id] => provider_id,
|
35
|
+
Sequel[:branch_versions][:branch_name] => provider_version_branch
|
36
|
+
}
|
37
|
+
|
38
|
+
join(:branch_versions, branch_versions_join)
|
39
|
+
end
|
40
|
+
|
41
|
+
def verified_before_date(date)
|
42
|
+
where { Sequel[:verifications][:execution_date] < date }
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
4
47
|
def successfully_verified_by_provider_branch_when_not_wip(provider_id, provider_version_branch)
|
48
|
+
successful_verifications = VerificationForWipCalculations
|
49
|
+
.select(:pact_version_id)
|
50
|
+
.distinct
|
51
|
+
.successful_non_wip_by_provider(provider_id)
|
52
|
+
.join_provider_versions_for_provider_id_and_branch(provider_id, provider_version_branch)
|
53
|
+
|
54
|
+
|
5
55
|
from_self(alias: :pp)
|
6
56
|
.select(Sequel[:pp].*)
|
7
|
-
.where(Sequel[:pp][:provider_id] => provider_id)
|
8
|
-
.join_successful_non_wip_verifications_for_provider_id(provider_id)
|
9
|
-
.join_provider_versions_for_provider_id_and_branch(provider_id, provider_version_branch)
|
10
57
|
.distinct
|
58
|
+
.join(successful_verifications, { Sequel[:pp][:pact_version_id] => Sequel[:v][:pact_version_id] }, { table_alias: :v })
|
11
59
|
end
|
12
60
|
|
13
61
|
def successfully_verified_by_provider_another_branch_before_this_branch_first_created(provider_id, provider_version_branch)
|
14
62
|
first_version_for_branch = PactBroker::Domain::Version.first_for_pacticipant_id_and_branch(provider_id, provider_version_branch)
|
15
63
|
|
64
|
+
successful_verifications = VerificationForWipCalculations
|
65
|
+
.select(:pact_version_id)
|
66
|
+
.distinct
|
67
|
+
.successful_non_wip_by_provider(provider_id)
|
68
|
+
.join_branch_versions_excluding_branch(provider_id, provider_version_branch)
|
69
|
+
.verified_before_creation_date_of(first_version_for_branch)
|
70
|
+
|
16
71
|
from_self(alias: :pp)
|
17
72
|
.select(Sequel[:pp].*)
|
18
|
-
.
|
19
|
-
.join_provider_versions_for_provider_id(provider_id)
|
20
|
-
.join_branch_versions_excluding_branch(provider_version_branch)
|
21
|
-
.where(Sequel[:pp][:provider_id] => provider_id)
|
22
|
-
.verified_before_creation_date_of(first_version_for_branch)
|
23
|
-
.distinct
|
24
|
-
end
|
25
|
-
|
26
|
-
def join_branch_versions_excluding_branch(branch_name)
|
27
|
-
branch_versions_join = {
|
28
|
-
Sequel[:provider_versions][:id] => Sequel[:branch_versions][:version_id]
|
29
|
-
}
|
30
|
-
join(:branch_versions, branch_versions_join) do
|
31
|
-
Sequel.lit("branch_versions.branch_name != ?", branch_name)
|
32
|
-
end
|
73
|
+
.join(successful_verifications, { Sequel[:pp][:pact_version_id] => Sequel[:v][:pact_version_id] }, { table_alias: :v })
|
33
74
|
end
|
34
75
|
|
35
76
|
def successfully_verified_by_provider_tag_when_not_wip(provider_tag)
|
@@ -43,7 +84,6 @@ module PactBroker
|
|
43
84
|
.select(Sequel[:pp].*)
|
44
85
|
.join(:pact_version_provider_tag_successful_verifications, pact_version_provider_tag_verifications_join, { table_alias: :sv })
|
45
86
|
.distinct
|
46
|
-
|
47
87
|
end
|
48
88
|
|
49
89
|
def successfully_verified_by_provider_another_tag_before_this_tag_first_created(provider_id, provider_tag)
|
@@ -71,66 +111,6 @@ module PactBroker
|
|
71
111
|
end
|
72
112
|
.distinct
|
73
113
|
end
|
74
|
-
|
75
|
-
protected
|
76
|
-
|
77
|
-
def verified_before_date(date)
|
78
|
-
where { Sequel[:verifications][:execution_date] < date }
|
79
|
-
end
|
80
|
-
|
81
|
-
def join_successful_non_wip_verifications_for_provider_id(provider_id, &block)
|
82
|
-
verifications_join = {
|
83
|
-
pact_version_id: :pact_version_id,
|
84
|
-
Sequel[:verifications][:success] => true,
|
85
|
-
Sequel[:verifications][:wip] => false,
|
86
|
-
Sequel[:verifications][:provider_id] => provider_id
|
87
|
-
}
|
88
|
-
join(:verifications, verifications_join, {}, &block)
|
89
|
-
end
|
90
|
-
|
91
|
-
def join_provider_version_tags &block
|
92
|
-
tags_join = {
|
93
|
-
Sequel[:verifications][:provider_version_id] => Sequel[:provider_tags][:version_id],
|
94
|
-
}
|
95
|
-
join(:tags, tags_join, { table_alias: :provider_tags }, &block)
|
96
|
-
end
|
97
|
-
|
98
|
-
def join_provider_version_tags_for_tag(tag)
|
99
|
-
tags_join = {
|
100
|
-
Sequel[:verifications][:provider_version_id] => Sequel[:provider_tags][:version_id],
|
101
|
-
Sequel[:provider_tags][:name] => tag
|
102
|
-
}
|
103
|
-
join(:tags, tags_join, { table_alias: :provider_tags } )
|
104
|
-
end
|
105
|
-
|
106
|
-
def join_provider_versions_for_provider_id_and_branch(provider_id, provider_version_branch)
|
107
|
-
versions_join = {
|
108
|
-
Sequel[:verifications][:provider_version_id] => Sequel[:provider_versions][:id],
|
109
|
-
Sequel[:provider_versions][:pacticipant_id] => provider_id
|
110
|
-
}
|
111
|
-
branch_versions_join = {
|
112
|
-
Sequel[:provider_versions][:id] => Sequel[:branch_versions][:version_id],
|
113
|
-
Sequel[:branch_versions][:branch_name] => provider_version_branch
|
114
|
-
}
|
115
|
-
join(:versions, versions_join, { table_alias: :provider_versions } )
|
116
|
-
.join(:branch_versions, branch_versions_join)
|
117
|
-
end
|
118
|
-
|
119
|
-
def join_provider_versions_for_provider_id(provider_id, &block)
|
120
|
-
versions_join = {
|
121
|
-
Sequel[:verifications][:provider_version_id] => Sequel[:provider_versions][:id],
|
122
|
-
Sequel[:provider_versions][:pacticipant_id] => provider_id
|
123
|
-
}
|
124
|
-
join(:versions, versions_join, { table_alias: :provider_versions }, &block)
|
125
|
-
end
|
126
|
-
|
127
|
-
def verified_before_creation_date_of(record)
|
128
|
-
if record
|
129
|
-
verified_before_date(record.created_at)
|
130
|
-
else
|
131
|
-
self
|
132
|
-
end
|
133
|
-
end
|
134
114
|
end
|
135
115
|
end
|
136
116
|
end
|
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.109.
|
4
|
+
version: 2.109.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: 2024-02-
|
13
|
+
date: 2024-02-21 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: json
|
@@ -1260,7 +1260,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
1260
1260
|
- !ruby/object:Gem::Version
|
1261
1261
|
version: '0'
|
1262
1262
|
requirements: []
|
1263
|
-
rubygems_version: 3.5.
|
1263
|
+
rubygems_version: 3.5.6
|
1264
1264
|
signing_key:
|
1265
1265
|
specification_version: 4
|
1266
1266
|
summary: See description
|