pact_broker 2.84.0 → 2.87.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (189) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/trigger_pact_docs_update.yml +22 -0
  3. data/CHANGELOG.md +63 -0
  4. data/DEVELOPER_DOCUMENTATION.md +0 -2
  5. data/db/migrations/20210913_add_pending_to_verifications.rb +7 -0
  6. data/db/migrations/20210914_add_labels_to_webhooks.rb +14 -0
  7. data/db/migrations/20210915_add_verified_by_to_verification.rb +6 -0
  8. data/db/migrations/20210929_increase_event_context_column_size.rb +14 -0
  9. data/docker-compose-ci-mysql.yml +1 -0
  10. data/docker-compose-test.yml +2 -0
  11. data/docs/CONFIGURATION.md +255 -66
  12. data/docs/configuration.yml +166 -101
  13. data/lib/db.rb +0 -1
  14. data/lib/pact/doc/interaction_view_model.rb +2 -2
  15. data/lib/pact/doc/markdown/consumer_contract_renderer.rb +4 -4
  16. data/lib/pact_broker/api/contracts/configuration.rb +33 -0
  17. data/lib/pact_broker/api/contracts/publish_contracts_schema.rb +35 -16
  18. data/lib/pact_broker/api/contracts/webhook_contract.rb +24 -2
  19. data/lib/pact_broker/api/decorators/matrix_decorator.rb +3 -1
  20. data/lib/pact_broker/api/decorators/reason_decorator.rb +2 -2
  21. data/lib/pact_broker/api/decorators/verification_decorator.rb +9 -3
  22. data/lib/pact_broker/api/decorators/verification_summary_decorator.rb +1 -2
  23. data/lib/pact_broker/api/decorators/webhook_decorator.rb +27 -4
  24. data/lib/pact_broker/api/middleware/configuration.rb +33 -0
  25. data/lib/pact_broker/api/pact_broker_urls.rb +35 -7
  26. data/lib/pact_broker/api/renderers/html_pact_renderer.rb +15 -11
  27. data/lib/pact_broker/api/resources/all_webhooks.rb +2 -2
  28. data/lib/pact_broker/api/resources/default_base_resource.rb +4 -0
  29. data/lib/pact_broker/api/resources/environment.rb +1 -1
  30. data/lib/pact_broker/api/resources/environments.rb +1 -1
  31. data/lib/pact_broker/api/resources/index.rb +7 -1
  32. data/lib/pact_broker/api/resources/pact_versions_for_branch.rb +40 -0
  33. data/lib/pact_broker/api/resources/publish_contracts.rb +1 -1
  34. data/lib/pact_broker/api/resources/verification.rb +5 -2
  35. data/lib/pact_broker/api/resources/verifications.rb +5 -1
  36. data/lib/pact_broker/api/resources/webhook_execution_methods.rb +23 -17
  37. data/lib/pact_broker/api.rb +2 -0
  38. data/lib/pact_broker/app.rb +2 -0
  39. data/lib/pact_broker/application_context.rb +5 -0
  40. data/lib/pact_broker/badges/service.rb +3 -1
  41. data/lib/pact_broker/config/runtime_configuration.rb +4 -0
  42. data/lib/pact_broker/config/runtime_configuration_database_methods.rb +1 -1
  43. data/lib/pact_broker/configuration.rb +33 -29
  44. data/lib/pact_broker/db/clean.rb +1 -2
  45. data/lib/pact_broker/db/delete_overwritten_data.rb +41 -23
  46. data/lib/pact_broker/deployments/deployed_version.rb +1 -0
  47. data/lib/pact_broker/deployments/deployed_version_service.rb +1 -0
  48. data/lib/pact_broker/deployments/environment_service.rb +4 -1
  49. data/lib/pact_broker/deployments/released_version_service.rb +1 -0
  50. data/lib/pact_broker/doc/controllers/app.rb +1 -0
  51. data/lib/pact_broker/doc/views/can-i-deploy.markdown +2 -1
  52. data/lib/pact_broker/doc/views/index/publish-contracts.markdown +38 -9
  53. data/lib/pact_broker/doc/views/pacticipant/label.markdown +12 -0
  54. data/lib/pact_broker/doc/views/webhooks.markdown +17 -0
  55. data/lib/pact_broker/domain/index_item.rb +9 -0
  56. data/lib/pact_broker/domain/pacticipant.rb +4 -0
  57. data/lib/pact_broker/domain/verification.rb +28 -4
  58. data/lib/pact_broker/domain/webhook.rb +27 -15
  59. data/lib/pact_broker/domain/webhook_pacticipant.rb +6 -0
  60. data/lib/pact_broker/domain/webhook_request.rb +2 -2
  61. data/lib/pact_broker/index/service.rb +77 -26
  62. data/lib/pact_broker/locale/en.yml +6 -1
  63. data/lib/pact_broker/matrix/head_row.rb +1 -1
  64. data/lib/pact_broker/matrix/parse_can_i_deploy_query.rb +5 -3
  65. data/lib/pact_broker/matrix/quick_row.rb +0 -1
  66. data/lib/pact_broker/matrix/repository.rb +0 -1
  67. data/lib/pact_broker/matrix/row.rb +2 -2
  68. data/lib/pact_broker/pacticipants/repository.rb +1 -1
  69. data/lib/pact_broker/pacts/latest_pact_publication_id_for_consumer_version.rb +0 -1
  70. data/lib/pact_broker/pacts/metadata.rb +11 -3
  71. data/lib/pact_broker/pacts/pact_publication.rb +44 -0
  72. data/lib/pact_broker/pacts/pact_publication_clean_selector_dataset_module.rb +19 -0
  73. data/lib/pact_broker/pacts/pact_publication_dataset_module.rb +68 -1
  74. data/lib/pact_broker/pacts/pact_version.rb +24 -1
  75. data/lib/pact_broker/pacts/pacts_for_verification_repository.rb +5 -4
  76. data/lib/pact_broker/pacts/repository.rb +52 -48
  77. data/lib/pact_broker/pacts/service.rb +5 -5
  78. data/lib/pact_broker/string_refinements.rb +1 -1
  79. data/lib/pact_broker/test/http_test_data_builder.rb +40 -11
  80. data/lib/pact_broker/test/test_data_builder.rb +27 -6
  81. data/lib/pact_broker/ui/app.rb +7 -1
  82. data/lib/pact_broker/ui/controllers/dashboard.rb +80 -0
  83. data/lib/pact_broker/ui/controllers/groups.rb +23 -8
  84. data/lib/pact_broker/ui/helpers/url_helper.rb +17 -1
  85. data/lib/pact_broker/ui/view_models/index_item.rb +64 -8
  86. data/lib/pact_broker/ui/view_models/index_item_branch_head.rb +39 -0
  87. data/lib/pact_broker/ui/view_models/index_item_provider_branch_head.rb +39 -0
  88. data/lib/pact_broker/ui/view_models/matrix_branch.rb +1 -1
  89. data/lib/pact_broker/ui/view_models/matrix_tag.rb +0 -1
  90. data/lib/pact_broker/ui/views/dashboard/show.haml +202 -0
  91. data/lib/pact_broker/ui/views/groups/show.html.erb +60 -14
  92. data/lib/pact_broker/ui/views/index/_dashboard_navbar.haml +7 -0
  93. data/lib/pact_broker/ui/views/index/_navbar.haml +0 -7
  94. data/lib/pact_broker/ui/views/index/show-with-tags.haml +3 -1
  95. data/lib/pact_broker/ui/views/index/show.haml +35 -13
  96. data/lib/pact_broker/ui/views/matrix/show.haml +7 -3
  97. data/lib/pact_broker/verifications/pseudo_branch_status.rb +2 -0
  98. data/lib/pact_broker/verifications/repository.rb +5 -2
  99. data/lib/pact_broker/verifications/service.rb +8 -4
  100. data/lib/pact_broker/version.rb +1 -1
  101. data/lib/pact_broker/versions/branch_head.rb +0 -2
  102. data/lib/pact_broker/versions/branch_version.rb +1 -0
  103. data/lib/pact_broker/versions/repository.rb +0 -1
  104. data/lib/pact_broker/webhooks/event_listener.rb +7 -5
  105. data/lib/pact_broker/webhooks/execution_configuration.rb +16 -0
  106. data/lib/pact_broker/webhooks/execution_configuration_creator.rb +3 -0
  107. data/lib/pact_broker/webhooks/job.rb +1 -1
  108. data/lib/pact_broker/webhooks/pact_and_verification_parameters.rb +18 -3
  109. data/lib/pact_broker/webhooks/repository.rb +10 -4
  110. data/lib/pact_broker/webhooks/trigger_service.rb +3 -3
  111. data/lib/pact_broker/webhooks/webhook.rb +71 -8
  112. data/lib/pact_broker/webhooks/webhook_execution_result.rb +3 -7
  113. data/lib/pact_broker/webhooks/webhook_request_logger.rb +4 -12
  114. data/lib/pact_broker/webhooks/webhook_request_template.rb +6 -8
  115. data/pact_broker.gemspec +4 -0
  116. data/public/javascripts/index.js +75 -68
  117. data/public/javascripts/pact.js +14 -14
  118. data/public/stylesheets/index.css +6 -2
  119. data/public/stylesheets/pact.css +11 -0
  120. data/script/data/auto-create-things-for-tags.rb +3 -0
  121. data/script/data/branches.rb +2 -2
  122. data/script/data/contract-published-requiring-verification.rb +0 -1
  123. data/script/data/environments.rb +0 -0
  124. data/script/data/pending.rb +26 -0
  125. data/script/data/tags.rb +35 -0
  126. data/script/data/verify-pact-for-multiple-selectors.rb +30 -0
  127. data/script/data/webhook.rb +22 -0
  128. data/script/docs/generate-configuration-docs.rb +24 -3
  129. data/script/generate-erd +55 -0
  130. data/script/seed.rb +50 -89
  131. data/spec/features/create_webhook_spec.rb +55 -10
  132. data/spec/features/delete_pact_versions_for_branch_spec.rb +34 -0
  133. data/spec/features/get_pact_spec.rb +2 -3
  134. data/spec/fixtures/approvals/modifiable_resources.approved.json +4 -0
  135. data/spec/fixtures/invalid-publish-contract-body.json +38 -0
  136. data/spec/fixtures/verification.json +4 -0
  137. data/spec/integration/app_spec.rb +6 -6
  138. data/spec/integration/webhooks/contract_publication_spec.rb +68 -0
  139. data/spec/integration/webhooks/contract_requiring_verification_published_spec.rb +67 -0
  140. data/spec/integration/webhooks/pact_publication_spec.rb +51 -0
  141. data/spec/lib/pact/doc/markdown/consumer_contract_renderer_spec.rb +2 -2
  142. data/spec/lib/pact_broker/api/contracts/publish_contracts_schema_spec.rb +13 -0
  143. data/spec/lib/pact_broker/api/contracts/webhook_contract_spec.rb +50 -0
  144. data/spec/lib/pact_broker/api/decorators/matrix_decorator_spec.rb +1 -1
  145. data/spec/lib/pact_broker/api/decorators/reason_decorator_spec.rb +2 -2
  146. data/spec/lib/pact_broker/api/decorators/verification_decorator_spec.rb +15 -7
  147. data/spec/lib/pact_broker/api/decorators/verification_summary_decorator_spec.rb +6 -2
  148. data/spec/lib/pact_broker/api/decorators/webhook_decorator_spec.rb +4 -4
  149. data/spec/lib/pact_broker/api/decorators/webhook_execution_result_decorator_spec.rb +1 -1
  150. data/spec/lib/pact_broker/api/middleware/configuration_spec.rb +43 -0
  151. data/spec/lib/pact_broker/api/pact_broker_urls_spec.rb +18 -0
  152. data/spec/lib/pact_broker/api/resources/triggered_webhook_logs_spec.rb +6 -5
  153. data/spec/lib/pact_broker/api/resources/verifications_spec.rb +2 -3
  154. data/spec/lib/pact_broker/api/resources/webhook_execution_spec.rb +1 -1
  155. data/spec/lib/pact_broker/badges/service_spec.rb +22 -0
  156. data/spec/lib/pact_broker/config/runtime_configuration_documentation_spec.rb +30 -0
  157. data/spec/lib/pact_broker/deployments/environment_service_spec.rb +1 -1
  158. data/spec/lib/pact_broker/domain/webhook_request_spec.rb +2 -1
  159. data/spec/lib/pact_broker/domain/webhook_spec.rb +15 -5
  160. data/spec/lib/pact_broker/index/service_spec.rb +1 -5
  161. data/spec/lib/pact_broker/index/service_view_spec.rb +144 -0
  162. data/spec/lib/pact_broker/matrix/head_row_spec.rb +9 -5
  163. data/spec/lib/pact_broker/matrix/parse_can_i_deploy_query_spec.rb +13 -0
  164. data/spec/lib/pact_broker/pacts/metadata_spec.rb +11 -2
  165. data/spec/lib/pact_broker/pacts/{latest_tagged_pact_publications_spec.rb → pact_publication_clean_selector_dataset_module_spec.rb} +7 -9
  166. data/spec/lib/pact_broker/pacts/pact_publication_latest_verification_spec.rb +29 -0
  167. data/spec/lib/pact_broker/pacts/pact_version_spec.rb +32 -0
  168. data/spec/lib/pact_broker/pacts/repository_find_for_verification_spec.rb +4 -5
  169. data/spec/lib/pact_broker/pacts/repository_spec.rb +48 -2
  170. data/spec/lib/pact_broker/ui/view_models/index_item_spec.rb +12 -9
  171. data/spec/lib/pact_broker/verifications/pseudo_branch_status_spec.rb +9 -1
  172. data/spec/lib/pact_broker/verifications/service_spec.rb +24 -8
  173. data/spec/lib/pact_broker/webhooks/job_spec.rb +4 -4
  174. data/spec/lib/pact_broker/webhooks/render_spec.rb +3 -2
  175. data/spec/lib/pact_broker/webhooks/repository_spec.rb +158 -15
  176. data/spec/lib/pact_broker/webhooks/trigger_service_spec.rb +9 -5
  177. data/spec/lib/pact_broker/webhooks/webhook_request_logger_spec.rb +6 -12
  178. data/spec/lib/pact_broker/webhooks/webhook_request_template_spec.rb +3 -2
  179. data/spec/lib/pact_broker/webhooks/webhook_spec.rb +8 -5
  180. data/spec/support/generated_markdown.md +3 -3
  181. data/tasks/db.rake +4 -1
  182. metadata +72 -14
  183. data/lib/pact_broker/pacts/all_pact_publications.rb +0 -158
  184. data/lib/pact_broker/pacts/latest_pact_publications.rb +0 -48
  185. data/lib/pact_broker/pacts/latest_pact_publications_by_consumer_version.rb +0 -26
  186. data/lib/pact_broker/pacts/latest_tagged_pact_publications.rb +0 -45
  187. data/lib/pact_broker/verifications/latest_verification_for_pact_version.rb +0 -39
  188. data/spec/lib/pact_broker/api/resources/webhook_execution_result_spec.rb +0 -56
  189. data/spec/lib/pact_broker/verifications/latest_verification_for_pact_version_spec.rb +0 -18
@@ -1,6 +1,68 @@
1
1
  # Pact Broker Configuration
2
2
 
3
3
 
4
+ <!-- This is a generated file. Please do not edit it directly. -->
5
+
6
+ The Pact Broker supports configuration via environment variables or a YAML file.
7
+
8
+ To configure the application using a YAML file, place it in the location `config/pact_broker.yml`,
9
+ relative to the working directory of the application, or set the environment
10
+ variable `PACT_BROKER_CONF` to the full path to the configuration file.
11
+ <br/>
12
+
13
+ ## Logging
14
+
15
+ <hr/>
16
+
17
+
18
+ ### log_level
19
+
20
+ The application log level
21
+
22
+ **YAML configuration key name:** `log_level`<br/>
23
+ **Environment variable name:** `PACT_BROKER_LOG_LEVEL`<br/>
24
+ **Default:** `info`<br/>
25
+ **Allowed values:** `debug`, `info`, `warn`, `error`, `fatal`<br/>
26
+
27
+ ### log_format
28
+
29
+ The application log format. Can be any value supported by Semantic Logger.
30
+
31
+ **YAML configuration key name:** `log_format`<br/>
32
+ **Environment variable name:** `PACT_BROKER_LOG_FORMAT`<br/>
33
+ **Default:** `default`<br/>
34
+ **Allowed values:** `default`, `json`, `color`<br/>
35
+ **More information:** https://github.com/rocketjob/semantic_logger/tree/master/lib/semantic_logger/formatters<br/>
36
+
37
+ ### log_dir
38
+
39
+ The log file directory
40
+
41
+ **YAML configuration key name:** `log_dir`<br/>
42
+ **Environment variable name:** `PACT_BROKER_LOG_DIR`<br/>
43
+ **Default:** `./logs`<br/>
44
+
45
+ ### log_stream
46
+
47
+ The stream to which the logs will be sent.
48
+
49
+ While the default is `file` for the Ruby application, it is set to `stdout` on the supported Docker images.
50
+
51
+ **YAML configuration key name:** `log_stream`<br/>
52
+ **Environment variable name:** `PACT_BROKER_LOG_STREAM`<br/>
53
+ **Default:** `file`<br/>
54
+ **Allowed values:** `stdout`, `file`<br/>
55
+
56
+ ### hide_pactflow_messages
57
+
58
+ Set to `true` to hide the messages in the logs about Pactflow
59
+
60
+ **YAML configuration key name:** `hide_pactflow_messages`<br/>
61
+ **Environment variable name:** `PACT_BROKER_HIDE_PACTFLOW_MESSAGES`<br/>
62
+ **Default:** `true`<br/>
63
+ **Allowed values:** `true`, `false`<br/>
64
+ **More information:** https://pactflow.io<br/>
65
+
4
66
  <br/>
5
67
 
6
68
  ## Database
@@ -15,6 +77,8 @@ The database adapter. For production use, Postgres must be used.
15
77
  For investigations/spikes on a development machine, you can use SQlite. It is not supported as a production database, as it does not support
16
78
  concurrent requests.
17
79
 
80
+ **YAML configuration key name:** `database_adapter`<br/>
81
+ **Environment variable name:** `PACT_BROKER_DATABASE_ADAPTER`<br/>
18
82
  **Default:** `postgres`<br/>
19
83
  **Allowed values:** `postgres` (for production use), `sqlite` (for spikes only)<br/>
20
84
 
@@ -22,39 +86,53 @@ concurrent requests.
22
86
 
23
87
  The database username
24
88
 
89
+ **YAML configuration key name:** `database_username`<br/>
90
+ **Environment variable name:** `PACT_BROKER_DATABASE_USERNAME`<br/>
25
91
 
26
92
  ### database_password
27
93
 
28
94
  The database password
29
95
 
96
+ **YAML configuration key name:** `database_password`<br/>
97
+ **Environment variable name:** `PACT_BROKER_DATABASE_PASSWORD`<br/>
30
98
 
31
99
  ### database_name
32
100
 
33
101
  The database name. If using the `sqlite` adapter, this will be the path to the database file.
34
102
 
103
+ **YAML configuration key name:** `database_name`<br/>
104
+ **Environment variable name:** `PACT_BROKER_DATABASE_NAME`<br/>
35
105
  **Examples:** `pact_broker`, `/tmp/pact_broker.sqlite3`, `./tmp/pact_broker.sqlite3`<br/>
36
106
 
37
107
  ### database_host
38
108
 
39
109
  The database host
40
110
 
111
+ **YAML configuration key name:** `database_host`<br/>
112
+ **Environment variable name:** `PACT_BROKER_DATABASE_HOST`<br/>
41
113
 
42
114
  ### database_port
43
115
 
44
116
  The database port. If ommited, the default port for the adapter will be used.
45
117
 
118
+ **YAML configuration key name:** `database_port`<br/>
119
+ **Environment variable name:** `PACT_BROKER_DATABASE_PORT`<br/>
46
120
 
47
121
  ### database_url
48
122
 
49
123
  The full database URL may be specified instead of the separate adapter, username, password, name, host and port.
50
124
 
51
- **Format:** {database_adapter}://{database_username}:{database_password}@{database_host}:{database_port}/{database_name}<br/>
52
- **Examples:** `postgres://pact_broker_user:pact_broker_password@pact_broker_db_host/pact_broker`, `sqlite:////tmp/pact_broker.sqlite3`<br/>
125
+ **YAML configuration key name:** `database_url`<br/>
126
+ **Environment variable name:** `PACT_BROKER_DATABASE_URL`<br/>
127
+ **Format:** `{database_adapter}://{database_username}:{database_password}@{database_host}:{database_port}/{database_name}`<br/>
128
+ **Examples:** `postgres://pact_broker_user:pact_broker_password@pact_broker_db_host/pact_broker`, `sqlite:///tmp/pact_broker.sqlite3` (relative path to working directory), `sqlite:////tmp/pact_broker.sqlite3` (absolute path)<br/>
53
129
 
54
130
  ### database_sslmode
55
131
 
56
132
  The Postgresql ssl mode.
57
133
 
134
+ **YAML configuration key name:** `database_sslmode`<br/>
135
+ **Environment variable name:** `PACT_BROKER_DATABASE_SSLMODE`<br/>
58
136
  **Default:** `prefer`<br/>
59
137
  **Allowed values:** `disable`, `allow`, `prefer`, `require`, `verify-ca`, `verify-full`<br/>
60
138
  **More information:** https://ankane.org/postgres-sslmode-explained<br/>
@@ -65,118 +143,116 @@ The log level that will be used when the SQL query statements are logged.
65
143
 
66
144
  To disable noisy SQL query logging when the application `log_level` is set to `debug` for other reasons, use the value `none`.
67
145
 
146
+ **YAML configuration key name:** `sql_log_level`<br/>
147
+ **Environment variable name:** `PACT_BROKER_SQL_LOG_LEVEL`<br/>
68
148
  **Default:** `debug`<br/>
69
149
  **Allowed values:** `none`, `debug`, `info`, `warn`, `error`, `fatal`<br/>
70
150
 
71
151
  ### sql_log_warn_duration
72
152
 
153
+ The number of seconds after which to log an SQL query at warn level. Use this for detecting slow queries.
73
154
 
74
-
155
+ **YAML configuration key name:** `sql_log_warn_duration`<br/>
156
+ **Environment variable name:** `PACT_BROKER_SQL_LOG_WARN_DURATION`<br/>
75
157
  **Default:** `5`<br/>
158
+ **Allowed values:** A positive integer or float, as a string.<br/>
159
+ **More information:** https://sequel.jeremyevans.net/rdoc/files/doc/opening_databases_rdoc.html#label-General+connection+options<br/>
76
160
 
77
161
  ### database_max_connections
78
162
 
163
+ The maximum size of the connection pool (4 connections by default on most databases)
79
164
 
80
-
81
- **Default:** `nil`<br/>
165
+ **YAML configuration key name:** `database_max_connections`<br/>
166
+ **Environment variable name:** `PACT_BROKER_DATABASE_MAX_CONNECTIONS`<br/>
167
+ **Default:** `4`<br/>
168
+ **Allowed values:** A positive integer value.<br/>
169
+ **More information:** https://sequel.jeremyevans.net/rdoc/files/doc/opening_databases_rdoc.html#label-General+connection+options<br/>
82
170
 
83
171
  ### database_pool_timeout
84
172
 
173
+ The number of seconds to wait if a connection cannot be acquired before raising an error
85
174
 
86
-
175
+ **YAML configuration key name:** `database_pool_timeout`<br/>
176
+ **Environment variable name:** `PACT_BROKER_DATABASE_POOL_TIMEOUT`<br/>
87
177
  **Default:** `5`<br/>
178
+ **Allowed values:** A positive integer.<br/>
179
+ **More information:** https://sequel.jeremyevans.net/rdoc/files/doc/opening_databases_rdoc.html#label-General+connection+options<br/>
88
180
 
89
181
  ### database_connect_max_retries
90
182
 
183
+ When running the Pact Broker Docker image experimentally using Docker Compose on a local development machine,
184
+ the Broker application process may be ready before the database is available for connection, causing the application
185
+ container to exit with an error. Setting the max retries to a non-zero number will allow it to retry the connection the
186
+ configured number of times, waiting 3 seconds between attempts.
91
187
 
92
-
188
+ **YAML configuration key name:** `database_connect_max_retries`<br/>
189
+ **Environment variable name:** `PACT_BROKER_DATABASE_CONNECT_MAX_RETRIES`<br/>
93
190
  **Default:** `0`<br/>
191
+ **Allowed values:** A positive integer value.<br/>
94
192
 
95
193
  ### auto_migrate_db
96
194
 
195
+ Whether or not to run the database schema migrations on start up. It is recommended to set this to `true`.
97
196
 
98
-
197
+ **YAML configuration key name:** `auto_migrate_db`<br/>
198
+ **Environment variable name:** `PACT_BROKER_AUTO_MIGRATE_DB`<br/>
99
199
  **Default:** `true`<br/>
200
+ **Allowed values:** `true`, `false`<br/>
100
201
 
101
202
  ### auto_migrate_db_data
102
203
 
204
+ Whether or not to run the database data migrations on start up. It is recommended to set this to `true`.
103
205
 
104
-
206
+ **YAML configuration key name:** `auto_migrate_db_data`<br/>
207
+ **Environment variable name:** `PACT_BROKER_AUTO_MIGRATE_DB_DATA`<br/>
105
208
  **Default:** `true`<br/>
209
+ **Allowed values:** `true`, `false`<br/>
106
210
 
107
211
  ### allow_missing_migration_files
108
212
 
213
+ If `true`, will not raise an error if a database migration is recorded in the database that does not have an
214
+ equivalent file in the codebase. If this is true, an older version of the code may be used with a newer version of the database,
215
+ however, data integrity issues may occur.
109
216
 
110
-
111
- **Default:** `true`<br/>
112
-
113
- ### validate_database_connection_config
114
-
115
-
116
-
217
+ **YAML configuration key name:** `allow_missing_migration_files`<br/>
218
+ **Environment variable name:** `PACT_BROKER_ALLOW_MISSING_MIGRATION_FILES`<br/>
117
219
  **Default:** `true`<br/>
220
+ **More information:** https://sequel.jeremyevans.net/rdoc/classes/Sequel/Migrator.html<br/>
118
221
 
119
222
  ### database_statement_timeout
120
223
 
224
+ The number of seconds after which an SQL query will be aborted. Only supported for Postgresql connections.
121
225
 
122
-
226
+ **YAML configuration key name:** `database_statement_timeout`<br/>
227
+ **Environment variable name:** `PACT_BROKER_DATABASE_STATEMENT_TIMEOUT`<br/>
123
228
  **Default:** `15`<br/>
229
+ **Allowed values:** A positive integer or float.<br/>
230
+ **More information:** https://www.postgresql.org/docs/9.3/runtime-config-client.html<br/>
124
231
 
125
232
  ### metrics_sql_statement_timeout
126
233
 
234
+ The number of seconds after which the SQL queries used for the metrics endpoint will be aborted.
235
+ This is configurable separately from the standard `database_statement_timeout` as it may need to be significantly
236
+ longer than the desired value for standard queries.
127
237
 
128
-
238
+ **YAML configuration key name:** `metrics_sql_statement_timeout`<br/>
239
+ **Environment variable name:** `PACT_BROKER_METRICS_SQL_STATEMENT_TIMEOUT`<br/>
129
240
  **Default:** `30`<br/>
241
+ **Allowed values:** A positive integer.<br/>
130
242
 
131
243
  ### database_connection_validation_timeout
132
244
 
245
+ The number of seconds after which to check the health of a connection from a connection pool before passing it to the application.
133
246
 
247
+ `-1` means that connections will be validated every time, which avoids errors
248
+ when databases are restarted and connections are killed. This has a performance
249
+ penalty, so consider increasing this timeout if building a frequently accessed service.
134
250
 
135
-
136
- <br/>
137
-
138
- ## Logging
139
-
140
- <hr/>
141
-
142
-
143
- ### log_level
144
-
145
- The application log level
146
-
147
- **Default:** `info`<br/>
148
- **Allowed values:** `debug`, `info`, `warn`, `error`, `fatal`<br/>
149
-
150
- ### log_format
151
-
152
- The application log format. Can be any value supported by Semantic Logger.
153
-
154
- **Default:** `default`<br/>
155
- **Allowed values:** `default`, `json`, `color`<br/>
156
- **More information:** https://github.com/rocketjob/semantic_logger/tree/master/lib/semantic_logger/formatters<br/>
157
-
158
- ### log_dir
159
-
160
- The log file directory
161
-
162
- **Default:** `./logs`<br/>
163
-
164
- ### log_stream
165
-
166
- The stream to which the logs will be sent.
167
-
168
- While the default is `file` for the Ruby application, it is set to `stdout` on the supported Docker images.
169
-
170
- **Default:** `file`<br/>
171
- **Allowed values:** `stdout`, `file`<br/>
172
-
173
- ### hide_pactflow_messages
174
-
175
- Set to `true` to hide the messages in the logs about Pactflow
176
-
177
- **Default:** `true`<br/>
178
- **Allowed values:** `true`, `false`<br/>
179
- **More information:** https://pactflow.io<br/>
251
+ **YAML configuration key name:** `database_connection_validation_timeout`<br/>
252
+ **Environment variable name:** `PACT_BROKER_DATABASE_CONNECTION_VALIDATION_TIMEOUT`<br/>
253
+ **Default:** -1 for v2.85.1 and earlier, 3600 for later versions.<br/>
254
+ **Allowed values:** -1 or any positive integer.<br/>
255
+ **More information:** https://sequel.jeremyevans.net/rdoc-plugins/files/lib/sequel/extensions/connection_validator_rb.html<br/>
180
256
 
181
257
  <br/>
182
258
 
@@ -190,8 +266,10 @@ should be used for CI/CD.
190
266
 
191
267
  ### basic_auth_enabled
192
268
 
193
- Whether to enable basic authorization
269
+ Whether to enable basic authorization. This is automatically set to true for the Docker images if the `basic_auth_username` and `basic_auth_password` are set.
194
270
 
271
+ **YAML configuration key name:** `basic_auth_enabled`<br/>
272
+ **Environment variable name:** `PACT_BROKER_BASIC_AUTH_ENABLED`<br/>
195
273
  **Default:** `false`<br/>
196
274
  **Allowed values:** `true`, `false`<br/>
197
275
 
@@ -199,26 +277,36 @@ Whether to enable basic authorization
199
277
 
200
278
  The username for the read/write basic auth user.
201
279
 
280
+ **YAML configuration key name:** `basic_auth_username`<br/>
281
+ **Environment variable name:** `PACT_BROKER_BASIC_AUTH_USERNAME`<br/>
202
282
 
203
283
  ### basic_auth_password
204
284
 
205
285
  The password for the read/write basic auth user.
206
286
 
287
+ **YAML configuration key name:** `basic_auth_password`<br/>
288
+ **Environment variable name:** `PACT_BROKER_BASIC_AUTH_PASSWORD`<br/>
207
289
 
208
290
  ### basic_auth_read_only_username
209
291
 
210
292
  The username for the read only basic auth user.
211
293
 
294
+ **YAML configuration key name:** `basic_auth_read_only_username`<br/>
295
+ **Environment variable name:** `PACT_BROKER_BASIC_AUTH_READ_ONLY_USERNAME`<br/>
212
296
 
213
297
  ### basic_auth_read_only_password
214
298
 
215
299
  The password for the read only basic auth user.
216
300
 
301
+ **YAML configuration key name:** `basic_auth_read_only_password`<br/>
302
+ **Environment variable name:** `PACT_BROKER_BASIC_AUTH_READ_ONLY_PASSWORD`<br/>
217
303
 
218
304
  ### allow_public_read
219
305
 
220
306
  If you want to allow public read access, but still require credentials for writing, then leave `basic_auth_read_only_username` and `basic_auth_read_only_password` unset, and set `allow_public_read` to `true`.
221
307
 
308
+ **YAML configuration key name:** `allow_public_read`<br/>
309
+ **Environment variable name:** `PACT_BROKER_ALLOW_PUBLIC_READ`<br/>
222
310
  **Default:** `false`<br/>
223
311
  **Allowed values:** `true`, `false`<br/>
224
312
 
@@ -226,6 +314,8 @@ If you want to allow public read access, but still require credentials for writi
226
314
 
227
315
  If you have enabled basic auth, but require unauthenticated access to the heartbeat URL (eg. for use within an AWS autoscaling group), set `public_heartbeat` to `true`.
228
316
 
317
+ **YAML configuration key name:** `public_heartbeat`<br/>
318
+ **Environment variable name:** `PACT_BROKER_PUBLIC_HEARTBEAT`<br/>
229
319
  **Default:** `false`<br/>
230
320
  **Allowed values:** `true`, `false`<br/>
231
321
 
@@ -233,6 +323,8 @@ If you have enabled basic auth, but require unauthenticated access to the heartb
233
323
 
234
324
  Set this to true to allow status badges to be embedded in README files without requiring a hardcoded password.
235
325
 
326
+ **YAML configuration key name:** `enable_public_badge_access`<br/>
327
+ **Environment variable name:** `PACT_BROKER_ENABLE_PUBLIC_BADGE_ACCESS`<br/>
236
328
  **Default:** `false`<br/>
237
329
  **Allowed values:** `true`, `false`<br/>
238
330
 
@@ -248,6 +340,8 @@ Set this to true to allow status badges to be embedded in README files without r
248
340
  The schedule of seconds to wait between webhook execution attempts.
249
341
  The default schedule is 10 sec, 1 min, 2 min, 5 min, 10 min, 20 min (38 minutes in total).
250
342
 
343
+ **YAML configuration key name:** `webhook_retry_schedule`<br/>
344
+ **Environment variable name:** `PACT_BROKER_WEBHOOK_RETRY_SCHEDULE`<br/>
251
345
  **Format:** A space separated list of integers.<br/>
252
346
  **Default:** `10 60 120 300 600 1200`<br/>
253
347
 
@@ -256,6 +350,8 @@ The default schedule is 10 sec, 1 min, 2 min, 5 min, 10 min, 20 min (38 minutes
256
350
  The allowed HTTP methods for webhooks.
257
351
  It is highly recommended that only `POST` requests are allowed to ensure that webhooks cannot be used to retrieve sensitive information from hosts within the same network.
258
352
 
353
+ **YAML configuration key name:** `webhook_http_method_whitelist`<br/>
354
+ **Environment variable name:** `PACT_BROKER_WEBHOOK_HTTP_METHOD_WHITELIST`<br/>
259
355
  **Format:** A space separated list.<br/>
260
356
  **Default:** `POST`<br/>
261
357
  **Allowed values:** `POST`, `GET` (not recommended), `PUT` (not recommended), `PATCH` (not recommended), `DELETE` (not recommended)<br/>
@@ -268,6 +364,8 @@ considered a success, otherwise the webhook will be re-triggered based on the `w
268
364
  In most cases, configuring this is not necessary, but there are some CI systems that return a non 200 status for a success,
269
365
  which is why this feature exists.
270
366
 
367
+ **YAML configuration key name:** `webhook_http_code_success`<br/>
368
+ **Environment variable name:** `PACT_BROKER_WEBHOOK_HTTP_CODE_SUCCESS`<br/>
271
369
  **Format:** A space separated list of integers.<br/>
272
370
  **Default:** `200 201 202 203 204 205 206`<br/>
273
371
  **Allowed values:** `Any valid HTTP status code`<br/>
@@ -276,6 +374,8 @@ which is why this feature exists.
276
374
 
277
375
  The allowed URL schemes for webhooks.
278
376
 
377
+ **YAML configuration key name:** `webhook_scheme_whitelist`<br/>
378
+ **Environment variable name:** `PACT_BROKER_WEBHOOK_SCHEME_WHITELIST`<br/>
279
379
  **Format:** A space delimited list.<br/>
280
380
  **Default:** `https`<br/>
281
381
  **Allowed values:** `https`, `http`<br/>
@@ -285,8 +385,10 @@ The allowed URL schemes for webhooks.
285
385
  A list of hosts, network ranges, or host regular expressions.
286
386
  Regular expressions should start and end with a `/` to differentiate them from Strings.
287
387
  Note that backslashes need to be escaped with a second backslash when setting via an environment variable.
288
- Please read the Webhook whitelists section of the Pact Broker configuration documentation to understand how the whitelist is used.
388
+ Please read the [Webhook whitelists section](https://docs.pact.io/pact_broker/configuration/features#webhooks) of the Pact Broker configuration documentation to understand how the whitelist is used.
289
389
 
390
+ **YAML configuration key name:** `webhook_host_whitelist`<br/>
391
+ **Environment variable name:** `PACT_BROKER_WEBHOOK_HOST_WHITELIST`<br/>
290
392
  **Examples:** `github.com`, `10.2.3.41/24`, `/.*\\.foo\\.com$/`<br/>
291
393
  **More information:** https://docs.pact.io/pact_broker/configuration/#webhook-whitelists<br/>
292
394
 
@@ -294,12 +396,22 @@ Please read the Webhook whitelists section of the Pact Broker configuration docu
294
396
 
295
397
  If set to true, SSL verification will be disabled for the HTTP requests made by the webhooks
296
398
 
399
+ **YAML configuration key name:** `disable_ssl_verification`<br/>
400
+ **Environment variable name:** `PACT_BROKER_DISABLE_SSL_VERIFICATION`<br/>
297
401
  **Default:** `false`<br/>
298
402
  **Allowed values:** `true`, `false`<br/>
299
403
 
404
+ ### user_agent
405
+
406
+ The user agent to set when making HTTP requests for webhooks.
407
+
408
+ **YAML configuration key name:** `user_agent`<br/>
409
+ **Environment variable name:** `PACT_BROKER_USER_AGENT`<br/>
410
+ **Default:** `Pact Broker v{VERSION}`<br/>
411
+
300
412
  <br/>
301
413
 
302
- ## HTTP
414
+ ## Resources
303
415
 
304
416
  <hr/>
305
417
 
@@ -310,6 +422,8 @@ The HTTP port that the Pact Broker application will run on. This will only be ho
310
422
  a package that actually reads this property (eg. one of the supported Docker images). If you are running the vanilla Ruby application,
311
423
  the application will run on the port the server has been configured to run on (eg. `bundle exec rackup -p 9393`)
312
424
 
425
+ **YAML configuration key name:** `port`<br/>
426
+ **Environment variable name:** `PACT_BROKER_PORT`<br/>
313
427
  **Default:** `9292`<br/>
314
428
 
315
429
  ### base_url
@@ -321,6 +435,8 @@ deploying the Pact Broker to production as it prevents cache poisoning security
321
435
  It is also required when deploying the Broker behind a reverse proxy, and when the application has been mounted at a non-root context.
322
436
  Note that this attribute does not change where the application is actually mounted (that is the concern of the deployment configuration) - it just changes the links.
323
437
 
438
+ **YAML configuration key name:** `base_url`<br/>
439
+ **Environment variable name:** `PACT_BROKER_BASE_URL`<br/>
324
440
  **Examples:** `https://pact-broker.mycompany.com`, `https://my-company.com:9292/pact-broker`<br/>
325
441
 
326
442
  ### base_urls
@@ -328,6 +444,8 @@ Note that this attribute does not change where the application is actually mount
328
444
  An alias of base_url. From version 2.79.0, multiple base URLs can be configured for architectures that use
329
445
  gateways or proxies that allow the same Pact Broker instance to be addressed with different base URLs.
330
446
 
447
+ **YAML configuration key name:** `base_urls`<br/>
448
+ **Environment variable name:** `PACT_BROKER_BASE_URLS`<br/>
331
449
  **Format:** A space separated list.<br/>
332
450
  **Example:** `http://my-internal-pact-broker:9292 https://my-external-pact-broker`<br/>
333
451
 
@@ -335,9 +453,34 @@ gateways or proxies that allow the same Pact Broker instance to be addressed wit
335
453
 
336
454
  The URL of the shields.io server used to generate the README badges.
337
455
 
456
+ **YAML configuration key name:** `shields_io_base_url`<br/>
457
+ **Environment variable name:** `PACT_BROKER_SHIELDS_IO_BASE_URL`<br/>
338
458
  **Default:** `https://img.shields.io`<br/>
339
459
  **More information:** https://shields.io<br/>
340
460
 
461
+ ### badge_provider_mode
462
+
463
+ The method by which the badges are generated. When set to `redirect`, a request to the Pact Broker for a badge will be sent a redirect response
464
+ to render the badge from the shields.io server directly in the browser. This is the recommended value.
465
+ When set to `proxy`, the Pact Broker will make a request directly to the configured shields.io server, and then send the returned file
466
+ back to the browser. This mode is not recommended for security and performance reasons.
467
+
468
+ **YAML configuration key name:** `badge_provider_mode`<br/>
469
+ **Environment variable name:** `PACT_BROKER_BADGE_PROVIDER_MODE`<br/>
470
+ **Default:** `redirect`<br/>
471
+ **Allowed values:** `redirect`, `proxy`<br/>
472
+
473
+ ### enable_diagnostic_endpoints
474
+
475
+ Whether or not to enable the diagnostic endpoints at `/diagnostic/status/heartbeat` and `"diagnostic/status/dependencies`.
476
+ The heartbeat endpoint is for use by load balancers, and the dependencies endpoint is for checking that the database
477
+ is available (do not use this for load balancing, as it makes a database connection).
478
+
479
+ **YAML configuration key name:** `enable_diagnostic_endpoints`<br/>
480
+ **Environment variable name:** `PACT_BROKER_ENABLE_DIAGNOSTIC_ENDPOINTS`<br/>
481
+ **Default:** `true`<br/>
482
+ **Allowed values:** `true`, `false`<br/>
483
+
341
484
  <br/>
342
485
 
343
486
  ## Domain
@@ -359,6 +502,8 @@ or that the pacticipant should be created manually if it was intended to be a ne
359
502
  To turn this feature off, set `check_for_potential_duplicate_pacticipant_names` to `false`, and make sure everyone is very careful with their naming!
360
503
  The usefulness of the Broker depends on the integrity of the data, which in turn depends on the correctness of the pacticipant names.
361
504
 
505
+ **YAML configuration key name:** `check_for_potential_duplicate_pacticipant_names`<br/>
506
+ **Environment variable name:** `PACT_BROKER_CHECK_FOR_POTENTIAL_DUPLICATE_PACTICIPANT_NAMES`<br/>
362
507
  **Default:** `true`<br/>
363
508
  **Allowed values:** `true`, `false`<br/>
364
509
 
@@ -369,6 +514,9 @@ also created for the pacticipant version.
369
514
 
370
515
  This is to assist in the migration from using tags to track deployments to using the deployed and released versions feature.
371
516
 
517
+ **YAML configuration key name:** `create_deployed_versions_for_tags`<br/>
518
+ **Environment variable name:** `PACT_BROKER_CREATE_DEPLOYED_VERSIONS_FOR_TAGS`<br/>
519
+ **Supported versions:** From v2.81.0<br/>
372
520
  **Default:** `true`<br/>
373
521
  **Allowed values:** `true`, `false`<br/>
374
522
  **More information:** https://docs.pact.io/pact_broker/recording_deployments_and_releases/<br/>
@@ -380,9 +528,48 @@ will be used to populate the `branch` property of the version.
380
528
 
381
529
  This is to assist in the migration from using tags to track branches to using the branches feature.
382
530
 
531
+ **YAML configuration key name:** `use_first_tag_as_branch`<br/>
532
+ **Environment variable name:** `PACT_BROKER_USE_FIRST_TAG_AS_BRANCH`<br/>
533
+ **Supported versions:** From v2.82.0<br/>
534
+ **Default:** `true`<br/>
535
+ **Allowed values:** `true`, `false`<br/>
536
+
537
+ ### auto_detect_main_branch
538
+
539
+ When `true` and a pacticipant version is created with a tag or a branch that matches one of the names in `main_branch_candidates`,
540
+ the `mainBranch` property is set for that pacticipant if it is not already set.
541
+
542
+ This is to assist in the migration from using tags to track branches to using the branches feature.
543
+
544
+ **YAML configuration key name:** `auto_detect_main_branch`<br/>
545
+ **Environment variable name:** `PACT_BROKER_AUTO_DETECT_MAIN_BRANCH`<br/>
546
+ **Supported versions:** From v2.82.0<br/>
383
547
  **Default:** `true`<br/>
384
548
  **Allowed values:** `true`, `false`<br/>
385
549
 
550
+ ### main_branch_candidates
551
+
552
+ An array of potential main branch names used when automatically detecting the main branch for a pacticipant.
553
+
554
+ **YAML configuration key name:** `main_branch_candidates`<br/>
555
+ **Environment variable name:** `PACT_BROKER_MAIN_BRANCH_CANDIDATES`<br/>
556
+ **Supported versions:** From v2.82.0<br/>
557
+ **Format:** A space delimited list.<br/>
558
+ **Default:** `develop main master`<br/>
559
+
560
+ ### allow_dangerous_contract_modification
561
+
562
+ Whether or not to allow the pact content for an existing consumer version to be modified. It is strongly recommended that this is set to false,
563
+ as allowing modification makes the results of can-i-deploy unreliable. When this is set to false as recommended, each commit must publish pacts
564
+ with a unique version number.
565
+
566
+ **YAML configuration key name:** `allow_dangerous_contract_modification`<br/>
567
+ **Environment variable name:** `PACT_BROKER_ALLOW_DANGEROUS_CONTRACT_MODIFICATION`<br/>
568
+ **Supported versions:** From v2.82.0<br/>
569
+ **Default:** For new installations of v2.82.0 and later, this defaults to `false`.<br/>
570
+ **Allowed values:** `true`, `false`<br/>
571
+ **More information:** https://docs.pact.io/versioning<br/>
572
+
386
573
  <br/>
387
574
 
388
575
  ## Miscellaneous
@@ -394,5 +581,7 @@ This is to assist in the migration from using tags to track branches to using th
394
581
 
395
582
  A list of features to enable in the Pact Broker for beta testing before public release.
396
583
 
584
+ **YAML configuration key name:** `features`<br/>
585
+ **Environment variable name:** `PACT_BROKER_FEATURES`<br/>
397
586
  **Format:** A space separated list.<br/>
398
587