pact_broker 2.100.0 → 2.102.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (73) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +36 -0
  3. data/Gemfile +1 -0
  4. data/README.md +14 -4
  5. data/db/migrations/20220622_default_allow_dangerous_contract_modification_to_false_for_new_installations.rb +22 -0
  6. data/db/migrations/20220625_delete_pacticipants_with_no_name.rb +62 -0
  7. data/db/migrations/migration_helper.rb +6 -0
  8. data/docs/CONFIGURATION.md +3 -1
  9. data/docs/api/PACTICIPANTS.md +290 -0
  10. data/docs/api/WEBHOOKS.md +40 -40
  11. data/lib/pact_broker/api/contracts/pacticipant_create_schema.rb +28 -0
  12. data/lib/pact_broker/api/decorators/embedded_version_decorator.rb +0 -1
  13. data/lib/pact_broker/api/decorators/triggered_webhook_decorator.rb +1 -2
  14. data/lib/pact_broker/api/middleware/basic_auth.rb +2 -0
  15. data/lib/pact_broker/api/resources/all_webhooks.rb +1 -4
  16. data/lib/pact_broker/api/resources/base_resource.rb +58 -5
  17. data/lib/pact_broker/api/resources/branch_version.rb +10 -1
  18. data/lib/pact_broker/api/resources/clean.rb +11 -9
  19. data/lib/pact_broker/api/resources/currently_deployed_versions_for_environment.rb +0 -4
  20. data/lib/pact_broker/api/resources/currently_supported_versions_for_environment.rb +0 -4
  21. data/lib/pact_broker/api/resources/deployed_version.rb +12 -14
  22. data/lib/pact_broker/api/resources/deployed_versions_for_version_and_environment.rb +4 -0
  23. data/lib/pact_broker/api/resources/environment.rb +5 -5
  24. data/lib/pact_broker/api/resources/environments.rb +1 -5
  25. data/lib/pact_broker/api/resources/label.rb +4 -0
  26. data/lib/pact_broker/api/resources/matrix_for_consumer_and_provider.rb +10 -0
  27. data/lib/pact_broker/api/resources/pact.rb +14 -5
  28. data/lib/pact_broker/api/resources/pact_webhooks.rb +1 -4
  29. data/lib/pact_broker/api/resources/pacticipant.rb +11 -5
  30. data/lib/pact_broker/api/resources/pacticipant_webhooks.rb +1 -4
  31. data/lib/pact_broker/api/resources/pacticipants.rb +7 -6
  32. data/lib/pact_broker/api/resources/provider_pacts_for_verification.rb +19 -11
  33. data/lib/pact_broker/api/resources/publish_contracts.rb +11 -15
  34. data/lib/pact_broker/api/resources/released_version.rb +12 -6
  35. data/lib/pact_broker/api/resources/released_versions_for_version_and_environment.rb +10 -6
  36. data/lib/pact_broker/api/resources/tag.rb +7 -3
  37. data/lib/pact_broker/api/resources/verifications.rb +7 -9
  38. data/lib/pact_broker/api/resources/version.rb +8 -8
  39. data/lib/pact_broker/api/resources/webhook.rb +5 -4
  40. data/lib/pact_broker/api/resources/webhook_execution.rb +4 -6
  41. data/lib/pact_broker/config/runtime_configuration.rb +1 -1
  42. data/lib/pact_broker/doc/views/index/pacticipant-branch-version.markdown +13 -2
  43. data/lib/pact_broker/doc/views/provider-pacts-for-verification.markdown +1 -1
  44. data/lib/pact_broker/domain/pacticipant.rb +1 -0
  45. data/lib/pact_broker/domain/verification.rb +3 -2
  46. data/lib/pact_broker/domain/version.rb +8 -0
  47. data/lib/pact_broker/index/service.rb +3 -1
  48. data/lib/pact_broker/locale/en.yml +1 -0
  49. data/lib/pact_broker/matrix/service.rb +14 -6
  50. data/lib/pact_broker/pacticipants/find_potential_duplicate_pacticipant_names.rb +3 -3
  51. data/lib/pact_broker/pacticipants/repository.rb +5 -4
  52. data/lib/pact_broker/pacts/generate_sha.rb +1 -0
  53. data/lib/pact_broker/pacts/pact_version.rb +1 -0
  54. data/lib/pact_broker/pacts/verifiable_pact_messages.rb +1 -1
  55. data/lib/pact_broker/string_refinements.rb +8 -0
  56. data/lib/pact_broker/test/http_test_data_builder.rb +1 -0
  57. data/lib/pact_broker/test/test_data_builder.rb +20 -0
  58. data/lib/pact_broker/ui/app.rb +1 -0
  59. data/lib/pact_broker/ui/controllers/index.rb +3 -1
  60. data/lib/pact_broker/ui/helpers/haml_helpers.rb +10 -0
  61. data/lib/pact_broker/ui/views/dashboard/show.haml +3 -4
  62. data/lib/pact_broker/ui/views/index/show-with-tags.haml +4 -5
  63. data/lib/pact_broker/ui/views/index/show.haml +4 -5
  64. data/lib/pact_broker/verifications/pact_version_provider_tag_successful_verification.rb +15 -0
  65. data/lib/pact_broker/version.rb +1 -1
  66. data/lib/pact_broker/versions/branch_service.rb +7 -0
  67. data/lib/pact_broker/versions/branch_version_repository.rb +17 -0
  68. data/lib/pact_broker/webhooks/pact_and_verification_parameters.rb +1 -1
  69. data/lib/rack/pact_broker/cascade.rb +87 -0
  70. data/lib/webmachine/describe_routes.rb +43 -9
  71. metadata +9 -5
  72. data/lib/db.rb +0 -79
  73. 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: f22862d2054c07b06fb947f8a1f710dab261ae6ac1207e6a15adebb07dc488db
4
- data.tar.gz: 5cc63160ad026673f194af54237080aeb6eb8ab4f9ac93cbe5cd71b63727d60e
3
+ metadata.gz: 0ca0c487490557098ca1314f79ebe8736b1d7b72d29f5a3f48f04ad1204e81c0
4
+ data.tar.gz: f34e76335daffdff234eaad0f72c51b61080b47e4d0972be4893db97b094e80f
5
5
  SHA512:
6
- metadata.gz: 8b6c0cefc1e4847ed53627f0b2aae7cfd5be46e351ce1969f21b80f5f8899990cca3f612d9ab14a82d58c0521b91fb5f5a820f4c7d9e72f17fbc391f1583daff
7
- data.tar.gz: 4c1c3fa1a8e983718f1f841c8b17088678c6f4ada22c36b3ededb71a46c2bf004712c4716a8af33c17e068c88b88a6b69f219a286549841c20fa8c79ae41a214
6
+ metadata.gz: d2688f72d68f644707b443bb695c8899f028a5ea4ad4ac76b8680e0409b283c7d760f4229eae4c611f3878c5f609097ffd95ed79ec55f64b6239402ffc060c98
7
+ data.tar.gz: ecf36e225ebc07860c368bbbc94a805d6ae1cacb587b36dd4344ed6b8a0038014fffc115c054f1785a7d134e940a5cab1bf6d2c36773718a581e66ab6d973b47
data/CHANGELOG.md CHANGED
@@ -1,3 +1,39 @@
1
+ <a name="v2.102.1"></a>
2
+ ### v2.102.1 (2022-07-08)
3
+
4
+ #### Bug Fixes
5
+
6
+ * ensure blank? method is defined where used ([b81b5e9b](/../../commit/b81b5e9b))
7
+
8
+ <a name="v2.102.0"></a>
9
+ ### v2.102.0 (2022-07-07)
10
+
11
+ #### Features
12
+
13
+ * default allow_dangerous_contract_modification to false for new installations ([85a89951](/../../commit/85a89951))
14
+
15
+ #### Bug Fixes
16
+
17
+ * add missing provider version branch parameter to webhook requests ([262dae44](/../../commit/262dae44))
18
+ * clean up pacticipants with no names ([0aff250d](/../../commit/0aff250d))
19
+ * update string refinements with blank? and present? ([8373f88f](/../../commit/8373f88f))
20
+ * update validation for creating pacticipants to return a 400 when name is missing ([fcb02aa6](/../../commit/fcb02aa6))
21
+
22
+ <a name="v2.101.0"></a>
23
+ ### v2.101.0 (2022-06-07)
24
+
25
+ #### Features
26
+
27
+ * recalculate the branch head if the deleted branch version was the latest for the branch ([db51d4fe](/../../commit/db51d4fe))
28
+ * support deleting branch versions (removing a version from a branch) ([661667b3](/../../commit/661667b3))
29
+ * improve error message when request has non UTF-8 characters (#559) ([3addc0c8](/../../commit/3addc0c8))
30
+
31
+ #### Bug Fixes
32
+
33
+ * add missing environment policy record for use when recording deployments ([09bb02a6](/../../commit/09bb02a6))
34
+ * fix bug where pacticipant with blank name was being created instead of updating existing record ([be24a8ad](/../../commit/be24a8ad))
35
+ * ensure pacticipant name is retained when updating with PUT ([eeac47c3](/../../commit/eeac47c3))
36
+
1
37
  <a name="v2.100.0"></a>
2
38
  ### v2.100.0 (2022-05-20)
3
39
 
data/Gemfile CHANGED
@@ -30,6 +30,7 @@ group :test do
30
30
  gem "faraday_middleware", "~> 0.14"
31
31
  gem "docker-api", "~>1.34"
32
32
  gem "approvals", ">=0.0.24", "<1.0.0"
33
+ gem "tzinfo", "~>2.0"
33
34
  end
34
35
 
35
36
  if ENV["INSTALL_MYSQL"] == "true"
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
- * Install Ruby and Bundler (check the automated tests to find the most recent version of Ruby and Bundler that are supported)
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 or later 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?)
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://github.com/pact-foundation/pact_broker/wiki/Configuration#running-the-broker-behind-a-reverse-proxy
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
@@ -3,6 +3,12 @@ module PactBroker
3
3
 
4
4
  extend self
5
5
 
6
+ def for_upgrades_of_existing_installations
7
+ if from(:integrations).count > 0
8
+ yield
9
+ end
10
+ end
11
+
6
12
  def large_text_type
7
13
  if postgres?
8
14
  :text
@@ -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.82.0 and later, this defaults to `false`.<br/>
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
+