pact_broker 2.99.0 → 2.102.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +50 -0
- data/Gemfile +1 -0
- data/README.md +14 -4
- data/db/migrations/20220622_default_allow_dangerous_contract_modification_to_false_for_new_installations.rb +22 -0
- data/db/migrations/20220625_delete_pacticipants_with_no_name.rb +62 -0
- data/db/migrations/migration_helper.rb +6 -0
- data/docs/CONFIGURATION.md +3 -1
- data/docs/api/PACTICIPANTS.md +290 -0
- data/docs/api/WEBHOOKS.md +40 -40
- data/lib/pact_broker/api/contracts/pacticipant_create_schema.rb +28 -0
- data/lib/pact_broker/api/decorators/embedded_version_decorator.rb +0 -1
- data/lib/pact_broker/api/decorators/reason_decorator.rb +1 -15
- data/lib/pact_broker/api/decorators/triggered_webhook_decorator.rb +1 -2
- data/lib/pact_broker/api/resources/all_webhooks.rb +1 -4
- data/lib/pact_broker/api/resources/base_resource.rb +58 -5
- data/lib/pact_broker/api/resources/branch_version.rb +10 -1
- data/lib/pact_broker/api/resources/clean.rb +11 -9
- data/lib/pact_broker/api/resources/currently_deployed_versions_for_environment.rb +0 -4
- data/lib/pact_broker/api/resources/currently_supported_versions_for_environment.rb +0 -4
- data/lib/pact_broker/api/resources/deployed_version.rb +20 -16
- data/lib/pact_broker/api/resources/deployed_versions_for_version_and_environment.rb +1 -1
- data/lib/pact_broker/api/resources/environment.rb +5 -5
- data/lib/pact_broker/api/resources/environments.rb +1 -5
- data/lib/pact_broker/api/resources/label.rb +4 -0
- data/lib/pact_broker/api/resources/matrix_for_consumer_and_provider.rb +10 -0
- data/lib/pact_broker/api/resources/pact.rb +14 -5
- data/lib/pact_broker/api/resources/pact_webhooks.rb +1 -4
- data/lib/pact_broker/api/resources/pacticipant.rb +11 -5
- data/lib/pact_broker/api/resources/pacticipant_resource_methods.rb +0 -1
- data/lib/pact_broker/api/resources/pacticipant_webhooks.rb +1 -4
- data/lib/pact_broker/api/resources/pacticipants.rb +7 -6
- data/lib/pact_broker/api/resources/provider_pacts_for_verification.rb +19 -11
- data/lib/pact_broker/api/resources/publish_contracts.rb +12 -16
- data/lib/pact_broker/api/resources/released_version.rb +20 -8
- data/lib/pact_broker/api/resources/released_versions_for_version_and_environment.rb +11 -7
- data/lib/pact_broker/api/resources/tag.rb +7 -3
- data/lib/pact_broker/api/resources/verifications.rb +7 -9
- data/lib/pact_broker/api/resources/version.rb +8 -8
- data/lib/pact_broker/api/resources/webhook.rb +5 -4
- data/lib/pact_broker/api/resources/webhook_execution.rb +4 -6
- data/lib/pact_broker/config/runtime_configuration.rb +1 -1
- data/lib/pact_broker/contracts/contract_to_publish.rb +4 -0
- data/lib/pact_broker/contracts/contracts_to_publish.rb +4 -0
- data/lib/pact_broker/contracts/service.rb +23 -5
- data/lib/pact_broker/doc/views/index/pacticipant-branch-version.markdown +13 -2
- data/lib/pact_broker/doc/views/provider-pacts-for-verification.markdown +1 -1
- data/lib/pact_broker/domain/pacticipant.rb +1 -0
- data/lib/pact_broker/domain/tag.rb +8 -32
- data/lib/pact_broker/domain/verification.rb +3 -2
- data/lib/pact_broker/domain/version.rb +26 -10
- data/lib/pact_broker/locale/en.yml +8 -4
- data/lib/pact_broker/matrix/deployment_status_summary.rb +28 -19
- data/lib/pact_broker/matrix/parse_query.rb +5 -0
- data/lib/pact_broker/matrix/quick_row.rb +5 -2
- data/lib/pact_broker/matrix/repository.rb +3 -3
- data/lib/pact_broker/matrix/resolved_selector.rb +47 -10
- data/lib/pact_broker/matrix/service.rb +17 -7
- data/lib/pact_broker/matrix/unresolved_selector.rb +14 -2
- data/lib/pact_broker/messages.rb +0 -15
- data/lib/pact_broker/pacticipants/find_potential_duplicate_pacticipant_names.rb +3 -3
- data/lib/pact_broker/pacticipants/repository.rb +5 -4
- data/lib/pact_broker/pacticipants/service.rb +11 -1
- data/lib/pact_broker/pacts/generate_sha.rb +1 -0
- data/lib/pact_broker/pacts/pact_version.rb +1 -0
- data/lib/pact_broker/pacts/verifiable_pact_messages.rb +4 -2
- data/lib/pact_broker/repositories/helpers.rb +13 -0
- data/lib/pact_broker/string_refinements.rb +8 -0
- data/lib/pact_broker/test/http_test_data_builder.rb +15 -0
- data/lib/pact_broker/test/test_data_builder.rb +20 -0
- data/lib/pact_broker/ui/controllers/index.rb +3 -1
- data/lib/pact_broker/ui/views/index/show.haml +3 -4
- data/lib/pact_broker/ui/views/matrix/show.haml +5 -2
- data/lib/pact_broker/verifications/pact_version_provider_tag_successful_verification.rb +15 -0
- data/lib/pact_broker/version.rb +1 -1
- data/lib/pact_broker/versions/branch_service.rb +7 -0
- data/lib/pact_broker/versions/branch_version_repository.rb +17 -0
- data/lib/pact_broker/webhooks/pact_and_verification_parameters.rb +1 -1
- data/lib/rack/pact_broker/cascade.rb +87 -0
- data/lib/webmachine/describe_routes.rb +43 -9
- metadata +8 -5
- data/lib/db.rb +0 -79
- data/lib/pact_broker/api/resources/default_base_resource.rb +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 398f65fe7258fe0826026394bf3066bce3bfcda2662d460a0aa971e642310b16
|
4
|
+
data.tar.gz: f0e2c8c038763a814075d8a1090b3dc6886ccc8cef823a75acfa1e372378f770
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0d24a6f1cd9d2b82f237e3bd56412e73da07cd6e37b9a229fb36996a2994dafae9f8a7ec45fbd158f512e244df0403a5fa80f0edf8aae59e1b4fbf4423f9cef6
|
7
|
+
data.tar.gz: b2f0bd7cdae4c7551ab6b3e28ec339d809ea98907c3dc0d1a824f054cfefef8592379d758ac3e679b0e509fffdd774cab104d882647b89fe0762e998873eb3a0
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,53 @@
|
|
1
|
+
<a name="v2.102.0"></a>
|
2
|
+
### v2.102.0 (2022-07-07)
|
3
|
+
|
4
|
+
#### Features
|
5
|
+
|
6
|
+
* default allow_dangerous_contract_modification to false for new installations ([85a89951](/../../commit/85a89951))
|
7
|
+
|
8
|
+
#### Bug Fixes
|
9
|
+
|
10
|
+
* add missing provider version branch parameter to webhook requests ([262dae44](/../../commit/262dae44))
|
11
|
+
* clean up pacticipants with no names ([0aff250d](/../../commit/0aff250d))
|
12
|
+
* update string refinements with blank? and present? ([8373f88f](/../../commit/8373f88f))
|
13
|
+
* update validation for creating pacticipants to return a 400 when name is missing ([fcb02aa6](/../../commit/fcb02aa6))
|
14
|
+
|
15
|
+
<a name="v2.101.0"></a>
|
16
|
+
### v2.101.0 (2022-06-07)
|
17
|
+
|
18
|
+
#### Features
|
19
|
+
|
20
|
+
* recalculate the branch head if the deleted branch version was the latest for the branch ([db51d4fe](/../../commit/db51d4fe))
|
21
|
+
* support deleting branch versions (removing a version from a branch) ([661667b3](/../../commit/661667b3))
|
22
|
+
* improve error message when request has non UTF-8 characters (#559) ([3addc0c8](/../../commit/3addc0c8))
|
23
|
+
|
24
|
+
#### Bug Fixes
|
25
|
+
|
26
|
+
* add missing environment policy record for use when recording deployments ([09bb02a6](/../../commit/09bb02a6))
|
27
|
+
* fix bug where pacticipant with blank name was being created instead of updating existing record ([be24a8ad](/../../commit/be24a8ad))
|
28
|
+
* ensure pacticipant name is retained when updating with PUT ([eeac47c3](/../../commit/eeac47c3))
|
29
|
+
|
30
|
+
<a name="v2.100.0"></a>
|
31
|
+
### v2.100.0 (2022-05-20)
|
32
|
+
|
33
|
+
#### Features
|
34
|
+
|
35
|
+
* check for potential duplicate pacticipants in publish contracts endpoint (#558) ([ed714f03](/../../commit/ed714f03))
|
36
|
+
* add support for "can i merge" matrix query ([bb108ed2](/../../commit/bb108ed2))
|
37
|
+
* remove inefficient skynet query for tags ([bdc2599c](/../../commit/bdc2599c))
|
38
|
+
* update text for matrix version description when no version is in an enviroment ([3eb5581d](/../../commit/3eb5581d))
|
39
|
+
|
40
|
+
* **pacts for verification**
|
41
|
+
* update wip and pending descriptions for wip pacts ([b06d4477](/../../commit/b06d4477))
|
42
|
+
|
43
|
+
* **matrix**
|
44
|
+
* add support for selectors specified by branch and environment name when reporting that a version does not exist ([07ff8044](/../../commit/07ff8044))
|
45
|
+
|
46
|
+
#### Bug Fixes
|
47
|
+
|
48
|
+
* **matrix**
|
49
|
+
* identify the correct failed version when a selector resolves to multiple versions ([11e7dc1c](/../../commit/11e7dc1c))
|
50
|
+
|
1
51
|
<a name="v2.99.0"></a>
|
2
52
|
### v2.99.0 (2022-05-13)
|
3
53
|
|
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -114,7 +114,17 @@ Use the HAL browser to view documentation as you browse.
|
|
114
114
|
|
115
115
|
### To have a play around on your local machine
|
116
116
|
|
117
|
-
|
117
|
+
#### Using Docker Compose
|
118
|
+
|
119
|
+
Download a copy of the [example Docker Compose file](https://github.com/pact-foundation/pact-broker-docker/blob/master/docker-compose.yml) from the Pact Broker Docker repository and run:
|
120
|
+
|
121
|
+
`docker compose up`
|
122
|
+
|
123
|
+
Then open a browser at [http://localhost:9292](http://localhost:9292).
|
124
|
+
|
125
|
+
#### Using Ruby
|
126
|
+
|
127
|
+
* Install Ruby 2.7 and Bundler (check the automated tests to find the most recent version of Ruby and Bundler that are supported)
|
118
128
|
* Windows users: get a Rails/Ruby installer from [RailsInstaller](http://railsinstaller.org/) and run it
|
119
129
|
* unix users just use your package manager
|
120
130
|
* Run `git clone git@github.com:pact-foundation/pact_broker.git && cd pact_broker/example`
|
@@ -144,8 +154,8 @@ You can use the [Pact Broker Docker image][docker] or [Terraform on AWS][terrafo
|
|
144
154
|
* To ensure you're on a supported version of the database that you choose, check the [travis.yml][travisyml] file to see which versions we're currently running our tests against.
|
145
155
|
* 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).
|
146
156
|
* 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).
|
147
|
-
* Install ruby 2.7
|
148
|
-
* Copy the [pact\_broker](https://github.com/DiUS/pact_broker-docker/tree/master/pact_broker) directory from the Pact Broker Docker project. This will have the recommended settings for database connections, logging, basic auth etc. Note that the Docker image uses Phusion Passenger as the web application server in front of the Pact Broker Ruby application, which is the recommended set up.
|
157
|
+
* 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?)
|
158
|
+
* Copy the [pact\_broker](https://github.com/DiUS/pact_broker-docker/tree/master/pact_broker) directory from the Pact Broker Docker project. This will have the recommended settings for database connections, logging, basic auth etc. Note that the Docker image uses Phusion Passenger as the web application server in front of the Pact Broker Ruby application, which is the recommended set up if you are not using a containerized solution.
|
149
159
|
* Modify the config.ru and Gemfile as desired (eg. choose database driver gem, set your database credentials. Use the "pg" gem for Postgres)
|
150
160
|
* example Sequel configuration for postgres `{ adapter: "postgres", database: "pact_broker", username: 'pact_broker', password: 'pact_broker', :encoding => 'utf8' }`
|
151
161
|
* Please ensure you use `encoding: 'utf8'` in your Sequel options to avoid encoding issues.
|
@@ -169,7 +179,7 @@ The Pact Broker follows the [semantic versioning](https://semver.org/) scheme.
|
|
169
179
|
[terraform]: https://github.com/nadnerb/terraform-pact-broker
|
170
180
|
[pactflow]: https://pactflow.io/?utm_source=github&utm_campaign=pact_broker_usage
|
171
181
|
[wiki]: https://github.com/pact-foundation/pact_broker/wiki
|
172
|
-
[reverse-proxy-docs]: https://
|
182
|
+
[reverse-proxy-docs]: https://docs.pact.io/pact_broker/configuration/features#running-the-broker-behind-a-reverse-proxy
|
173
183
|
[stackoverflow]: http://stackoverflow.com/questions/tagged/pact-broker
|
174
184
|
[twitter]: https://twitter.com/pact_up
|
175
185
|
[slack]: https://slack.pact.io/
|
@@ -0,0 +1,22 @@
|
|
1
|
+
require_relative "migration_helper"
|
2
|
+
include PactBroker::MigrationHelper
|
3
|
+
|
4
|
+
Sequel.migration do
|
5
|
+
up do
|
6
|
+
# Need to do this again because didn't actually set default of allow_dangerous_contract_modification to true
|
7
|
+
# when the first migration was run in db/migrations/20210810_set_allow_contract_modification.rb
|
8
|
+
for_upgrades_of_existing_installations do
|
9
|
+
from(:config).insert_ignore.insert(
|
10
|
+
name: "allow_dangerous_contract_modification",
|
11
|
+
type: "boolean",
|
12
|
+
value: "1",
|
13
|
+
created_at: Sequel.datetime_class.now,
|
14
|
+
updated_at: Sequel.datetime_class.now
|
15
|
+
)
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
down do
|
20
|
+
|
21
|
+
end
|
22
|
+
end
|
@@ -0,0 +1,62 @@
|
|
1
|
+
# There was a bug that caused a duplicate pacticipant to be created
|
2
|
+
# with a null name when updating the pacticipant in a certain way.
|
3
|
+
# It was fixed in be24a8ad650f0ed49993283b22ba1d1a744fb3e8.
|
4
|
+
# This migration deletes any pacticipants with null names that are not referenced by any other rows,
|
5
|
+
# or assigns a name if the pacticipant is referenced so that it can be deleted through the API
|
6
|
+
# (I can't think of a reason why a pacticipant with a null name should be referenced, but better to be safe than sorry).
|
7
|
+
# The "find tables that reference pacticipants" logic is done dynamically because Pactflow has extra tables not in the OSS.
|
8
|
+
|
9
|
+
# Query each table that references the pacticipants table to determine
|
10
|
+
# if there are any rows in it that reference the pacticipant with the specified ID.
|
11
|
+
# @return [Boolean]
|
12
|
+
def pacticipant_is_unreferenced(pacticipant_id, table_foreign_keys)
|
13
|
+
table_foreign_keys.any? do | (table_name, foreign_keys) |
|
14
|
+
criteria = foreign_keys.flat_map do | fk |
|
15
|
+
fk[:columns].collect do | column_name |
|
16
|
+
{ column_name => pacticipant_id }
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
# SELECT 'one' FROM xxx where consumer_id = x or provider_id = x LIMIT 1
|
21
|
+
!from(table_name).where(Sequel.|(*criteria)).empty?
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
# Return a structure describing the tables and columns that reference the pacticipants table.
|
26
|
+
# @return [Array] eg. [ [:integrations, [ { columns: [:consumer_id] }, { columns: [:provider_id] } ] ] ]
|
27
|
+
def get_table_foreign_keys
|
28
|
+
table_foreign_keys = tables.sort.collect do | table_name |
|
29
|
+
key_list = foreign_key_list(table_name).select{ |fk| fk[:table] == :pacticipants }
|
30
|
+
if key_list.any?
|
31
|
+
[ table_name, key_list]
|
32
|
+
end
|
33
|
+
end.compact
|
34
|
+
|
35
|
+
# move the integrations table check first because that's the most likely candidate to have a referencing row
|
36
|
+
table_foreign_keys.select{ |(table_name, _)| table_name == :integrations } | table_foreign_keys
|
37
|
+
end
|
38
|
+
|
39
|
+
# Deletes the pacticipant if it is unreferenced, or populates the name so it can
|
40
|
+
# be deleted through the API.
|
41
|
+
def delete_pacticipant_or_populate_name(row, table_foreign_keys)
|
42
|
+
if pacticipant_is_unreferenced(row[:id], table_foreign_keys)
|
43
|
+
from(:pacticipants).where(id: row[:id]).delete
|
44
|
+
else
|
45
|
+
from(:pacticipants).where(id: row[:id]).update(name: "Delete me #{row[:id]}")
|
46
|
+
end
|
47
|
+
end
|
48
|
+
|
49
|
+
Sequel.migration do
|
50
|
+
up do
|
51
|
+
|
52
|
+
table_foreign_keys = get_table_foreign_keys
|
53
|
+
|
54
|
+
from(:pacticipants).where(name: nil).all.each do | row |
|
55
|
+
delete_pacticipant_or_populate_name(row, table_foreign_keys)
|
56
|
+
end
|
57
|
+
end
|
58
|
+
|
59
|
+
down do
|
60
|
+
|
61
|
+
end
|
62
|
+
end
|
data/docs/CONFIGURATION.md
CHANGED
@@ -648,10 +648,12 @@ Whether or not to allow the pact content for an existing consumer version to be
|
|
648
648
|
as allowing modification makes the results of can-i-deploy unreliable. When this is set to false as recommended, each commit must publish pacts
|
649
649
|
with a unique version number.
|
650
650
|
|
651
|
+
If modification of an existing contract is attempted when the value is set to `false`, an HTTP 409 status will be returned.
|
652
|
+
|
651
653
|
**Supported versions:** From v2.82.0<br/>
|
652
654
|
**Environment variable name:** `PACT_BROKER_ALLOW_DANGEROUS_CONTRACT_MODIFICATION`<br/>
|
653
655
|
**YAML configuration key name:** `allow_dangerous_contract_modification`<br/>
|
654
|
-
**Default:** For new installations of v2.
|
656
|
+
**Default:** For new installations of v2.102 and later, this defaults to `false` (the recommended value). Previous installations will have the default value of `true` (not recommended).<br/>
|
655
657
|
**Allowed values:** `true`, `false`<br/>
|
656
658
|
**More information:** https://docs.pact.io/versioning<br/>
|
657
659
|
|
@@ -0,0 +1,290 @@
|
|
1
|
+
|
2
|
+
# Pacticipants
|
3
|
+
|
4
|
+
|
5
|
+
## Pacticipant
|
6
|
+
|
7
|
+
Path: `/pacticipants/:pacticipant_name`<br/>
|
8
|
+
Allowed methods: `GET`, `PUT`, `PATCH`, `DELETE`<br/>
|
9
|
+
|
10
|
+
### GET
|
11
|
+
|
12
|
+
#### Request
|
13
|
+
|
14
|
+
Headers: `{"Accept":"application/hal+json"}`<br/>
|
15
|
+
|
16
|
+
|
17
|
+
#### Response
|
18
|
+
|
19
|
+
Status: `200`<br/>
|
20
|
+
Headers: `{"Content-Type":"application/hal+json;charset=utf-8"}`<br/>
|
21
|
+
Body:
|
22
|
+
|
23
|
+
```
|
24
|
+
{
|
25
|
+
"name": "foo",
|
26
|
+
"displayName": "Foo",
|
27
|
+
"repositoryUrl": "https://github.com/example-organization/foo",
|
28
|
+
"createdAt": "2021-09-01T00:07:21+00:00",
|
29
|
+
"_embedded": {
|
30
|
+
"latestVersion": {
|
31
|
+
"number": "3e1f00a04",
|
32
|
+
"_links": {
|
33
|
+
"self": {
|
34
|
+
"title": "Version",
|
35
|
+
"name": "3e1f00a04",
|
36
|
+
"href": "https://pact-broker/pacticipants/foo/versions/3e1f00a04"
|
37
|
+
}
|
38
|
+
}
|
39
|
+
},
|
40
|
+
"labels": [
|
41
|
+
|
42
|
+
]
|
43
|
+
},
|
44
|
+
"_links": {
|
45
|
+
"self": {
|
46
|
+
"href": "https://pact-broker/pacticipants/foo"
|
47
|
+
},
|
48
|
+
"pb:versions": {
|
49
|
+
"href": "https://pact-broker/pacticipants/foo/versions"
|
50
|
+
},
|
51
|
+
"pb:version": {
|
52
|
+
"title": "Get, create or delete a pacticipant version",
|
53
|
+
"href": "https://pact-broker/pacticipants/foo/versions/{version}",
|
54
|
+
"templated": true
|
55
|
+
},
|
56
|
+
"pb:version-tag": {
|
57
|
+
"title": "Get, create or delete a tag for a version of foo",
|
58
|
+
"href": "https://pact-broker/pacticipants/foo/versions/{version}/tags/{tag}",
|
59
|
+
"templated": true
|
60
|
+
},
|
61
|
+
"pb:branch-version": {
|
62
|
+
"title": "Get or add/create a version for a branch of foo",
|
63
|
+
"href": "https://pact-broker/pacticipants/foo/branches/{branch}/versions/{version}",
|
64
|
+
"templated": true
|
65
|
+
},
|
66
|
+
"pb:label": {
|
67
|
+
"title": "Get, create or delete a label for foo",
|
68
|
+
"href": "https://pact-broker/pacticipants/foo/labels/{label}",
|
69
|
+
"templated": true
|
70
|
+
},
|
71
|
+
"pb:can-i-deploy-badge": {
|
72
|
+
"title": "Can I Deploy foo badge",
|
73
|
+
"href": "https://pact-broker/pacticipants/foo/latest-version/{tag}/can-i-deploy/to/{environmentTag}/badge",
|
74
|
+
"templated": true
|
75
|
+
},
|
76
|
+
"pb:can-i-deploy-branch-to-environment-badge": {
|
77
|
+
"title": "Can I Deploy foo from branch to environment badge",
|
78
|
+
"href": "https://pact-broker/pacticipants/foo/branches/{branch}/latest-version/can-i-deploy/to-environment/{environment}/badge",
|
79
|
+
"templated": true
|
80
|
+
},
|
81
|
+
"curies": [
|
82
|
+
{
|
83
|
+
"name": "pb",
|
84
|
+
"href": "https://pact-broker/doc/{rel}?context=pacticipant",
|
85
|
+
"templated": true
|
86
|
+
}
|
87
|
+
]
|
88
|
+
}
|
89
|
+
}
|
90
|
+
```
|
91
|
+
|
92
|
+
|
93
|
+
### PUT
|
94
|
+
|
95
|
+
PUT replaces the entire resource with the specified body, so missing properties will effectively be nulled. Embedded properties (eg. versions) will not be affected.
|
96
|
+
|
97
|
+
#### Request
|
98
|
+
|
99
|
+
Headers: `{"Content-Type":"application/json","Accept":"application/hal+json"}`<br/>
|
100
|
+
Body:
|
101
|
+
|
102
|
+
```
|
103
|
+
{
|
104
|
+
"displayName": "Foo",
|
105
|
+
"repositoryUrl": "https://github.com/example/foo",
|
106
|
+
"repositoryName": "foo",
|
107
|
+
"repositoryNamespace": "example",
|
108
|
+
"mainBranch": "main"
|
109
|
+
}
|
110
|
+
```
|
111
|
+
|
112
|
+
|
113
|
+
#### Response
|
114
|
+
|
115
|
+
Status: `200`<br/>
|
116
|
+
Headers: `{"Content-Type":"application/hal+json;charset=utf-8"}`<br/>
|
117
|
+
Body:
|
118
|
+
|
119
|
+
```
|
120
|
+
{
|
121
|
+
"name": "foo",
|
122
|
+
"displayName": "Foo",
|
123
|
+
"repositoryUrl": "https://github.com/example/foo",
|
124
|
+
"repositoryName": "foo",
|
125
|
+
"repositoryNamespace": "example",
|
126
|
+
"mainBranch": "main",
|
127
|
+
"createdAt": "2021-09-01T00:07:21+00:00",
|
128
|
+
"_embedded": {
|
129
|
+
"latestVersion": {
|
130
|
+
"number": "3e1f00a04",
|
131
|
+
"_links": {
|
132
|
+
"self": {
|
133
|
+
"title": "Version",
|
134
|
+
"name": "3e1f00a04",
|
135
|
+
"href": "https://pact-broker/pacticipants/foo/versions/3e1f00a04"
|
136
|
+
}
|
137
|
+
}
|
138
|
+
},
|
139
|
+
"labels": [
|
140
|
+
|
141
|
+
]
|
142
|
+
},
|
143
|
+
"_links": {
|
144
|
+
"self": {
|
145
|
+
"href": "https://pact-broker/pacticipants/foo"
|
146
|
+
},
|
147
|
+
"pb:versions": {
|
148
|
+
"href": "https://pact-broker/pacticipants/foo/versions"
|
149
|
+
},
|
150
|
+
"pb:version": {
|
151
|
+
"title": "Get, create or delete a pacticipant version",
|
152
|
+
"href": "https://pact-broker/pacticipants/foo/versions/{version}",
|
153
|
+
"templated": true
|
154
|
+
},
|
155
|
+
"pb:version-tag": {
|
156
|
+
"title": "Get, create or delete a tag for a version of foo",
|
157
|
+
"href": "https://pact-broker/pacticipants/foo/versions/{version}/tags/{tag}",
|
158
|
+
"templated": true
|
159
|
+
},
|
160
|
+
"pb:branch-version": {
|
161
|
+
"title": "Get or add/create a version for a branch of foo",
|
162
|
+
"href": "https://pact-broker/pacticipants/foo/branches/{branch}/versions/{version}",
|
163
|
+
"templated": true
|
164
|
+
},
|
165
|
+
"pb:label": {
|
166
|
+
"title": "Get, create or delete a label for foo",
|
167
|
+
"href": "https://pact-broker/pacticipants/foo/labels/{label}",
|
168
|
+
"templated": true
|
169
|
+
},
|
170
|
+
"pb:can-i-deploy-badge": {
|
171
|
+
"title": "Can I Deploy foo badge",
|
172
|
+
"href": "https://pact-broker/pacticipants/foo/latest-version/{tag}/can-i-deploy/to/{environmentTag}/badge",
|
173
|
+
"templated": true
|
174
|
+
},
|
175
|
+
"pb:can-i-deploy-branch-to-environment-badge": {
|
176
|
+
"title": "Can I Deploy foo from branch to environment badge",
|
177
|
+
"href": "https://pact-broker/pacticipants/foo/branches/{branch}/latest-version/can-i-deploy/to-environment/{environment}/badge",
|
178
|
+
"templated": true
|
179
|
+
},
|
180
|
+
"curies": [
|
181
|
+
{
|
182
|
+
"name": "pb",
|
183
|
+
"href": "https://pact-broker/doc/{rel}?context=pacticipant",
|
184
|
+
"templated": true
|
185
|
+
}
|
186
|
+
]
|
187
|
+
}
|
188
|
+
}
|
189
|
+
```
|
190
|
+
|
191
|
+
|
192
|
+
### PATCH
|
193
|
+
|
194
|
+
PATCH with the Content-Type application/merge-patch+json merges the pacticipant's existing properties with those from the request body. Embedded properties (eg. versions) will not be affected.
|
195
|
+
|
196
|
+
#### Request
|
197
|
+
|
198
|
+
Headers: `{"Content-Type":"application/merge-patch+json","Accept":"application/hal+json"}`<br/>
|
199
|
+
Body:
|
200
|
+
|
201
|
+
```
|
202
|
+
{
|
203
|
+
"displayName": "Foo",
|
204
|
+
"repositoryUrl": "https://github.com/example/foo",
|
205
|
+
"repositoryName": "foo",
|
206
|
+
"repositoryNamespace": "example",
|
207
|
+
"mainBranch": "main"
|
208
|
+
}
|
209
|
+
```
|
210
|
+
|
211
|
+
|
212
|
+
#### Response
|
213
|
+
|
214
|
+
Status: `200`<br/>
|
215
|
+
Headers: `{"Content-Type":"application/hal+json;charset=utf-8"}`<br/>
|
216
|
+
Body:
|
217
|
+
|
218
|
+
```
|
219
|
+
{
|
220
|
+
"name": "foo",
|
221
|
+
"displayName": "Foo",
|
222
|
+
"repositoryUrl": "https://github.com/example/foo",
|
223
|
+
"repositoryName": "foo",
|
224
|
+
"repositoryNamespace": "example",
|
225
|
+
"mainBranch": "main",
|
226
|
+
"createdAt": "2021-09-01T00:07:21+00:00",
|
227
|
+
"_embedded": {
|
228
|
+
"latestVersion": {
|
229
|
+
"number": "3e1f00a04",
|
230
|
+
"_links": {
|
231
|
+
"self": {
|
232
|
+
"title": "Version",
|
233
|
+
"name": "3e1f00a04",
|
234
|
+
"href": "https://pact-broker/pacticipants/foo/versions/3e1f00a04"
|
235
|
+
}
|
236
|
+
}
|
237
|
+
},
|
238
|
+
"labels": [
|
239
|
+
|
240
|
+
]
|
241
|
+
},
|
242
|
+
"_links": {
|
243
|
+
"self": {
|
244
|
+
"href": "https://pact-broker/pacticipants/foo"
|
245
|
+
},
|
246
|
+
"pb:versions": {
|
247
|
+
"href": "https://pact-broker/pacticipants/foo/versions"
|
248
|
+
},
|
249
|
+
"pb:version": {
|
250
|
+
"title": "Get, create or delete a pacticipant version",
|
251
|
+
"href": "https://pact-broker/pacticipants/foo/versions/{version}",
|
252
|
+
"templated": true
|
253
|
+
},
|
254
|
+
"pb:version-tag": {
|
255
|
+
"title": "Get, create or delete a tag for a version of foo",
|
256
|
+
"href": "https://pact-broker/pacticipants/foo/versions/{version}/tags/{tag}",
|
257
|
+
"templated": true
|
258
|
+
},
|
259
|
+
"pb:branch-version": {
|
260
|
+
"title": "Get or add/create a version for a branch of foo",
|
261
|
+
"href": "https://pact-broker/pacticipants/foo/branches/{branch}/versions/{version}",
|
262
|
+
"templated": true
|
263
|
+
},
|
264
|
+
"pb:label": {
|
265
|
+
"title": "Get, create or delete a label for foo",
|
266
|
+
"href": "https://pact-broker/pacticipants/foo/labels/{label}",
|
267
|
+
"templated": true
|
268
|
+
},
|
269
|
+
"pb:can-i-deploy-badge": {
|
270
|
+
"title": "Can I Deploy foo badge",
|
271
|
+
"href": "https://pact-broker/pacticipants/foo/latest-version/{tag}/can-i-deploy/to/{environmentTag}/badge",
|
272
|
+
"templated": true
|
273
|
+
},
|
274
|
+
"pb:can-i-deploy-branch-to-environment-badge": {
|
275
|
+
"title": "Can I Deploy foo from branch to environment badge",
|
276
|
+
"href": "https://pact-broker/pacticipants/foo/branches/{branch}/latest-version/can-i-deploy/to-environment/{environment}/badge",
|
277
|
+
"templated": true
|
278
|
+
},
|
279
|
+
"curies": [
|
280
|
+
{
|
281
|
+
"name": "pb",
|
282
|
+
"href": "https://pact-broker/doc/{rel}?context=pacticipant",
|
283
|
+
"templated": true
|
284
|
+
}
|
285
|
+
]
|
286
|
+
}
|
287
|
+
}
|
288
|
+
```
|
289
|
+
|
290
|
+
|