pact_broker-client 1.43.0 → 1.47.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (67) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/test.yml +35 -0
  3. data/CHANGELOG.md +41 -0
  4. data/README.md +54 -54
  5. data/doc/pacts/markdown/Pact Broker Client - Pact Broker.md +127 -94
  6. data/doc/pacts/markdown/Pact Broker Client - Pactflow.md +94 -0
  7. data/doc/pacts/markdown/README.md +1 -0
  8. data/lib/pact_broker/client/base_command.rb +3 -0
  9. data/lib/pact_broker/client/can_i_deploy.rb +40 -5
  10. data/lib/pact_broker/client/cli/broker.rb +8 -190
  11. data/lib/pact_broker/client/cli/custom_thor.rb +0 -16
  12. data/lib/pact_broker/client/cli/deployment_commands.rb +94 -0
  13. data/lib/pact_broker/client/cli/matrix_commands.rb +93 -0
  14. data/lib/pact_broker/client/cli/pacticipant_commands.rb +9 -0
  15. data/lib/pact_broker/client/cli/webhook_commands.rb +122 -0
  16. data/lib/pact_broker/client/deployments.rb +4 -0
  17. data/lib/pact_broker/client/deployments/record_deployment.rb +38 -0
  18. data/lib/pact_broker/client/deployments/record_release.rb +99 -0
  19. data/lib/pact_broker/client/deployments/record_support_ended.rb +103 -0
  20. data/lib/pact_broker/client/deployments/record_undeployment.rb +127 -0
  21. data/lib/pact_broker/client/describe_text_formatter.rb +23 -0
  22. data/lib/pact_broker/client/environments.rb +6 -3
  23. data/lib/pact_broker/client/environments/describe_environment.rb +3 -13
  24. data/lib/pact_broker/client/hal/entity.rb +22 -4
  25. data/lib/pact_broker/client/hal/http_client.rb +3 -2
  26. data/lib/pact_broker/client/pacticipants.rb +3 -3
  27. data/lib/pact_broker/client/pacticipants/create.rb +2 -2
  28. data/lib/pact_broker/client/pacticipants/describe.rb +33 -0
  29. data/lib/pact_broker/client/verification_required.rb +32 -0
  30. data/lib/pact_broker/client/version.rb +1 -1
  31. data/lib/pact_broker/client/versions.rb +4 -1
  32. data/lib/pact_broker/client/versions/describe.rb +3 -1
  33. data/lib/pact_broker/client/versions/formatter.rb +3 -1
  34. data/lib/pact_broker/client/versions/json_formatter.rb +5 -3
  35. data/lib/pact_broker/client/versions/text_formatter.rb +3 -1
  36. data/lib/pact_broker/client/webhooks/create.rb +14 -8
  37. data/script/record-deployment.sh +1 -1
  38. data/script/record-deployments-and-releases.sh +16 -0
  39. data/script/record-undeployment.sh +1 -1
  40. data/script/webhook-commands.sh +12 -0
  41. data/spec/fixtures/approvals/can_i_deploy_failure_dry_run.approved.txt +7 -0
  42. data/spec/fixtures/approvals/can_i_deploy_success_dry_run.approved.txt +7 -0
  43. data/spec/fixtures/approvals/describe_pacticipant.approved.txt +2 -0
  44. data/spec/integration/describe_environment_spec.rb +31 -0
  45. data/spec/lib/pact_broker/client/can_i_deploy_spec.rb +62 -2
  46. data/spec/lib/pact_broker/client/cli/broker_can_i_deploy_spec.rb +15 -2
  47. data/spec/lib/pact_broker/client/cli/broker_run_webhook_commands_spec.rb +4 -2
  48. data/spec/lib/pact_broker/client/deployments/record_deployment_spec.rb +204 -0
  49. data/spec/lib/pact_broker/client/deployments/record_support_ended_spec.rb +208 -0
  50. data/spec/lib/pact_broker/client/deployments/record_undeployment_spec.rb +219 -0
  51. data/spec/pacts/pact_broker_client-pact_broker.json +140 -112
  52. data/spec/pacts/pact_broker_client-pactflow.json +118 -0
  53. data/spec/service_providers/pact_broker_client_register_repository_spec.rb +2 -2
  54. data/spec/service_providers/pact_helper.rb +15 -10
  55. data/spec/service_providers/pactflow_webhooks_create_spec.rb +86 -0
  56. data/spec/service_providers/publish_pacts_spec.rb +3 -1
  57. data/spec/service_providers/record_deployment_spec.rb +4 -28
  58. data/spec/service_providers/record_release_spec.rb +130 -0
  59. data/spec/service_providers/record_undeployment_spec.rb +164 -0
  60. data/spec/service_providers/webhooks_create_spec.rb +1 -1
  61. data/spec/spec_helper.rb +14 -2
  62. data/spec/support/shared_context.rb +2 -1
  63. data/tasks/pact.rake +21 -1
  64. metadata +39 -7
  65. data/lib/pact_broker/client/versions/record_deployment.rb +0 -85
  66. data/lib/pact_broker/client/versions/record_undeployment.rb +0 -102
  67. data/spec/lib/pact_broker/client/versions/record_deployment_spec.rb +0 -75
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 62d6345d206920c405cd04c6a3984ac2d3de6ebc687283eb22f3400f7e51e7fa
4
- data.tar.gz: 18e2425b5fb80db316beaf58977432316afe9a48cc508a619006c5e8a9ec59af
3
+ metadata.gz: e11ef51fde8e7435df8088fc6124dc9f13657169d24681de5b7288227bafb9d0
4
+ data.tar.gz: 49237a042f0d8bd8abdd2af393be5141a6f38a24315a10632120c2c9ea65e4ad
5
5
  SHA512:
6
- metadata.gz: 6ec0cca0de9787d4493143c2a2d9f9512df1b800c978a274a58b0b14a9d8fd7fc6c87609d2c3dd7f6916273c6600b9ec11a98dc47b8ac614aa71843f97c48378
7
- data.tar.gz: f0c96d94f6bcd765ac5ac20bbc4950f64b205555461bdc2ca0a7fcfbe5d57e704eea430a3ddf1b11e2b499a76d828a2fdb552b8ce5a03d56bb3b852378690a32
6
+ metadata.gz: 50437b1812663cbc7d31bbba98230ca8674a478a43b205e4293df7c8975d2553154a9a702b0af485b857ed621f0aa1c15f4dd1751dc3151447eca3d9d063cf19
7
+ data.tar.gz: f25ee6031ddeed56b680ea71ec7548bc483f2bda844b1d3f6a3c9e8f8f15a6accae0513052637f284157118c2c2dd2162131512efa6a39b69acbcfe49608a209
@@ -21,3 +21,38 @@ jobs:
21
21
  ruby-version: ${{ matrix.ruby_version }}
22
22
  - run: "bundle install"
23
23
  - run: "bundle exec rake"
24
+ pact:
25
+ runs-on: "ubuntu-latest"
26
+ continue-on-error: true
27
+ strategy:
28
+ fail-fast: false
29
+ matrix:
30
+ feature: ["", "publish_contracts"]
31
+ steps:
32
+ - uses: actions/checkout@v2
33
+ - uses: ruby/setup-ruby@v1
34
+ with:
35
+ ruby-version: "2.7"
36
+ - run: "bundle install"
37
+ - run: |
38
+ rm -rf spec/pacts/*
39
+ bundle exec rspec spec/service_providers/
40
+ bundle exec rake pact:publish:pactflow
41
+ env:
42
+ PACT_BROKER_TOKEN: ${{ secrets.PACTFLOW_PACT_OSS_TOKEN }}
43
+ PACT_BROKER_FEATURES: ${{ matrix.feature }}
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,44 @@
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
+
9
+ <a name="v1.46.0"></a>
10
+ ### v1.46.0 (2021-06-24)
11
+
12
+ #### Features
13
+
14
+ * support specifying team UUID when creating a webhook in Pactflow ([c4201e1](/../../commit/c4201e1))
15
+
16
+ <a name="v1.45.0"></a>
17
+ ### v1.45.0 (2021-06-16)
18
+
19
+ #### Features
20
+
21
+ * **can-i-deploy**
22
+ * allow dry-run to be enabled by setting ACT_BROKER_CAN_I_DEPLOY_DRY_RUN=true ([0562436](/../../commit/0562436))
23
+ * add --dry-run option ([9d90c79](/../../commit/9d90c79))
24
+
25
+ * add record-support-ended (feature toggled off) ([8f6b593](/../../commit/8f6b593))
26
+ * update record-undeployment (feature toggled off) ([0c0dd15](/../../commit/0c0dd15))
27
+ * update record-undeployment (feature toggled off) ([93046d5](/../../commit/93046d5))
28
+
29
+ <a name="v1.44.0"></a>
30
+ ### v1.44.0 (2021-06-09)
31
+
32
+ #### Features
33
+
34
+ * add record-undeployment (feature toggled off) ([951d334](/../../commit/951d334))
35
+ * add describe-environment command ([cd11ebb](/../../commit/cd11ebb))
36
+ * add record-release (feature toggled off) ([e32e4e5](/../../commit/e32e4e5))
37
+
38
+ #### Bug Fixes
39
+
40
+ * hardcode file requires Fixes: https://github.com/pact-foundation/pact_broker-client/issues/88 ([581f2fd](/../../commit/581f2fd))
41
+
1
42
  <a name="v1.43.0"></a>
2
43
  ### v1.43.0 (2021-06-03)
3
44
 
data/README.md CHANGED
@@ -78,49 +78,45 @@ Usage:
78
78
  pact-broker can-i-deploy -a, --pacticipant=PACTICIPANT -b, --broker-base-url=BROKER_BASE_URL
79
79
 
80
80
  Options:
81
- -a, --pacticipant=PACTICIPANT
81
+ -a, --pacticipant=PACTICIPANT
82
82
  # The pacticipant name. Use once for each pacticipant being checked.
83
- -e, [--version=VERSION]
83
+ -e, [--version=VERSION]
84
84
  # The pacticipant version. Must be entered after the --pacticipant that it relates to.
85
- [--ignore=IGNORE]
86
- # The pacticipant name to ignore. Use once for each pacticipant being ignored.
87
- A specific version can be ignored by also specifying a --version after the pacticipant name option.
88
- -l, [--latest=[TAG]]
89
- # Use the latest pacticipant version. Optionally specify a TAG to use the
85
+ [--ignore=IGNORE]
86
+ # The pacticipant name to ignore. Use once for each pacticipant being ignored.
87
+ A specific version can be ignored by also specifying a --version after the
88
+ pacticipant name option.
89
+ -l, [--latest=[TAG]]
90
+ # Use the latest pacticipant version. Optionally specify a TAG to use the
90
91
  latest version with the specified tag.
91
- [--to=TAG]
92
+ [--to=TAG]
92
93
  # This is too hard to explain in a short sentence. Look at the examples.
93
- -o, [--output=OUTPUT]
94
+ -o, [--output=OUTPUT]
94
95
  # json or table
95
-
96
+
96
97
  # Default: table
97
- [--retry-while-unknown=TIMES]
98
- # The number of times to retry while there is an unknown verification result
98
+ [--retry-while-unknown=TIMES]
99
+ # The number of times to retry while there is an unknown verification result
99
100
  (ie. the provider verification is likely still running)
100
-
101
+
101
102
  # Default: 0
102
- [--retry-interval=SECONDS]
103
+ [--retry-interval=SECONDS]
103
104
  # The time between retries in seconds. Use in conjuction with --retry-while-unknown
104
-
105
+
105
106
  # Default: 10
106
- -b, --broker-base-url=BROKER_BASE_URL
107
+ [--dry-run], [--no-dry-run]
108
+ # When enabled, always exits process with a success code. Can also be enabled by setting
109
+ the environment variable PACT_BROKER_CAN_I_DEPLOY_DRY_RUN=true.
110
+ -b, --broker-base-url=BROKER_BASE_URL
107
111
  # The base URL of the Pact Broker
108
- -u, [--broker-username=BROKER_USERNAME]
112
+ -u, [--broker-username=BROKER_USERNAME]
109
113
  # Pact Broker basic auth username
110
- -p, [--broker-password=BROKER_PASSWORD]
114
+ -p, [--broker-password=BROKER_PASSWORD]
111
115
  # Pact Broker basic auth password
112
- -k, [--broker-token=BROKER_TOKEN]
116
+ -k, [--broker-token=BROKER_TOKEN]
113
117
  # Pact Broker bearer token
114
- -v, [--verbose], [--no-verbose]
118
+ -v, [--verbose], [--no-verbose]
115
119
  # Verbose output. Default: false
116
-
117
- Description:
118
- Returns exit code 0 or 1, indicating whether or not the specified application (pacticipant) versions are
119
- compatible (ie. safe to deploy). Prints out the relevant pact/verification details, indicating any
120
- missing or failed verification results.
121
-
122
- The environment variables PACT_BROKER_BASE_URL, PACT_BROKER_USERNAME and PACT_BROKER_PASSWORD may be used
123
- instead of their respective command line options.
124
120
  ```
125
121
 
126
122
  Returns exit code 0 or 1, indicating whether or not the specified application (pacticipant) versions are compatible (ie. safe to deploy). Prints out the relevant pact/verification details, indicating any missing or failed verification results.
@@ -239,27 +235,19 @@ Usage:
239
235
 
240
236
  Options:
241
237
  -X, --request=METHOD
242
- # HTTP method
238
+ # Webhook HTTP method
243
239
  -H, [--header=one two three]
244
- # Header
240
+ # Webhook Header
245
241
  -d, [--data=DATA]
246
- # Data
242
+ # Webhook payload (file or string)
247
243
  -u, [--user=USER]
248
- # Basic auth username and password eg. username:password
244
+ # Webhook basic auth username and password eg. username:password
249
245
  [--consumer=CONSUMER]
250
246
  # Consumer name
251
247
  [--provider=PROVIDER]
252
248
  # Provider name
253
- -b, --broker-base-url=BROKER_BASE_URL
254
- # The base URL of the Pact Broker
255
- [--broker-username=BROKER_USERNAME]
256
- # Pact Broker basic auth username
257
- -p, [--broker-password=BROKER_PASSWORD]
258
- # Pact Broker basic auth password
259
- -k, [--broker-token=BROKER_TOKEN]
260
- # Pact Broker bearer token
261
249
  [--description=DESCRIPTION]
262
- # The description of the webhook
250
+ # Webhook description
263
251
  [--contract-content-changed], [--no-contract-content-changed]
264
252
  # Trigger this webhook when the pact content changes
265
253
  [--contract-published], [--no-contract-published]
@@ -270,6 +258,16 @@ Options:
270
258
  # Trigger this webhook when a failed provider verification result is published
271
259
  [--provider-verification-succeeded], [--no-provider-verification-succeeded]
272
260
  # Trigger this webhook when a successful provider verification result is published
261
+ [--team-uuid=UUID]
262
+ # UUID of the Pactflow team to which the webhook should be assigned (Pactflow only)
263
+ -b, --broker-base-url=BROKER_BASE_URL
264
+ # The base URL of the Pact Broker
265
+ -u, [--broker-username=BROKER_USERNAME]
266
+ # Pact Broker basic auth username
267
+ -p, [--broker-password=BROKER_PASSWORD]
268
+ # Pact Broker basic auth password
269
+ -k, [--broker-token=BROKER_TOKEN]
270
+ # Pact Broker bearer token
273
271
  -v, [--verbose], [--no-verbose]
274
272
  # Verbose output. Default: false
275
273
 
@@ -287,27 +285,19 @@ Usage:
287
285
 
288
286
  Options:
289
287
  -X, --request=METHOD
290
- # HTTP method
288
+ # Webhook HTTP method
291
289
  -H, [--header=one two three]
292
- # Header
290
+ # Webhook Header
293
291
  -d, [--data=DATA]
294
- # Data
292
+ # Webhook payload (file or string)
295
293
  -u, [--user=USER]
296
- # Basic auth username and password eg. username:password
294
+ # Webhook basic auth username and password eg. username:password
297
295
  [--consumer=CONSUMER]
298
296
  # Consumer name
299
297
  [--provider=PROVIDER]
300
298
  # Provider name
301
- -b, --broker-base-url=BROKER_BASE_URL
302
- # The base URL of the Pact Broker
303
- [--broker-username=BROKER_USERNAME]
304
- # Pact Broker basic auth username
305
- -p, [--broker-password=BROKER_PASSWORD]
306
- # Pact Broker basic auth password
307
- -k, [--broker-token=BROKER_TOKEN]
308
- # Pact Broker bearer token
309
299
  [--description=DESCRIPTION]
310
- # The description of the webhook
300
+ # Webhook description
311
301
  [--contract-content-changed], [--no-contract-content-changed]
312
302
  # Trigger this webhook when the pact content changes
313
303
  [--contract-published], [--no-contract-published]
@@ -318,6 +308,16 @@ Options:
318
308
  # Trigger this webhook when a failed provider verification result is published
319
309
  [--provider-verification-succeeded], [--no-provider-verification-succeeded]
320
310
  # Trigger this webhook when a successful provider verification result is published
311
+ [--team-uuid=UUID]
312
+ # UUID of the Pactflow team to which the webhook should be assigned (Pactflow only)
313
+ -b, --broker-base-url=BROKER_BASE_URL
314
+ # The base URL of the Pact Broker
315
+ -u, [--broker-username=BROKER_USERNAME]
316
+ # Pact Broker basic auth username
317
+ -p, [--broker-password=BROKER_PASSWORD]
318
+ # Pact Broker basic auth password
319
+ -k, [--broker-token=BROKER_TOKEN]
320
+ # Pact Broker bearer token
321
321
  -v, [--verbose], [--no-verbose]
322
322
  # Verbose output. Default: false
323
323
  --uuid=UUID
@@ -6,7 +6,9 @@
6
6
 
7
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
8
 
9
- * [A request for a pacticipant version](#a_request_for_a_pacticipant_version_given_version_5556b8149bf8bac76bc30f50a8a2dd4c22c85f30_of_pacticipant_Foo_does_not_exist) given version 5556b8149bf8bac76bc30f50a8a2dd4c22c85f30 of pacticipant Foo does not exist
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
10
12
 
11
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)
12
14
 
@@ -40,8 +42,6 @@
40
42
 
41
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
42
44
 
43
- * [A request for the index resource](#a_request_for_the_index_resource_given_the_pb:publish-contracts_relations_exists_in_the_index_resource) given the pb:publish-contracts relations exists in the index resource
44
-
45
45
  * [A request for the index resource with the webhook relation](#a_request_for_the_index_resource_with_the_webhook_relation)
46
46
 
47
47
  * [A request for the list of the latest pacts from all consumers for the Pricing Service'](#a_request_for_the_list_of_the_latest_pacts_from_all_consumers_for_the_Pricing_Service&#39;_given_a_latest_pact_between_Condor_and_the_Pricing_Service_exists) given a latest pact between Condor and the Pricing Service exists
@@ -86,6 +86,10 @@
86
86
 
87
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
88
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
+
89
93
  * [A request to publish a pact](#a_request_to_publish_a_pact_given_&#39;Condor&#39;_already_exist_in_the_pact-broker,_but_the_&#39;Pricing_Service&#39;_does_not) given 'Condor' already exist in the pact-broker, but the 'Pricing Service' does not
90
94
 
91
95
  * [A request to publish a pact](#a_request_to_publish_a_pact_given_the_&#39;Pricing_Service&#39;_already_exists_in_the_pact-broker) given the 'Pricing Service' already exists in the pact-broker
@@ -96,10 +100,10 @@
96
100
 
97
101
  * [A request to publish a pact with method put](#a_request_to_publish_a_pact_with_method_put_given_the_&#39;Pricing_Service&#39;_and_&#39;Condor&#39;_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
98
102
 
99
- * [A request to publish contracts](#a_request_to_publish_contracts)
100
-
101
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
102
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
+
103
107
  * [A request to register the repository URL of a pacticipant](#a_request_to_register_the_repository_URL_of_a_pacticipant_given_the_&#39;Pricing_Service&#39;_already_exists_in_the_pact-broker) given the 'Pricing Service' already exists in the pact-broker
104
108
 
105
109
  * [A request to register the repository URL of a pacticipant](#a_request_to_register_the_repository_URL_of_a_pacticipant_given_the_&#39;Pricing_Service&#39;_does_not_exist_in_the_pact-broker) given the 'Pricing Service' does not exist in the pact-broker
@@ -196,8 +200,8 @@ Pact Broker will respond with:
196
200
  }
197
201
  }
198
202
  ```
199
- <a name="a_request_for_a_pacticipant_version_given_version_5556b8149bf8bac76bc30f50a8a2dd4c22c85f30_of_pacticipant_Foo_does_not_exist"></a>
200
- Given **version 5556b8149bf8bac76bc30f50a8a2dd4c22c85f30 of pacticipant Foo does not exist**, upon receiving **a request for a pacticipant version** from Pact Broker Client, with
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
201
205
  ```json
202
206
  {
203
207
  "method": "GET",
@@ -210,7 +214,47 @@ Given **version 5556b8149bf8bac76bc30f50a8a2dd4c22c85f30 of pacticipant Foo does
210
214
  Pact Broker will respond with:
211
215
  ```json
212
216
  {
213
- "status": 404
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
+ }
214
258
  }
215
259
  ```
216
260
  <a name="a_request_for_the_compatibility_matrix_for_a_pacticipant_that_does_not_exist"></a>
@@ -838,33 +882,6 @@ Pact Broker will respond with:
838
882
  }
839
883
  }
840
884
  ```
841
- <a name="a_request_for_the_index_resource_given_the_pb:publish-contracts_relations_exists_in_the_index_resource"></a>
842
- Given **the pb:publish-contracts relations exists in the index resource**, upon receiving **a request for the index resource** from Pact Broker Client, with
843
- ```json
844
- {
845
- "method": "GET",
846
- "path": "/",
847
- "headers": {
848
- "Accept": "application/hal+json"
849
- }
850
- }
851
- ```
852
- Pact Broker will respond with:
853
- ```json
854
- {
855
- "status": 200,
856
- "headers": {
857
- "Content-Type": "application/hal+json;charset=utf-8"
858
- },
859
- "body": {
860
- "_links": {
861
- "pb:publish-contracts": {
862
- "href": "http://localhost:1234/HAL-REL-PLACEHOLDER-PB-PUBLISH-CONTRACTS"
863
- }
864
- }
865
- }
866
- }
867
- ```
868
885
  <a name="a_request_for_the_index_resource_with_the_webhook_relation"></a>
869
886
  Upon receiving **a request for the index resource with the webhook relation** from Pact Broker Client, with
870
887
  ```json
@@ -1850,6 +1867,72 @@ Pact Broker will respond with:
1850
1867
  }
1851
1868
  }
1852
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
+ ```
1853
1936
  <a name="a_request_to_publish_a_pact_given_&#39;Condor&#39;_already_exist_in_the_pact-broker,_but_the_&#39;Pricing_Service&#39;_does_not"></a>
1854
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
1855
1938
  ```json
@@ -2038,88 +2121,42 @@ Pact Broker will respond with:
2038
2121
  }
2039
2122
  }
2040
2123
  ```
2041
- <a name="a_request_to_publish_contracts"></a>
2042
- Upon receiving **a request to publish contracts** from Pact Broker Client, with
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
2043
2126
  ```json
2044
2127
  {
2045
2128
  "method": "POST",
2046
- "path": "/HAL-REL-PLACEHOLDER-PB-PUBLISH-CONTRACTS",
2129
+ "path": "/HAL-REL-PLACEHOLDER-PB-RECORD-DEPLOYMENT-FOO-5556B8149BF8BAC76BC30F50A8A2DD4C22C85F30-TEST",
2047
2130
  "headers": {
2048
2131
  "Content-Type": "application/json",
2049
2132
  "Accept": "application/hal+json"
2050
2133
  },
2051
2134
  "body": {
2052
- "pacticipantName": "Foo",
2053
- "pacticipantVersionNumber": "5556b8149bf8bac76bc30f50a8a2dd4c22c85f30",
2054
- "branch": "main",
2055
- "tags": [
2056
- "dev"
2057
- ],
2058
- "buildUrl": "http://build",
2059
- "contracts": [
2060
- {
2061
- "consumerName": "Foo",
2062
- "providerName": "Bar",
2063
- "specification": "pact",
2064
- "contentType": "application/json",
2065
- "content": "eyJjb25zdW1lciI6eyJuYW1lIjoiRm9vIn0sInByb3ZpZGVyIjp7Im5hbWUiOiJCYXIifSwiaW50ZXJhY3Rpb25zIjpbeyJkZXNjcmlwdGlvbiI6ImFuIGV4YW1wbGUgcmVxdWVzdCIsInByb3ZpZGVyU3RhdGUiOiJhIHByb3ZpZGVyIHN0YXRlIiwicmVxdWVzdCI6eyJtZXRob2QiOiJHRVQiLCJwYXRoIjoiLyIsImhlYWRlcnMiOnt9fSwicmVzcG9uc2UiOnsic3RhdHVzIjoyMDAsImhlYWRlcnMiOnsiQ29udGVudC1UeXBlIjoiYXBwbGljYXRpb24vaGFsK2pzb24ifX19XSwibWV0YWRhdGEiOnsicGFjdFNwZWNpZmljYXRpb24iOnsidmVyc2lvbiI6IjIuMC4wIn19fQ==",
2066
- "writeMode": "overwrite",
2067
- "onConflict": "overwrite"
2068
- }
2069
- ]
2135
+ "target": "blue"
2070
2136
  }
2071
2137
  }
2072
2138
  ```
2073
2139
  Pact Broker will respond with:
2074
2140
  ```json
2075
2141
  {
2076
- "status": 200,
2142
+ "status": 201,
2077
2143
  "headers": {
2078
2144
  "Content-Type": "application/hal+json;charset=utf-8"
2079
2145
  },
2080
2146
  "body": {
2081
- "_embedded": {
2082
- "pacticipant": {
2083
- "name": "Foo"
2084
- },
2085
- "version": {
2086
- "number": "5556b8149bf8bac76bc30f50a8a2dd4c22c85f30",
2087
- "buildUrl": "http://build"
2088
- }
2089
- },
2090
- "logs": [
2091
- {
2092
- "level": "info",
2093
- "message": "some message"
2094
- }
2095
- ],
2096
- "_links": {
2097
- "pb:pacticipant-version-tags": [
2098
- {
2099
- "name": "dev"
2100
- }
2101
- ],
2102
- "pb:contracts": [
2103
- {
2104
- "href": "http://some-pact"
2105
- }
2106
- ]
2107
- }
2147
+ "target": "blue"
2108
2148
  }
2109
2149
  }
2110
2150
  ```
2111
- <a name="a_request_to_record_a_deployment_given_version_5556b8149bf8bac76bc30f50a8a2dd4c22c85f30_of_pacticipant_Foo_exists_with_a_test_environment_available_for_deployment"></a>
2112
- 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
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
2113
2153
  ```json
2114
2154
  {
2115
2155
  "method": "POST",
2116
- "path": "/HAL-REL-PLACEHOLDER-PB-RECORD-DEPLOYMENT-FOO-5556B8149BF8BAC76BC30F50A8A2DD4C22C85F30-TEST",
2156
+ "path": "/HAL-REL-PLACEHOLDER-PB-RECORD-RELEASE-FOO-5556B8149BF8BAC76BC30F50A8A2DD4C22C85F30-TEST",
2117
2157
  "headers": {
2118
2158
  "Content-Type": "application/json",
2119
2159
  "Accept": "application/hal+json"
2120
- },
2121
- "body": {
2122
- "target": "blue"
2123
2160
  }
2124
2161
  }
2125
2162
  ```
@@ -2129,9 +2166,6 @@ Pact Broker will respond with:
2129
2166
  "status": 201,
2130
2167
  "headers": {
2131
2168
  "Content-Type": "application/hal+json;charset=utf-8"
2132
- },
2133
- "body": {
2134
- "target": "blue"
2135
2169
  }
2136
2170
  }
2137
2171
  ```
@@ -2545,7 +2579,6 @@ Given **the 'Pricing Service' and 'Condor' already exist in the pact-broker**, u
2545
2579
  }
2546
2580
  ],
2547
2581
  "request": {
2548
- "url": null,
2549
2582
  "method": "POST",
2550
2583
  "headers": {
2551
2584
  "Foo": "bar",