pact_broker-client 1.46.0 → 1.47.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/test.yml +15 -1
- data/CHANGELOG.md +8 -0
- data/doc/pacts/markdown/Pact Broker Client - Pact Broker.md +315 -0
- data/lib/pact_broker/client/cli/broker.rb +5 -56
- data/lib/pact_broker/client/cli/matrix_commands.rb +93 -0
- data/lib/pact_broker/client/deployments/record_support_ended.rb +1 -1
- data/lib/pact_broker/client/deployments/record_undeployment.rb +1 -1
- data/lib/pact_broker/client/verification_required.rb +32 -0
- data/lib/pact_broker/client/version.rb +1 -1
- data/script/record-deployment.sh +1 -1
- data/script/record-deployments-and-releases.sh +0 -2
- data/script/record-undeployment.sh +1 -1
- data/spec/lib/pact_broker/client/cli/broker_can_i_deploy_spec.rb +1 -1
- data/spec/lib/pact_broker/client/deployments/record_support_ended_spec.rb +1 -1
- data/spec/lib/pact_broker/client/deployments/record_undeployment_spec.rb +1 -1
- data/spec/pacts/pact_broker_client-pact_broker.json +317 -0
- data/spec/service_providers/record_deployment_spec.rb +1 -3
- data/spec/service_providers/record_release_spec.rb +1 -3
- data/spec/service_providers/record_undeployment_spec.rb +2 -4
- metadata +5 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e11ef51fde8e7435df8088fc6124dc9f13657169d24681de5b7288227bafb9d0
|
4
|
+
data.tar.gz: 49237a042f0d8bd8abdd2af393be5141a6f38a24315a10632120c2c9ea65e4ad
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 50437b1812663cbc7d31bbba98230ca8674a478a43b205e4293df7c8975d2553154a9a702b0af485b857ed621f0aa1c15f4dd1751dc3151447eca3d9d063cf19
|
7
|
+
data.tar.gz: f25ee6031ddeed56b680ea71ec7548bc483f2bda844b1d3f6a3c9e8f8f15a6accae0513052637f284157118c2c2dd2162131512efa6a39b69acbcfe49608a209
|
data/.github/workflows/test.yml
CHANGED
@@ -27,7 +27,7 @@ jobs:
|
|
27
27
|
strategy:
|
28
28
|
fail-fast: false
|
29
29
|
matrix:
|
30
|
-
feature: ["", "publish_contracts"
|
30
|
+
feature: ["", "publish_contracts"]
|
31
31
|
steps:
|
32
32
|
- uses: actions/checkout@v2
|
33
33
|
- uses: ruby/setup-ruby@v1
|
@@ -42,3 +42,17 @@ jobs:
|
|
42
42
|
PACT_BROKER_TOKEN: ${{ secrets.PACTFLOW_PACT_OSS_TOKEN }}
|
43
43
|
PACT_BROKER_FEATURES: ${{ matrix.feature }}
|
44
44
|
TEST_FEATURE: ${{ matrix.feature }}
|
45
|
+
can-i-deploy:
|
46
|
+
runs-on: "ubuntu-latest"
|
47
|
+
needs: pact
|
48
|
+
steps:
|
49
|
+
- run: |
|
50
|
+
docker run --rm \
|
51
|
+
-e PACT_BROKER_BASE_URL=https://pact-oss.pactflow.io \
|
52
|
+
-e PACT_BROKER_TOKEN \
|
53
|
+
pactfoundation/pact-cli:latest \
|
54
|
+
broker can-i-deploy \
|
55
|
+
--pacticipant "Pact Broker Client" --version ${GITHUB_SHA} \
|
56
|
+
--pacticipant "Pact Broker" --latest master
|
57
|
+
env:
|
58
|
+
PACT_BROKER_TOKEN: ${{ secrets.PACTFLOW_PACT_OSS_TOKEN }}
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,11 @@
|
|
1
|
+
<a name="v1.47.0"></a>
|
2
|
+
### v1.47.0 (2021-07-09)
|
3
|
+
|
4
|
+
#### Features
|
5
|
+
|
6
|
+
* enabled deployment, release and environment commands without a feature toggle ([bd64caa](/../../commit/bd64caa))
|
7
|
+
* update relations used for currently deploy/currently supported versions ([6f6ca2f](/../../commit/6f6ca2f))
|
8
|
+
|
1
9
|
<a name="v1.46.0"></a>
|
2
10
|
### v1.46.0 (2021-06-24)
|
3
11
|
|
@@ -2,6 +2,14 @@
|
|
2
2
|
|
3
3
|
#### Requests from Pact Broker Client to Pact Broker
|
4
4
|
|
5
|
+
* [A request for a pacticipant version](#a_request_for_a_pacticipant_version_given_version_5556b8149bf8bac76bc30f50a8a2dd4c22c85f30_of_pacticipant_Foo_exists_with_2_environments_that_aren't_test_available_for_deployment) given version 5556b8149bf8bac76bc30f50a8a2dd4c22c85f30 of pacticipant Foo exists with 2 environments that aren't test available for deployment
|
6
|
+
|
7
|
+
* [A request for a pacticipant version](#a_request_for_a_pacticipant_version_given_version_5556b8149bf8bac76bc30f50a8a2dd4c22c85f30_of_pacticipant_Foo_exists_with_a_test_environment_available_for_deployment) given version 5556b8149bf8bac76bc30f50a8a2dd4c22c85f30 of pacticipant Foo exists with a test environment available for deployment
|
8
|
+
|
9
|
+
* [A request for a pacticipant version](#a_request_for_a_pacticipant_version_given_version_5556b8149bf8bac76bc30f50a8a2dd4c22c85f30_of_pacticipant_Foo_exists_with_a_test_environment_available_for_release) given version 5556b8149bf8bac76bc30f50a8a2dd4c22c85f30 of pacticipant Foo exists with a test environment available for release
|
10
|
+
|
11
|
+
* [A request for an environment](#a_request_for_an_environment_given_an_environment_with_name_test_and_UUID_16926ef3-590f-4e3f-838e-719717aa88c9_exists) given an environment with name test and UUID 16926ef3-590f-4e3f-838e-719717aa88c9 exists
|
12
|
+
|
5
13
|
* [A request for the compatibility matrix for a pacticipant that does not exist](#a_request_for_the_compatibility_matrix_for_a_pacticipant_that_does_not_exist)
|
6
14
|
|
7
15
|
* [A request for the compatibility matrix for all versions of Foo and Bar](#a_request_for_the_compatibility_matrix_for_all_versions_of_Foo_and_Bar_given_the_pact_for_Foo_version_1.2.3_and_1.2.4_has_been_verified_by_Bar_version_4.5.6) given the pact for Foo version 1.2.3 and 1.2.4 has been verified by Bar version 4.5.6
|
@@ -20,6 +28,8 @@
|
|
20
28
|
|
21
29
|
* [A request for the compatibility matrix where only the version of Foo is specified](#a_request_for_the_compatibility_matrix_where_only_the_version_of_Foo_is_specified_given_the_pact_for_Foo_version_1.2.3_has_been_verified_by_Bar_version_4.5.6_and_version_5.6.7) given the pact for Foo version 1.2.3 has been verified by Bar version 4.5.6 and version 5.6.7
|
22
30
|
|
31
|
+
* [A request for the environments](#a_request_for_the_environments_given_an_environment_with_name_test_exists) given an environment with name test exists
|
32
|
+
|
23
33
|
* [A request for the index resource](#a_request_for_the_index_resource)
|
24
34
|
|
25
35
|
* [A request for the index resource](#a_request_for_the_index_resource_given_the_pacticipant_relations_are_present) given the pacticipant relations are present
|
@@ -28,6 +38,8 @@
|
|
28
38
|
|
29
39
|
* [A request for the index resource](#a_request_for_the_index_resource_given_the_pb:latest-version_relation_exists_in_the_index_resource) given the pb:latest-version relation exists in the index resource
|
30
40
|
|
41
|
+
* [A request for the index resource](#a_request_for_the_index_resource_given_the_pb:pacticipant-version_and_pb:environments_relations_exist_in_the_index_resource) given the pb:pacticipant-version and pb:environments relations exist in the index resource
|
42
|
+
|
31
43
|
* [A request for the index resource](#a_request_for_the_index_resource_given_the_pb:pacticipant-version_relation_exists_in_the_index_resource) given the pb:pacticipant-version relation exists in the index resource
|
32
44
|
|
33
45
|
* [A request for the index resource with the webhook relation](#a_request_for_the_index_resource_with_the_webhook_relation)
|
@@ -74,6 +86,10 @@
|
|
74
86
|
|
75
87
|
* [A request to list the latest pacts](#a_request_to_list_the_latest_pacts_given_a_pact_between_Condor_and_the_Pricing_Service_exists) given a pact between Condor and the Pricing Service exists
|
76
88
|
|
89
|
+
* [A request to list the versions deployed to an environment for a pacticipant name and target](#a_request_to_list_the_versions_deployed_to_an_environment_for_a_pacticipant_name_and_target_given_an_version_is_deployed_to_environment_with_UUID_16926ef3-590f-4e3f-838e-719717aa88c9_with_target_customer-1) given an version is deployed to environment with UUID 16926ef3-590f-4e3f-838e-719717aa88c9 with target customer-1
|
90
|
+
|
91
|
+
* [A request to mark a deployed version as not currently deploye](#a_request_to_mark_a_deployed_version_as_not_currently_deploye_given_a_currently_deployed_version_exists) given a currently deployed version exists
|
92
|
+
|
77
93
|
* [A request to publish a pact](#a_request_to_publish_a_pact_given_'Condor'_already_exist_in_the_pact-broker,_but_the_'Pricing_Service'_does_not) given 'Condor' already exist in the pact-broker, but the 'Pricing Service' does not
|
78
94
|
|
79
95
|
* [A request to publish a pact](#a_request_to_publish_a_pact_given_the_'Pricing_Service'_already_exists_in_the_pact-broker) given the 'Pricing Service' already exists in the pact-broker
|
@@ -84,6 +100,10 @@
|
|
84
100
|
|
85
101
|
* [A request to publish a pact with method put](#a_request_to_publish_a_pact_with_method_put_given_the_'Pricing_Service'_and_'Condor'_already_exist_in_the_pact-broker,_and_Condor_already_has_a_pact_published_for_version_1.3.0) given the 'Pricing Service' and 'Condor' already exist in the pact-broker, and Condor already has a pact published for version 1.3.0
|
86
102
|
|
103
|
+
* [A request to record a deployment](#a_request_to_record_a_deployment_given_version_5556b8149bf8bac76bc30f50a8a2dd4c22c85f30_of_pacticipant_Foo_exists_with_a_test_environment_available_for_deployment) given version 5556b8149bf8bac76bc30f50a8a2dd4c22c85f30 of pacticipant Foo exists with a test environment available for deployment
|
104
|
+
|
105
|
+
* [A request to record a release](#a_request_to_record_a_release_given_version_5556b8149bf8bac76bc30f50a8a2dd4c22c85f30_of_pacticipant_Foo_exists_with_a_test_environment_available_for_deployment) given version 5556b8149bf8bac76bc30f50a8a2dd4c22c85f30 of pacticipant Foo exists with a test environment available for deployment
|
106
|
+
|
87
107
|
* [A request to register the repository URL of a pacticipant](#a_request_to_register_the_repository_URL_of_a_pacticipant_given_the_'Pricing_Service'_already_exists_in_the_pact-broker) given the 'Pricing Service' already exists in the pact-broker
|
88
108
|
|
89
109
|
* [A request to register the repository URL of a pacticipant](#a_request_to_register_the_repository_URL_of_a_pacticipant_given_the_'Pricing_Service'_does_not_exist_in_the_pact-broker) given the 'Pricing Service' does not exist in the pact-broker
|
@@ -116,6 +136,127 @@
|
|
116
136
|
|
117
137
|
#### Interactions
|
118
138
|
|
139
|
+
<a name="a_request_for_a_pacticipant_version_given_version_5556b8149bf8bac76bc30f50a8a2dd4c22c85f30_of_pacticipant_Foo_exists_with_2_environments_that_aren't_test_available_for_deployment"></a>
|
140
|
+
Given **version 5556b8149bf8bac76bc30f50a8a2dd4c22c85f30 of pacticipant Foo exists with 2 environments that aren't test available for deployment**, upon receiving **a request for a pacticipant version** from Pact Broker Client, with
|
141
|
+
```json
|
142
|
+
{
|
143
|
+
"method": "GET",
|
144
|
+
"path": "/HAL-REL-PLACEHOLDER-PB-PACTICIPANT-VERSION-Foo-5556b8149bf8bac76bc30f50a8a2dd4c22c85f30",
|
145
|
+
"headers": {
|
146
|
+
"Accept": "application/hal+json"
|
147
|
+
}
|
148
|
+
}
|
149
|
+
```
|
150
|
+
Pact Broker will respond with:
|
151
|
+
```json
|
152
|
+
{
|
153
|
+
"status": 200,
|
154
|
+
"headers": {
|
155
|
+
"Content-Type": "application/hal+json;charset=utf-8"
|
156
|
+
},
|
157
|
+
"body": {
|
158
|
+
"_links": {
|
159
|
+
"pb:record-deployment": [
|
160
|
+
{
|
161
|
+
"name": "prod",
|
162
|
+
"href": "href"
|
163
|
+
},
|
164
|
+
{
|
165
|
+
"name": "dev",
|
166
|
+
"href": "href"
|
167
|
+
}
|
168
|
+
]
|
169
|
+
}
|
170
|
+
}
|
171
|
+
}
|
172
|
+
```
|
173
|
+
<a name="a_request_for_a_pacticipant_version_given_version_5556b8149bf8bac76bc30f50a8a2dd4c22c85f30_of_pacticipant_Foo_exists_with_a_test_environment_available_for_deployment"></a>
|
174
|
+
Given **version 5556b8149bf8bac76bc30f50a8a2dd4c22c85f30 of pacticipant Foo exists with a test environment available for deployment**, upon receiving **a request for a pacticipant version** from Pact Broker Client, with
|
175
|
+
```json
|
176
|
+
{
|
177
|
+
"method": "GET",
|
178
|
+
"path": "/HAL-REL-PLACEHOLDER-PB-PACTICIPANT-VERSION-Foo-5556b8149bf8bac76bc30f50a8a2dd4c22c85f30",
|
179
|
+
"headers": {
|
180
|
+
"Accept": "application/hal+json"
|
181
|
+
}
|
182
|
+
}
|
183
|
+
```
|
184
|
+
Pact Broker will respond with:
|
185
|
+
```json
|
186
|
+
{
|
187
|
+
"status": 200,
|
188
|
+
"headers": {
|
189
|
+
"Content-Type": "application/hal+json;charset=utf-8"
|
190
|
+
},
|
191
|
+
"body": {
|
192
|
+
"_links": {
|
193
|
+
"pb:record-deployment": [
|
194
|
+
{
|
195
|
+
"name": "test",
|
196
|
+
"href": "http://localhost:1234/HAL-REL-PLACEHOLDER-PB-RECORD-DEPLOYMENT-FOO-5556B8149BF8BAC76BC30F50A8A2DD4C22C85F30-TEST"
|
197
|
+
}
|
198
|
+
]
|
199
|
+
}
|
200
|
+
}
|
201
|
+
}
|
202
|
+
```
|
203
|
+
<a name="a_request_for_a_pacticipant_version_given_version_5556b8149bf8bac76bc30f50a8a2dd4c22c85f30_of_pacticipant_Foo_exists_with_a_test_environment_available_for_release"></a>
|
204
|
+
Given **version 5556b8149bf8bac76bc30f50a8a2dd4c22c85f30 of pacticipant Foo exists with a test environment available for release**, upon receiving **a request for a pacticipant version** from Pact Broker Client, with
|
205
|
+
```json
|
206
|
+
{
|
207
|
+
"method": "GET",
|
208
|
+
"path": "/HAL-REL-PLACEHOLDER-PB-PACTICIPANT-VERSION-Foo-5556b8149bf8bac76bc30f50a8a2dd4c22c85f30",
|
209
|
+
"headers": {
|
210
|
+
"Accept": "application/hal+json"
|
211
|
+
}
|
212
|
+
}
|
213
|
+
```
|
214
|
+
Pact Broker will respond with:
|
215
|
+
```json
|
216
|
+
{
|
217
|
+
"status": 200,
|
218
|
+
"headers": {
|
219
|
+
"Content-Type": "application/hal+json;charset=utf-8"
|
220
|
+
},
|
221
|
+
"body": {
|
222
|
+
"_links": {
|
223
|
+
"pb:record-release": [
|
224
|
+
{
|
225
|
+
"name": "test",
|
226
|
+
"href": "http://localhost:1234/HAL-REL-PLACEHOLDER-PB-RECORD-RELEASE-FOO-5556B8149BF8BAC76BC30F50A8A2DD4C22C85F30-TEST"
|
227
|
+
}
|
228
|
+
]
|
229
|
+
}
|
230
|
+
}
|
231
|
+
}
|
232
|
+
```
|
233
|
+
<a name="a_request_for_an_environment_given_an_environment_with_name_test_and_UUID_16926ef3-590f-4e3f-838e-719717aa88c9_exists"></a>
|
234
|
+
Given **an environment with name test and UUID 16926ef3-590f-4e3f-838e-719717aa88c9 exists**, upon receiving **a request for an environment** from Pact Broker Client, with
|
235
|
+
```json
|
236
|
+
{
|
237
|
+
"method": "GET",
|
238
|
+
"path": "/HAL-REL-PLACEHOLDER-PB-ENVIRONMENT-16926ef3-590f-4e3f-838e-719717aa88c9",
|
239
|
+
"headers": {
|
240
|
+
"Accept": "application/hal+json"
|
241
|
+
}
|
242
|
+
}
|
243
|
+
```
|
244
|
+
Pact Broker will respond with:
|
245
|
+
```json
|
246
|
+
{
|
247
|
+
"status": 200,
|
248
|
+
"headers": {
|
249
|
+
"Content-Type": "application/hal+json;charset=utf-8"
|
250
|
+
},
|
251
|
+
"body": {
|
252
|
+
"_links": {
|
253
|
+
"pb:currently-deployed-deployed-versions": {
|
254
|
+
"href": "http://localhost:1234/PLACEHOLDER-ENVIRONMENT-CURRENTLY-DEPLOYED-16926ef3-590f-4e3f-838e-719717aa88c9"
|
255
|
+
}
|
256
|
+
}
|
257
|
+
}
|
258
|
+
}
|
259
|
+
```
|
119
260
|
<a name="a_request_for_the_compatibility_matrix_for_a_pacticipant_that_does_not_exist"></a>
|
120
261
|
Upon receiving **a request for the compatibility matrix for a pacticipant that does not exist** from Pact Broker Client, with
|
121
262
|
```json
|
@@ -537,6 +678,36 @@ Pact Broker will respond with:
|
|
537
678
|
}
|
538
679
|
}
|
539
680
|
```
|
681
|
+
<a name="a_request_for_the_environments_given_an_environment_with_name_test_exists"></a>
|
682
|
+
Given **an environment with name test exists**, upon receiving **a request for the environments** from Pact Broker Client, with
|
683
|
+
```json
|
684
|
+
{
|
685
|
+
"method": "GET",
|
686
|
+
"path": "/HAL-REL-PLACEHOLDER-PB-ENVIRONMENTS",
|
687
|
+
"headers": {
|
688
|
+
"Accept": "application/hal+json"
|
689
|
+
}
|
690
|
+
}
|
691
|
+
```
|
692
|
+
Pact Broker will respond with:
|
693
|
+
```json
|
694
|
+
{
|
695
|
+
"status": 200,
|
696
|
+
"headers": {
|
697
|
+
"Content-Type": "application/hal+json;charset=utf-8"
|
698
|
+
},
|
699
|
+
"body": {
|
700
|
+
"_links": {
|
701
|
+
"pb:environments": [
|
702
|
+
{
|
703
|
+
"name": "test",
|
704
|
+
"href": "href"
|
705
|
+
}
|
706
|
+
]
|
707
|
+
}
|
708
|
+
}
|
709
|
+
}
|
710
|
+
```
|
540
711
|
<a name="a_request_for_the_index_resource"></a>
|
541
712
|
Upon receiving **a request for the index resource** from Pact Broker Client, with
|
542
713
|
```json
|
@@ -654,6 +825,36 @@ Pact Broker will respond with:
|
|
654
825
|
}
|
655
826
|
}
|
656
827
|
```
|
828
|
+
<a name="a_request_for_the_index_resource_given_the_pb:pacticipant-version_and_pb:environments_relations_exist_in_the_index_resource"></a>
|
829
|
+
Given **the pb:pacticipant-version and pb:environments relations exist in the index resource**, upon receiving **a request for the index resource** from Pact Broker Client, with
|
830
|
+
```json
|
831
|
+
{
|
832
|
+
"method": "GET",
|
833
|
+
"path": "/",
|
834
|
+
"headers": {
|
835
|
+
"Accept": "application/hal+json"
|
836
|
+
}
|
837
|
+
}
|
838
|
+
```
|
839
|
+
Pact Broker will respond with:
|
840
|
+
```json
|
841
|
+
{
|
842
|
+
"status": 200,
|
843
|
+
"headers": {
|
844
|
+
"Content-Type": "application/hal+json;charset=utf-8"
|
845
|
+
},
|
846
|
+
"body": {
|
847
|
+
"_links": {
|
848
|
+
"pb:pacticipant-version": {
|
849
|
+
"href": "http://localhost:1234/HAL-REL-PLACEHOLDER-PB-PACTICIPANT-VERSION-{pacticipant}-{version}"
|
850
|
+
},
|
851
|
+
"pb:environments": {
|
852
|
+
"href": "http://localhost:1234/HAL-REL-PLACEHOLDER-PB-ENVIRONMENTS"
|
853
|
+
}
|
854
|
+
}
|
855
|
+
}
|
856
|
+
}
|
857
|
+
```
|
657
858
|
<a name="a_request_for_the_index_resource_given_the_pb:pacticipant-version_relation_exists_in_the_index_resource"></a>
|
658
859
|
Given **the pb:pacticipant-version relation exists in the index resource**, upon receiving **a request for the index resource** from Pact Broker Client, with
|
659
860
|
```json
|
@@ -1666,6 +1867,72 @@ Pact Broker will respond with:
|
|
1666
1867
|
}
|
1667
1868
|
}
|
1668
1869
|
```
|
1870
|
+
<a name="a_request_to_list_the_versions_deployed_to_an_environment_for_a_pacticipant_name_and_target_given_an_version_is_deployed_to_environment_with_UUID_16926ef3-590f-4e3f-838e-719717aa88c9_with_target_customer-1"></a>
|
1871
|
+
Given **an version is deployed to environment with UUID 16926ef3-590f-4e3f-838e-719717aa88c9 with target customer-1**, upon receiving **a request to list the versions deployed to an environment for a pacticipant name and target** from Pact Broker Client, with
|
1872
|
+
```json
|
1873
|
+
{
|
1874
|
+
"method": "GET",
|
1875
|
+
"path": "/PLACEHOLDER-ENVIRONMENT-CURRENTLY-DEPLOYED-16926ef3-590f-4e3f-838e-719717aa88c9",
|
1876
|
+
"query": "pacticipant=Foo",
|
1877
|
+
"headers": {
|
1878
|
+
"Accept": "application/hal+json"
|
1879
|
+
}
|
1880
|
+
}
|
1881
|
+
```
|
1882
|
+
Pact Broker will respond with:
|
1883
|
+
```json
|
1884
|
+
{
|
1885
|
+
"status": 200,
|
1886
|
+
"headers": {
|
1887
|
+
"Content-Type": "application/hal+json;charset=utf-8"
|
1888
|
+
},
|
1889
|
+
"body": {
|
1890
|
+
"_embedded": {
|
1891
|
+
"deployedVersions": [
|
1892
|
+
{
|
1893
|
+
"target": "customer-1",
|
1894
|
+
"_links": {
|
1895
|
+
"self": {
|
1896
|
+
"href": "http://localhost:1234/PLACEHOLDER-DEPLOYED-VERSION-ff3adecf-cfc5-4653-a4e3-f1861092f8e0"
|
1897
|
+
}
|
1898
|
+
}
|
1899
|
+
}
|
1900
|
+
]
|
1901
|
+
}
|
1902
|
+
}
|
1903
|
+
}
|
1904
|
+
```
|
1905
|
+
<a name="a_request_to_mark_a_deployed_version_as_not_currently_deploye_given_a_currently_deployed_version_exists"></a>
|
1906
|
+
Given **a currently deployed version exists**, upon receiving **a request to mark a deployed version as not currently deploye** from Pact Broker Client, with
|
1907
|
+
```json
|
1908
|
+
{
|
1909
|
+
"method": "PATCH",
|
1910
|
+
"path": "/PLACEHOLDER-DEPLOYED-VERSION-ff3adecf-cfc5-4653-a4e3-f1861092f8e0",
|
1911
|
+
"headers": {
|
1912
|
+
"Content-Type": "application/merge-patch+json"
|
1913
|
+
},
|
1914
|
+
"body": {
|
1915
|
+
"currentlyDeployed": false
|
1916
|
+
}
|
1917
|
+
}
|
1918
|
+
```
|
1919
|
+
Pact Broker will respond with:
|
1920
|
+
```json
|
1921
|
+
{
|
1922
|
+
"status": 200,
|
1923
|
+
"headers": {
|
1924
|
+
"Content-Type": "application/hal+json;charset=utf-8"
|
1925
|
+
},
|
1926
|
+
"body": {
|
1927
|
+
"currentlyDeployed": false,
|
1928
|
+
"_embedded": {
|
1929
|
+
"version": {
|
1930
|
+
"number": "2"
|
1931
|
+
}
|
1932
|
+
}
|
1933
|
+
}
|
1934
|
+
}
|
1935
|
+
```
|
1669
1936
|
<a name="a_request_to_publish_a_pact_given_'Condor'_already_exist_in_the_pact-broker,_but_the_'Pricing_Service'_does_not"></a>
|
1670
1937
|
Given **'Condor' already exist in the pact-broker, but the 'Pricing Service' does not**, upon receiving **a request to publish a pact** from Pact Broker Client, with
|
1671
1938
|
```json
|
@@ -1854,6 +2121,54 @@ Pact Broker will respond with:
|
|
1854
2121
|
}
|
1855
2122
|
}
|
1856
2123
|
```
|
2124
|
+
<a name="a_request_to_record_a_deployment_given_version_5556b8149bf8bac76bc30f50a8a2dd4c22c85f30_of_pacticipant_Foo_exists_with_a_test_environment_available_for_deployment"></a>
|
2125
|
+
Given **version 5556b8149bf8bac76bc30f50a8a2dd4c22c85f30 of pacticipant Foo exists with a test environment available for deployment**, upon receiving **a request to record a deployment** from Pact Broker Client, with
|
2126
|
+
```json
|
2127
|
+
{
|
2128
|
+
"method": "POST",
|
2129
|
+
"path": "/HAL-REL-PLACEHOLDER-PB-RECORD-DEPLOYMENT-FOO-5556B8149BF8BAC76BC30F50A8A2DD4C22C85F30-TEST",
|
2130
|
+
"headers": {
|
2131
|
+
"Content-Type": "application/json",
|
2132
|
+
"Accept": "application/hal+json"
|
2133
|
+
},
|
2134
|
+
"body": {
|
2135
|
+
"target": "blue"
|
2136
|
+
}
|
2137
|
+
}
|
2138
|
+
```
|
2139
|
+
Pact Broker will respond with:
|
2140
|
+
```json
|
2141
|
+
{
|
2142
|
+
"status": 201,
|
2143
|
+
"headers": {
|
2144
|
+
"Content-Type": "application/hal+json;charset=utf-8"
|
2145
|
+
},
|
2146
|
+
"body": {
|
2147
|
+
"target": "blue"
|
2148
|
+
}
|
2149
|
+
}
|
2150
|
+
```
|
2151
|
+
<a name="a_request_to_record_a_release_given_version_5556b8149bf8bac76bc30f50a8a2dd4c22c85f30_of_pacticipant_Foo_exists_with_a_test_environment_available_for_deployment"></a>
|
2152
|
+
Given **version 5556b8149bf8bac76bc30f50a8a2dd4c22c85f30 of pacticipant Foo exists with a test environment available for deployment**, upon receiving **a request to record a release** from Pact Broker Client, with
|
2153
|
+
```json
|
2154
|
+
{
|
2155
|
+
"method": "POST",
|
2156
|
+
"path": "/HAL-REL-PLACEHOLDER-PB-RECORD-RELEASE-FOO-5556B8149BF8BAC76BC30F50A8A2DD4C22C85F30-TEST",
|
2157
|
+
"headers": {
|
2158
|
+
"Content-Type": "application/json",
|
2159
|
+
"Accept": "application/hal+json"
|
2160
|
+
}
|
2161
|
+
}
|
2162
|
+
```
|
2163
|
+
Pact Broker will respond with:
|
2164
|
+
```json
|
2165
|
+
{
|
2166
|
+
"status": 201,
|
2167
|
+
"headers": {
|
2168
|
+
"Content-Type": "application/hal+json;charset=utf-8"
|
2169
|
+
}
|
2170
|
+
}
|
2171
|
+
```
|
1857
2172
|
<a name="a_request_to_register_the_repository_URL_of_a_pacticipant_given_the_'Pricing_Service'_already_exists_in_the_pact-broker"></a>
|
1858
2173
|
Given **the 'Pricing Service' already exists in the pact-broker**, upon receiving **a request to register the repository URL of a pacticipant** from Pact Broker Client, with
|
1859
2174
|
```json
|
@@ -5,6 +5,7 @@ require 'pact_broker/client/cli/environment_commands'
|
|
5
5
|
require 'pact_broker/client/cli/deployment_commands'
|
6
6
|
require 'pact_broker/client/cli/pacticipant_commands'
|
7
7
|
require 'pact_broker/client/cli/webhook_commands'
|
8
|
+
require "pact_broker/client/cli/matrix_commands"
|
8
9
|
|
9
10
|
module PactBroker
|
10
11
|
module Client
|
@@ -16,51 +17,13 @@ module PactBroker
|
|
16
17
|
|
17
18
|
class Broker < CustomThor
|
18
19
|
using PactBroker::Client::HashRefinements
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
20
|
+
|
21
|
+
include PactBroker::Client::CLI::EnvironmentCommands
|
22
|
+
include PactBroker::Client::CLI::DeploymentCommands
|
23
|
+
include PactBroker::Client::CLI::MatrixCommands
|
23
24
|
include PactBroker::Client::CLI::PacticipantCommands
|
24
25
|
include PactBroker::Client::CLI::WebhookCommands
|
25
26
|
|
26
|
-
|
27
|
-
desc 'can-i-deploy', ''
|
28
|
-
long_desc File.read(File.join(__dir__, 'can_i_deploy_long_desc.txt'))
|
29
|
-
|
30
|
-
method_option :pacticipant, required: true, aliases: "-a", desc: "The pacticipant name. Use once for each pacticipant being checked."
|
31
|
-
method_option :version, required: false, aliases: "-e", desc: "The pacticipant version. Must be entered after the --pacticipant that it relates to."
|
32
|
-
method_option :ignore, required: false, desc: "The pacticipant name to ignore. Use once for each pacticipant being ignored. A specific version can be ignored by also specifying a --version after the pacticipant name option."
|
33
|
-
method_option :latest, required: false, aliases: "-l", banner: '[TAG]', desc: "Use the latest pacticipant version. Optionally specify a TAG to use the latest version with the specified tag."
|
34
|
-
method_option :to, required: false, banner: 'TAG', desc: "This is too hard to explain in a short sentence. Look at the examples.", default: nil
|
35
|
-
method_option :to_environment, required: false, banner: 'ENVIRONMENT', desc: "The environment into which the pacticipant(s) are to be deployed", default: nil, hide: true
|
36
|
-
method_option :output, aliases: "-o", desc: "json or table", default: 'table'
|
37
|
-
method_option :retry_while_unknown, banner: 'TIMES', type: :numeric, default: 0, required: false, desc: "The number of times to retry while there is an unknown verification result (ie. the provider verification is likely still running)"
|
38
|
-
method_option :retry_interval, banner: 'SECONDS', type: :numeric, default: 10, required: false, desc: "The time between retries in seconds. Use in conjuction with --retry-while-unknown"
|
39
|
-
# Allow limit to be set manually until https://github.com/pact-foundation/pact_broker-client/issues/53 is fixed
|
40
|
-
method_option :limit, hide: true
|
41
|
-
method_option :dry_run, type: :boolean, default: false, desc: "When dry-run is enabled, always exit process with a success code. Can also be enabled by setting the environment variable PACT_BROKER_CAN_I_DEPLOY_DRY_RUN=true."
|
42
|
-
shared_authentication_options
|
43
|
-
|
44
|
-
def can_i_deploy(*ignored_but_necessary)
|
45
|
-
require 'pact_broker/client/cli/version_selector_options_parser'
|
46
|
-
require 'pact_broker/client/can_i_deploy'
|
47
|
-
|
48
|
-
validate_credentials
|
49
|
-
selectors = VersionSelectorOptionsParser.call(ARGV).select { |s| !s[:ignore] }
|
50
|
-
ignore_selectors = if ENV.fetch("PACT_BROKER_FEATURES", "").include?("ignore")
|
51
|
-
VersionSelectorOptionsParser.call(ARGV).select { |s| s[:ignore] }
|
52
|
-
else
|
53
|
-
[]
|
54
|
-
end
|
55
|
-
validate_can_i_deploy_selectors(selectors)
|
56
|
-
dry_run = options.dry_run || ENV["PACT_BROKER_CAN_I_DEPLOY_DRY_RUN"] == "true"
|
57
|
-
can_i_deploy_options = { output: options.output, retry_while_unknown: options.retry_while_unknown, retry_interval: options.retry_interval, dry_run: dry_run }
|
58
|
-
result = CanIDeploy.call(options.broker_base_url, selectors, { to_tag: options.to, to_environment: options.to_environment, limit: options.limit, ignore_selectors: ignore_selectors }, can_i_deploy_options, pact_broker_client_options)
|
59
|
-
$stdout.puts result.message
|
60
|
-
$stdout.flush
|
61
|
-
exit(can_i_deploy_exit_status) unless result.success
|
62
|
-
end
|
63
|
-
|
64
27
|
desc 'publish PACT_DIRS_OR_FILES ...', "Publish pacts to a Pact Broker."
|
65
28
|
method_option :consumer_app_version, required: true, aliases: "-a", desc: "The consumer application version"
|
66
29
|
method_option :branch, aliases: "-h", desc: "Repository branch of the consumer version"
|
@@ -166,16 +129,6 @@ module PactBroker
|
|
166
129
|
true
|
167
130
|
end
|
168
131
|
|
169
|
-
def can_i_deploy_exit_status
|
170
|
-
exit_code_string = ENV.fetch('PACT_BROKER_CAN_I_DEPLOY_EXIT_CODE_BETA', '')
|
171
|
-
if exit_code_string =~ /^\d+$/
|
172
|
-
$stderr.puts "Exiting can-i-deploy with configured exit code #{exit_code_string}"
|
173
|
-
exit_code_string.to_i
|
174
|
-
else
|
175
|
-
1
|
176
|
-
end
|
177
|
-
end
|
178
|
-
|
179
132
|
def validate_credentials
|
180
133
|
if options.broker_username && options.broker_token
|
181
134
|
raise AuthError, "You cannot provide both a username/password and a bearer token. If your Pact Broker uses a bearer token, please remove the username and password configuration."
|
@@ -188,10 +141,6 @@ module PactBroker
|
|
188
141
|
end
|
189
142
|
end
|
190
143
|
|
191
|
-
def validate_can_i_deploy_selectors selectors
|
192
|
-
pacticipants_without_versions = selectors.select{ |s| s[:version].nil? && s[:latest].nil? && s[:tag].nil? }.collect{ |s| s[:pacticipant] }
|
193
|
-
raise ::Thor::RequiredArgumentMissingError, "The version must be specified using `--version VERSION`, `--latest`, `--latest TAG`, or `--all TAG` for pacticipant #{pacticipants_without_versions.join(", ")}" if pacticipants_without_versions.any?
|
194
|
-
end
|
195
144
|
|
196
145
|
def publish_pacts pact_files
|
197
146
|
require 'pact_broker/client/publish_pacts'
|
@@ -0,0 +1,93 @@
|
|
1
|
+
module PactBroker
|
2
|
+
module Client
|
3
|
+
module CLI
|
4
|
+
module MatrixCommands
|
5
|
+
|
6
|
+
def self.included(thor)
|
7
|
+
thor.class_eval do
|
8
|
+
desc "can-i-deploy", ""
|
9
|
+
long_desc File.read(File.join(__dir__, "can_i_deploy_long_desc.txt"))
|
10
|
+
|
11
|
+
method_option :pacticipant, required: true, aliases: "-a", desc: "The pacticipant name. Use once for each pacticipant being checked."
|
12
|
+
method_option :version, required: false, aliases: "-e", desc: "The pacticipant version. Must be entered after the --pacticipant that it relates to."
|
13
|
+
method_option :ignore, required: false, desc: "The pacticipant name to ignore. Use once for each pacticipant being ignored. A specific version can be ignored by also specifying a --version after the pacticipant name option."
|
14
|
+
method_option :latest, required: false, aliases: "-l", banner: "[TAG]", desc: "Use the latest pacticipant version. Optionally specify a TAG to use the latest version with the specified tag."
|
15
|
+
method_option :to, required: false, banner: "TAG", desc: "This is too hard to explain in a short sentence. Look at the examples.", default: nil
|
16
|
+
method_option :to_environment, required: false, banner: "ENVIRONMENT", desc: "The environment into which the pacticipant(s) are to be deployed", default: nil, hide: true
|
17
|
+
method_option :output, aliases: "-o", desc: "json or table", default: "table"
|
18
|
+
method_option :retry_while_unknown, banner: "TIMES", type: :numeric, default: 0, required: false, desc: "The number of times to retry while there is an unknown verification result (ie. the provider verification is likely still running)"
|
19
|
+
method_option :retry_interval, banner: "SECONDS", type: :numeric, default: 10, required: false, desc: "The time between retries in seconds. Use in conjuction with --retry-while-unknown"
|
20
|
+
# Allow limit to be set manually until https://github.com/pact-foundation/pact_broker-client/issues/53 is fixed
|
21
|
+
method_option :limit, hide: true
|
22
|
+
method_option :dry_run, type: :boolean, default: false, desc: "When dry-run is enabled, always exit process with a success code. Can also be enabled by setting the environment variable PACT_BROKER_CAN_I_DEPLOY_DRY_RUN=true."
|
23
|
+
shared_authentication_options
|
24
|
+
|
25
|
+
def can_i_deploy(*ignored_but_necessary)
|
26
|
+
require "pact_broker/client/cli/version_selector_options_parser"
|
27
|
+
require "pact_broker/client/can_i_deploy"
|
28
|
+
|
29
|
+
validate_credentials
|
30
|
+
selectors = VersionSelectorOptionsParser.call(ARGV).select { |s| !s[:ignore] }
|
31
|
+
ignore_selectors = if ENV.fetch("PACT_BROKER_FEATURES", "").include?("ignore")
|
32
|
+
VersionSelectorOptionsParser.call(ARGV).select { |s| s[:ignore] }
|
33
|
+
else
|
34
|
+
[]
|
35
|
+
end
|
36
|
+
validate_can_i_deploy_selectors(selectors)
|
37
|
+
dry_run = options.dry_run || ENV["PACT_BROKER_CAN_I_DEPLOY_DRY_RUN"] == "true"
|
38
|
+
can_i_deploy_options = { output: options.output, retry_while_unknown: options.retry_while_unknown, retry_interval: options.retry_interval, dry_run: dry_run, verbose: options.verbose }
|
39
|
+
result = CanIDeploy.call(options.broker_base_url, selectors, { to_tag: options.to, to_environment: options.to_environment, limit: options.limit, ignore_selectors: ignore_selectors }, can_i_deploy_options, pact_broker_client_options)
|
40
|
+
$stdout.puts result.message
|
41
|
+
$stdout.flush
|
42
|
+
exit(can_i_deploy_exit_status) unless result.success
|
43
|
+
end
|
44
|
+
|
45
|
+
if ENV.fetch("PACT_BROKER_FEATURES", "").include?("verification_required")
|
46
|
+
|
47
|
+
method_option :pacticipant, required: true, aliases: "-a", desc: "The pacticipant name. Use once for each pacticipant being checked."
|
48
|
+
method_option :version, required: false, aliases: "-e", desc: "The pacticipant version. Must be entered after the --pacticipant that it relates to."
|
49
|
+
method_option :latest, required: false, aliases: "-l", banner: "[TAG]", desc: "Use the latest pacticipant version. Optionally specify a TAG to use the latest version with the specified tag."
|
50
|
+
method_option :to, required: false, banner: "TAG", desc: "This is too hard to explain in a short sentence. Look at the examples.", default: nil
|
51
|
+
method_option :in_environment, required: false, banner: "ENVIRONMENT", desc: "The environment into which the pacticipant(s) are to be deployed", default: nil, hide: true
|
52
|
+
method_option :output, aliases: "-o", desc: "json or table", default: "table"
|
53
|
+
|
54
|
+
shared_authentication_options
|
55
|
+
desc "verification-required", "Checks if there is a verification required between the given pacticipant versions"
|
56
|
+
def verification_required(*ignored_but_necessary)
|
57
|
+
require "pact_broker/client/cli/version_selector_options_parser"
|
58
|
+
require "pact_broker/client/verification_required"
|
59
|
+
|
60
|
+
validate_credentials
|
61
|
+
selectors = VersionSelectorOptionsParser.call(ARGV)
|
62
|
+
validate_can_i_deploy_selectors(selectors)
|
63
|
+
verification_required_options = { output: options.output, verbose: options.verbose, retry_while_unknown: 0 }
|
64
|
+
result = VerificationRequired.call(options.broker_base_url, selectors, { to_tag: options.to, to_environment: options.in_environment, ignore_selectors: [] }, verification_required_options, pact_broker_client_options)
|
65
|
+
$stdout.puts result.message
|
66
|
+
$stdout.flush
|
67
|
+
exit(1) unless result.success
|
68
|
+
end
|
69
|
+
|
70
|
+
end
|
71
|
+
|
72
|
+
no_commands do
|
73
|
+
def can_i_deploy_exit_status
|
74
|
+
exit_code_string = ENV.fetch("PACT_BROKER_CAN_I_DEPLOY_EXIT_CODE_BETA", "")
|
75
|
+
if exit_code_string =~ /^\d+$/
|
76
|
+
$stderr.puts "Exiting can-i-deploy with configured exit code #{exit_code_string}"
|
77
|
+
exit_code_string.to_i
|
78
|
+
else
|
79
|
+
1
|
80
|
+
end
|
81
|
+
end
|
82
|
+
|
83
|
+
def validate_can_i_deploy_selectors selectors
|
84
|
+
pacticipants_without_versions = selectors.select{ |s| s[:version].nil? && s[:latest].nil? && s[:tag].nil? }.collect{ |s| s[:pacticipant] }
|
85
|
+
raise ::Thor::RequiredArgumentMissingError, "The version must be specified using `--version VERSION`, `--latest`, `--latest TAG`, or `--all TAG` for pacticipant #{pacticipants_without_versions.join(", ")}" if pacticipants_without_versions.any?
|
86
|
+
end
|
87
|
+
end
|
88
|
+
end
|
89
|
+
end
|
90
|
+
end
|
91
|
+
end
|
92
|
+
end
|
93
|
+
end
|
@@ -24,7 +24,7 @@ module PactBroker
|
|
24
24
|
attr_reader :pacticipant_name, :environment_name, :version_number
|
25
25
|
|
26
26
|
def currently_supported_versions_link
|
27
|
-
environment_resource._link("pb:currently-supported-versions") or raise PactBroker::Client::Error.new(not_supported_message)
|
27
|
+
environment_resource._link("pb:currently-supported-released-versions", "pb:currently-supported-versions") or raise PactBroker::Client::Error.new(not_supported_message)
|
28
28
|
end
|
29
29
|
|
30
30
|
def currently_supported_version_entities_for_pacticipant_version
|
@@ -24,7 +24,7 @@ module PactBroker
|
|
24
24
|
attr_reader :pacticipant_name, :environment_name, :target
|
25
25
|
|
26
26
|
def currently_deployed_versions_link
|
27
|
-
environment_resource._link("pb:currently-deployed-versions") or raise PactBroker::Client::Error.new(not_supported_message)
|
27
|
+
environment_resource._link("pb:currently-deployed-deployed-versions", "pb:currently-deployed-versions") or raise PactBroker::Client::Error.new(not_supported_message)
|
28
28
|
end
|
29
29
|
|
30
30
|
def currently_deployed_version_entities_for_pacticipant
|
@@ -0,0 +1,32 @@
|
|
1
|
+
require "pact_broker/client/can_i_deploy"
|
2
|
+
|
3
|
+
module PactBroker
|
4
|
+
module Client
|
5
|
+
class VerificationRequired < PactBroker::Client::CanIDeploy
|
6
|
+
def call
|
7
|
+
create_result(fetch_matrix_with_retries)
|
8
|
+
rescue StandardError => e
|
9
|
+
message = "Error determining if a verification already existed (#{e.message}) - verification should run just in case"
|
10
|
+
if options[:verbose]
|
11
|
+
message = "#{message}\n#{e.class} - #{e.backtrace.join("\n")}"
|
12
|
+
end
|
13
|
+
Result.new(true, message)
|
14
|
+
end
|
15
|
+
|
16
|
+
private
|
17
|
+
|
18
|
+
def create_result(matrix)
|
19
|
+
matrix_and_notices = format_matrix(matrix) + "\n\n" + remove_warnings(Term::ANSIColor.uncolor(notice_or_reason(matrix, :white)))
|
20
|
+
if matrix.any_unknown?
|
21
|
+
Result.new(true, matrix_and_notices + "\n\nVerification is required.")
|
22
|
+
else
|
23
|
+
Result.new(false, matrix_and_notices + "\n\nNo verification is required.")
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
def remove_warnings(lines)
|
28
|
+
lines.split("\n").select{ | line | !line.include?("WARN:") }.join("\n")
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
data/script/record-deployment.sh
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
|
1
|
+
bundle exec bin/pact-broker record-deployment \
|
2
2
|
--pacticipant foo-consumer --version 1 --environment prod --broker-base-url http://localhost:9292
|
@@ -1,5 +1,3 @@
|
|
1
|
-
export PACT_BROKER_FEATURES=deployments
|
2
|
-
|
3
1
|
bundle exec bin/pact-broker create-or-update-pacticipant --name Foo
|
4
2
|
bundle exec bin/pact-broker create-version-tag --pacticipant Foo --version 2 --tag main --auto-create-version
|
5
3
|
bundle exec bin/pact-broker describe-version --pacticipant Foo --version 2
|
@@ -38,7 +38,7 @@ module PactBroker
|
|
38
38
|
end
|
39
39
|
|
40
40
|
it "invokes the CanIDeploy service" do
|
41
|
-
expect(CanIDeploy).to receive(:call).with('http://pact-broker', version_selectors, { to_tag: nil, to_environment: nil, limit: 1000, ignore_selectors: []}, {output: 'table', retry_while_unknown: 1, retry_interval: 2, dry_run: false}, { pact_broker_base_url: 'http://pact-broker', verbose: 'verbose' })
|
41
|
+
expect(CanIDeploy).to receive(:call).with('http://pact-broker', version_selectors, { to_tag: nil, to_environment: nil, limit: 1000, ignore_selectors: []}, {output: 'table', retry_while_unknown: 1, retry_interval: 2, dry_run: false, verbose: "verbose"}, { pact_broker_base_url: 'http://pact-broker', verbose: 'verbose' })
|
42
42
|
invoke_can_i_deploy
|
43
43
|
end
|
44
44
|
|
@@ -1638,6 +1638,323 @@
|
|
1638
1638
|
}
|
1639
1639
|
}
|
1640
1640
|
},
|
1641
|
+
{
|
1642
|
+
"description": "a request for the index resource",
|
1643
|
+
"providerState": "the pb:pacticipant-version and pb:environments relations exist in the index resource",
|
1644
|
+
"request": {
|
1645
|
+
"method": "GET",
|
1646
|
+
"path": "/",
|
1647
|
+
"headers": {
|
1648
|
+
"Accept": "application/hal+json"
|
1649
|
+
}
|
1650
|
+
},
|
1651
|
+
"response": {
|
1652
|
+
"status": 200,
|
1653
|
+
"headers": {
|
1654
|
+
"Content-Type": "application/hal+json;charset=utf-8"
|
1655
|
+
},
|
1656
|
+
"body": {
|
1657
|
+
"_links": {
|
1658
|
+
"pb:pacticipant-version": {
|
1659
|
+
"href": "http://localhost:1234/HAL-REL-PLACEHOLDER-PB-PACTICIPANT-VERSION-{pacticipant}-{version}"
|
1660
|
+
},
|
1661
|
+
"pb:environments": {
|
1662
|
+
"href": "http://localhost:1234/HAL-REL-PLACEHOLDER-PB-ENVIRONMENTS"
|
1663
|
+
}
|
1664
|
+
}
|
1665
|
+
},
|
1666
|
+
"matchingRules": {
|
1667
|
+
"$.body._links.pb:pacticipant-version.href": {
|
1668
|
+
"match": "regex",
|
1669
|
+
"regex": "http:\\/\\/.*{pacticipant}.*{version}"
|
1670
|
+
},
|
1671
|
+
"$.body._links.pb:environments.href": {
|
1672
|
+
"match": "regex",
|
1673
|
+
"regex": "http:\\/\\/.*"
|
1674
|
+
}
|
1675
|
+
}
|
1676
|
+
}
|
1677
|
+
},
|
1678
|
+
{
|
1679
|
+
"description": "a request for a pacticipant version",
|
1680
|
+
"providerState": "version 5556b8149bf8bac76bc30f50a8a2dd4c22c85f30 of pacticipant Foo exists with a test environment available for deployment",
|
1681
|
+
"request": {
|
1682
|
+
"method": "GET",
|
1683
|
+
"path": "/HAL-REL-PLACEHOLDER-PB-PACTICIPANT-VERSION-Foo-5556b8149bf8bac76bc30f50a8a2dd4c22c85f30",
|
1684
|
+
"headers": {
|
1685
|
+
"Accept": "application/hal+json"
|
1686
|
+
}
|
1687
|
+
},
|
1688
|
+
"response": {
|
1689
|
+
"status": 200,
|
1690
|
+
"headers": {
|
1691
|
+
"Content-Type": "application/hal+json;charset=utf-8"
|
1692
|
+
},
|
1693
|
+
"body": {
|
1694
|
+
"_links": {
|
1695
|
+
"pb:record-deployment": [
|
1696
|
+
{
|
1697
|
+
"name": "test",
|
1698
|
+
"href": "http://localhost:1234/HAL-REL-PLACEHOLDER-PB-RECORD-DEPLOYMENT-FOO-5556B8149BF8BAC76BC30F50A8A2DD4C22C85F30-TEST"
|
1699
|
+
}
|
1700
|
+
]
|
1701
|
+
}
|
1702
|
+
},
|
1703
|
+
"matchingRules": {
|
1704
|
+
"$.body._links.pb:record-deployment[0].href": {
|
1705
|
+
"match": "regex",
|
1706
|
+
"regex": "http:\\/\\/.*"
|
1707
|
+
}
|
1708
|
+
}
|
1709
|
+
}
|
1710
|
+
},
|
1711
|
+
{
|
1712
|
+
"description": "a request to record a deployment",
|
1713
|
+
"providerState": "version 5556b8149bf8bac76bc30f50a8a2dd4c22c85f30 of pacticipant Foo exists with a test environment available for deployment",
|
1714
|
+
"request": {
|
1715
|
+
"method": "POST",
|
1716
|
+
"path": "/HAL-REL-PLACEHOLDER-PB-RECORD-DEPLOYMENT-FOO-5556B8149BF8BAC76BC30F50A8A2DD4C22C85F30-TEST",
|
1717
|
+
"headers": {
|
1718
|
+
"Content-Type": "application/json",
|
1719
|
+
"Accept": "application/hal+json"
|
1720
|
+
},
|
1721
|
+
"body": {
|
1722
|
+
"target": "blue"
|
1723
|
+
}
|
1724
|
+
},
|
1725
|
+
"response": {
|
1726
|
+
"status": 201,
|
1727
|
+
"headers": {
|
1728
|
+
"Content-Type": "application/hal+json;charset=utf-8"
|
1729
|
+
},
|
1730
|
+
"body": {
|
1731
|
+
"target": "blue"
|
1732
|
+
}
|
1733
|
+
}
|
1734
|
+
},
|
1735
|
+
{
|
1736
|
+
"description": "a request for a pacticipant version",
|
1737
|
+
"providerState": "version 5556b8149bf8bac76bc30f50a8a2dd4c22c85f30 of pacticipant Foo exists with 2 environments that aren't test available for deployment",
|
1738
|
+
"request": {
|
1739
|
+
"method": "GET",
|
1740
|
+
"path": "/HAL-REL-PLACEHOLDER-PB-PACTICIPANT-VERSION-Foo-5556b8149bf8bac76bc30f50a8a2dd4c22c85f30",
|
1741
|
+
"headers": {
|
1742
|
+
"Accept": "application/hal+json"
|
1743
|
+
}
|
1744
|
+
},
|
1745
|
+
"response": {
|
1746
|
+
"status": 200,
|
1747
|
+
"headers": {
|
1748
|
+
"Content-Type": "application/hal+json;charset=utf-8"
|
1749
|
+
},
|
1750
|
+
"body": {
|
1751
|
+
"_links": {
|
1752
|
+
"pb:record-deployment": [
|
1753
|
+
{
|
1754
|
+
"name": "prod",
|
1755
|
+
"href": "href"
|
1756
|
+
},
|
1757
|
+
{
|
1758
|
+
"name": "dev",
|
1759
|
+
"href": "href"
|
1760
|
+
}
|
1761
|
+
]
|
1762
|
+
}
|
1763
|
+
},
|
1764
|
+
"matchingRules": {
|
1765
|
+
"$.body._links.pb:record-deployment[0]": {
|
1766
|
+
"match": "type"
|
1767
|
+
},
|
1768
|
+
"$.body._links.pb:record-deployment[1]": {
|
1769
|
+
"match": "type"
|
1770
|
+
}
|
1771
|
+
}
|
1772
|
+
}
|
1773
|
+
},
|
1774
|
+
{
|
1775
|
+
"description": "a request for the environments",
|
1776
|
+
"providerState": "an environment with name test exists",
|
1777
|
+
"request": {
|
1778
|
+
"method": "GET",
|
1779
|
+
"path": "/HAL-REL-PLACEHOLDER-PB-ENVIRONMENTS",
|
1780
|
+
"headers": {
|
1781
|
+
"Accept": "application/hal+json"
|
1782
|
+
}
|
1783
|
+
},
|
1784
|
+
"response": {
|
1785
|
+
"status": 200,
|
1786
|
+
"headers": {
|
1787
|
+
"Content-Type": "application/hal+json;charset=utf-8"
|
1788
|
+
},
|
1789
|
+
"body": {
|
1790
|
+
"_links": {
|
1791
|
+
"pb:environments": [
|
1792
|
+
{
|
1793
|
+
"name": "test",
|
1794
|
+
"href": "href"
|
1795
|
+
}
|
1796
|
+
]
|
1797
|
+
}
|
1798
|
+
},
|
1799
|
+
"matchingRules": {
|
1800
|
+
"$.body._links.pb:environments[0].href": {
|
1801
|
+
"match": "type"
|
1802
|
+
}
|
1803
|
+
}
|
1804
|
+
}
|
1805
|
+
},
|
1806
|
+
{
|
1807
|
+
"description": "a request for a pacticipant version",
|
1808
|
+
"providerState": "version 5556b8149bf8bac76bc30f50a8a2dd4c22c85f30 of pacticipant Foo exists with a test environment available for release",
|
1809
|
+
"request": {
|
1810
|
+
"method": "GET",
|
1811
|
+
"path": "/HAL-REL-PLACEHOLDER-PB-PACTICIPANT-VERSION-Foo-5556b8149bf8bac76bc30f50a8a2dd4c22c85f30",
|
1812
|
+
"headers": {
|
1813
|
+
"Accept": "application/hal+json"
|
1814
|
+
}
|
1815
|
+
},
|
1816
|
+
"response": {
|
1817
|
+
"status": 200,
|
1818
|
+
"headers": {
|
1819
|
+
"Content-Type": "application/hal+json;charset=utf-8"
|
1820
|
+
},
|
1821
|
+
"body": {
|
1822
|
+
"_links": {
|
1823
|
+
"pb:record-release": [
|
1824
|
+
{
|
1825
|
+
"name": "test",
|
1826
|
+
"href": "http://localhost:1234/HAL-REL-PLACEHOLDER-PB-RECORD-RELEASE-FOO-5556B8149BF8BAC76BC30F50A8A2DD4C22C85F30-TEST"
|
1827
|
+
}
|
1828
|
+
]
|
1829
|
+
}
|
1830
|
+
},
|
1831
|
+
"matchingRules": {
|
1832
|
+
"$.body._links.pb:record-release[0].href": {
|
1833
|
+
"match": "regex",
|
1834
|
+
"regex": "http:\\/\\/.*"
|
1835
|
+
}
|
1836
|
+
}
|
1837
|
+
}
|
1838
|
+
},
|
1839
|
+
{
|
1840
|
+
"description": "a request to record a release",
|
1841
|
+
"providerState": "version 5556b8149bf8bac76bc30f50a8a2dd4c22c85f30 of pacticipant Foo exists with a test environment available for deployment",
|
1842
|
+
"request": {
|
1843
|
+
"method": "POST",
|
1844
|
+
"path": "/HAL-REL-PLACEHOLDER-PB-RECORD-RELEASE-FOO-5556B8149BF8BAC76BC30F50A8A2DD4C22C85F30-TEST",
|
1845
|
+
"headers": {
|
1846
|
+
"Content-Type": "application/json",
|
1847
|
+
"Accept": "application/hal+json"
|
1848
|
+
}
|
1849
|
+
},
|
1850
|
+
"response": {
|
1851
|
+
"status": 201,
|
1852
|
+
"headers": {
|
1853
|
+
"Content-Type": "application/hal+json;charset=utf-8"
|
1854
|
+
}
|
1855
|
+
}
|
1856
|
+
},
|
1857
|
+
{
|
1858
|
+
"description": "a request for an environment",
|
1859
|
+
"providerState": "an environment with name test and UUID 16926ef3-590f-4e3f-838e-719717aa88c9 exists",
|
1860
|
+
"request": {
|
1861
|
+
"method": "GET",
|
1862
|
+
"path": "/HAL-REL-PLACEHOLDER-PB-ENVIRONMENT-16926ef3-590f-4e3f-838e-719717aa88c9",
|
1863
|
+
"headers": {
|
1864
|
+
"Accept": "application/hal+json"
|
1865
|
+
}
|
1866
|
+
},
|
1867
|
+
"response": {
|
1868
|
+
"status": 200,
|
1869
|
+
"headers": {
|
1870
|
+
"Content-Type": "application/hal+json;charset=utf-8"
|
1871
|
+
},
|
1872
|
+
"body": {
|
1873
|
+
"_links": {
|
1874
|
+
"pb:currently-deployed-deployed-versions": {
|
1875
|
+
"href": "http://localhost:1234/PLACEHOLDER-ENVIRONMENT-CURRENTLY-DEPLOYED-16926ef3-590f-4e3f-838e-719717aa88c9"
|
1876
|
+
}
|
1877
|
+
}
|
1878
|
+
},
|
1879
|
+
"matchingRules": {
|
1880
|
+
"$.body._links.pb:currently-deployed-deployed-versions.href": {
|
1881
|
+
"match": "regex",
|
1882
|
+
"regex": "^http.*"
|
1883
|
+
}
|
1884
|
+
}
|
1885
|
+
}
|
1886
|
+
},
|
1887
|
+
{
|
1888
|
+
"description": "a request to list the versions deployed to an environment for a pacticipant name and target",
|
1889
|
+
"providerState": "an version is deployed to environment with UUID 16926ef3-590f-4e3f-838e-719717aa88c9 with target customer-1",
|
1890
|
+
"request": {
|
1891
|
+
"method": "GET",
|
1892
|
+
"path": "/PLACEHOLDER-ENVIRONMENT-CURRENTLY-DEPLOYED-16926ef3-590f-4e3f-838e-719717aa88c9",
|
1893
|
+
"query": "pacticipant=Foo",
|
1894
|
+
"headers": {
|
1895
|
+
"Accept": "application/hal+json"
|
1896
|
+
}
|
1897
|
+
},
|
1898
|
+
"response": {
|
1899
|
+
"status": 200,
|
1900
|
+
"headers": {
|
1901
|
+
"Content-Type": "application/hal+json;charset=utf-8"
|
1902
|
+
},
|
1903
|
+
"body": {
|
1904
|
+
"_embedded": {
|
1905
|
+
"deployedVersions": [
|
1906
|
+
{
|
1907
|
+
"target": "customer-1",
|
1908
|
+
"_links": {
|
1909
|
+
"self": {
|
1910
|
+
"href": "http://localhost:1234/PLACEHOLDER-DEPLOYED-VERSION-ff3adecf-cfc5-4653-a4e3-f1861092f8e0"
|
1911
|
+
}
|
1912
|
+
}
|
1913
|
+
}
|
1914
|
+
]
|
1915
|
+
}
|
1916
|
+
},
|
1917
|
+
"matchingRules": {
|
1918
|
+
"$.body._embedded.deployedVersions[0]._links.self.href": {
|
1919
|
+
"match": "regex",
|
1920
|
+
"regex": "^http"
|
1921
|
+
}
|
1922
|
+
}
|
1923
|
+
}
|
1924
|
+
},
|
1925
|
+
{
|
1926
|
+
"description": "a request to mark a deployed version as not currently deploye",
|
1927
|
+
"providerState": "a currently deployed version exists",
|
1928
|
+
"request": {
|
1929
|
+
"method": "PATCH",
|
1930
|
+
"path": "/PLACEHOLDER-DEPLOYED-VERSION-ff3adecf-cfc5-4653-a4e3-f1861092f8e0",
|
1931
|
+
"headers": {
|
1932
|
+
"Content-Type": "application/merge-patch+json"
|
1933
|
+
},
|
1934
|
+
"body": {
|
1935
|
+
"currentlyDeployed": false
|
1936
|
+
}
|
1937
|
+
},
|
1938
|
+
"response": {
|
1939
|
+
"status": 200,
|
1940
|
+
"headers": {
|
1941
|
+
"Content-Type": "application/hal+json;charset=utf-8"
|
1942
|
+
},
|
1943
|
+
"body": {
|
1944
|
+
"currentlyDeployed": false,
|
1945
|
+
"_embedded": {
|
1946
|
+
"version": {
|
1947
|
+
"number": "2"
|
1948
|
+
}
|
1949
|
+
}
|
1950
|
+
},
|
1951
|
+
"matchingRules": {
|
1952
|
+
"$.body._embedded.version.number": {
|
1953
|
+
"match": "type"
|
1954
|
+
}
|
1955
|
+
}
|
1956
|
+
}
|
1957
|
+
},
|
1641
1958
|
{
|
1642
1959
|
"description": "a request to create a webhook with a JSON body for a consumer and provider",
|
1643
1960
|
"providerState": "the 'Pricing Service' and 'Condor' already exist in the pact-broker",
|
@@ -1,9 +1,7 @@
|
|
1
1
|
require 'service_providers/pact_helper'
|
2
2
|
require 'pact_broker/client/deployments/record_deployment'
|
3
3
|
|
4
|
-
|
5
|
-
|
6
|
-
RSpec.describe "recording a deployment", pact: true, skip: !deployment_feature_on do
|
4
|
+
RSpec.describe "recording a deployment", pact: true do
|
7
5
|
include_context "pact broker"
|
8
6
|
include PactBrokerPactHelperMethods
|
9
7
|
|
@@ -1,9 +1,7 @@
|
|
1
1
|
require 'service_providers/pact_helper'
|
2
2
|
require 'pact_broker/client/deployments/record_deployment'
|
3
3
|
|
4
|
-
|
5
|
-
|
6
|
-
RSpec.describe "recording a release", pact: true, skip: !deployment_feature_on do
|
4
|
+
RSpec.describe "recording a release", pact: true do
|
7
5
|
include_context "pact broker"
|
8
6
|
include PactBrokerPactHelperMethods
|
9
7
|
|
@@ -1,9 +1,7 @@
|
|
1
1
|
require 'service_providers/pact_helper'
|
2
2
|
require 'pact_broker/client/deployments/record_undeployment'
|
3
3
|
|
4
|
-
|
5
|
-
|
6
|
-
RSpec.describe "recording an undeployment", pact: true, skip: !deployment_feature_on do
|
4
|
+
RSpec.describe "recording an undeployment", pact: true do
|
7
5
|
include_context "pact broker"
|
8
6
|
include PactBrokerPactHelperMethods
|
9
7
|
|
@@ -77,7 +75,7 @@ RSpec.describe "recording an undeployment", pact: true, skip: !deployment_featur
|
|
77
75
|
headers: pact_broker_response_headers,
|
78
76
|
body: {
|
79
77
|
_links: {
|
80
|
-
:'pb:currently-deployed-versions' => {
|
78
|
+
:'pb:currently-deployed-deployed-versions' => {
|
81
79
|
href: Pact.term( pact_broker.mock_service_base_url + currently_deployed_versions_placeholder_path, /^http.*/)
|
82
80
|
}
|
83
81
|
}
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
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.47.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Beth Skurrie
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-07-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: httparty
|
@@ -250,6 +250,7 @@ files:
|
|
250
250
|
- lib/pact_broker/client/cli/custom_thor.rb
|
251
251
|
- lib/pact_broker/client/cli/deployment_commands.rb
|
252
252
|
- lib/pact_broker/client/cli/environment_commands.rb
|
253
|
+
- lib/pact_broker/client/cli/matrix_commands.rb
|
253
254
|
- lib/pact_broker/client/cli/pacticipant_commands.rb
|
254
255
|
- lib/pact_broker/client/cli/record_deployment_long_desc.txt
|
255
256
|
- lib/pact_broker/client/cli/version_selector_options_parser.rb
|
@@ -306,6 +307,7 @@ files:
|
|
306
307
|
- lib/pact_broker/client/string_refinements.rb
|
307
308
|
- lib/pact_broker/client/tasks.rb
|
308
309
|
- lib/pact_broker/client/tasks/publication_task.rb
|
310
|
+
- lib/pact_broker/client/verification_required.rb
|
309
311
|
- lib/pact_broker/client/version.rb
|
310
312
|
- lib/pact_broker/client/versions.rb
|
311
313
|
- lib/pact_broker/client/versions/describe.rb
|
@@ -427,7 +429,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
427
429
|
- !ruby/object:Gem::Version
|
428
430
|
version: '0'
|
429
431
|
requirements: []
|
430
|
-
rubygems_version: 3.2.
|
432
|
+
rubygems_version: 3.2.24
|
431
433
|
signing_key:
|
432
434
|
specification_version: 4
|
433
435
|
summary: See description
|