Skip to content

Commit 80ccad5

Browse files
committed
feat: support 'contract_requiring_verification_published' event in webhook resource
1 parent 1e492f3 commit 80ccad5

File tree

2 files changed

+2
-16
lines changed

2 files changed

+2
-16
lines changed

docs/resources/webhook.md

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -6,21 +6,6 @@ Webhooks allow you to trigger an HTTP request when a pact is changed, a pact is
66

77
Webhooks can be used in conjunction with the [can-i-deploy](https://github.com/pact-foundation/pact_broker-client#can-i-deploy) tool \(a CLI that allows you to easily check the verification status of your pacts\), to allow you to fully automate the CI/CD process for all the applications that use the Pact Broker, ensuring both sides of the contract are fulfilled before deploying.
88

9-
### The 'contract content changed' event
10-
11-
The broker uses the following logic to determine if a pact has changed:
12-
13-
- If the relevant consumer version has any tags, then for each tag, check if the content is different from the previous latest version for that tag. It is 'changed' if any of the checks are true. One side effect of this is that brand new tags will trigger a pact changed event, even if the content is the same as a previous version.
14-
- If the relevant consumer version has no tags, then check if the content has changed since the previous latest version.
15-
16-
### The 'contract published' event
17-
18-
This is triggered every time a pact is published, regardless of whether it has changed or not.
19-
20-
### The 'verification published' event.
21-
22-
This is triggered every time a verification is published.
23-
249
See [Webhooks](http://docs.pact.io/pact_broker/advanced_topics/webhooks/) for more information on configuring Webhooks.
2510

2611
## Example Usage
@@ -69,7 +54,7 @@ From https://docs.pact.io/pact_broker/advanced_topics/api_docs/webhooks#creating
6954
7055
- `webhook_consumer` - (Optional, block) A consumer to scope events to. See [Pacticipant](#pacticipant) below for details. Omitting the consumer indicates the webhook should fire for all consumers.
7156
- `request` - (Required, block) The request to send when a webhook is fired. See [Request](#request) below for details.
72-
- `events` - (Required, list of strings) one of `contract_content_changed`, `contract_published`, `provider_verification_published`, `provider_verification_succeeded` or `provider_verification_failed` (see [Webhooks](http://docs.pact.io/pact_broker/advanced_topics/webhooks/) for more on this).
57+
- `events` - (Required, list of strings) one of `contract_requiring_verification_published`, `contract_content_changed`, `contract_published`, `provider_verification_published`, `provider_verification_succeeded` or `provider_verification_failed` (see [Webhooks](http://docs.pact.io/pact_broker/advanced_topics/webhooks/) for more on this).
7358
- `team` - (Optional, string) The uuid of the team to assign to the webhook.
7459

7560
<a id="pacticipant"></a>

resource_webhook.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ var allowedEvents = []string{
2222
"provider_verification_failed",
2323
"provider_verification_published",
2424
"provider_verification_succeeded",
25+
"contract_requiring_verification_published",
2526
}
2627

2728
var pacticipantType = &schema.Schema{

0 commit comments

Comments
 (0)