-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: support specifying team UUID when creating a webhook in Pactflow
- Loading branch information
Showing
13 changed files
with
400 additions
and
72 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
### A pact between Pact Broker Client and Pactflow | ||
|
||
#### Requests from Pact Broker Client to Pactflow | ||
|
||
* [A request for the index resource](#a_request_for_the_index_resource) | ||
|
||
* [A request to create a webhook for a team](#a_request_to_create_a_webhook_for_a_team_given_a_team_with_UUID_2abbc12a-427d-432a-a521-c870af1739d9_exists) given a team with UUID 2abbc12a-427d-432a-a521-c870af1739d9 exists | ||
|
||
#### Interactions | ||
|
||
<a name="a_request_for_the_index_resource"></a> | ||
Upon receiving **a request for the index resource** from Pact Broker Client, with | ||
```json | ||
{ | ||
"method": "get", | ||
"path": "/", | ||
"headers": { | ||
"Accept": "application/hal+json" | ||
} | ||
} | ||
``` | ||
Pactflow will respond with: | ||
```json | ||
{ | ||
"status": 200, | ||
"headers": { | ||
"Content-Type": "application/hal+json;charset=utf-8" | ||
}, | ||
"body": { | ||
"_links": { | ||
"pb:webhooks": { | ||
"href": "http://localhost:1235/HAL-REL-PLACEHOLDER-PB-WEBHOOKS" | ||
}, | ||
"pb:pacticipants": { | ||
"href": "http://localhost:1235/HAL-REL-PLACEHOLDER-PB-PACTICIPANTS" | ||
}, | ||
"pb:pacticipant": { | ||
"href": "http://localhost:1235/HAL-REL-PLACEHOLDER-PB-PACTICIPANT-{pacticipant}" | ||
} | ||
} | ||
} | ||
} | ||
``` | ||
<a name="a_request_to_create_a_webhook_for_a_team_given_a_team_with_UUID_2abbc12a-427d-432a-a521-c870af1739d9_exists"></a> | ||
Given **a team with UUID 2abbc12a-427d-432a-a521-c870af1739d9 exists**, upon receiving **a request to create a webhook for a team** from Pact Broker Client, with | ||
```json | ||
{ | ||
"method": "post", | ||
"path": "/HAL-REL-PLACEHOLDER-PB-WEBHOOKS", | ||
"headers": { | ||
"Content-Type": "application/json", | ||
"Accept": "application/hal+json" | ||
}, | ||
"body": { | ||
"description": "a webhook", | ||
"events": [ | ||
{ | ||
"name": "contract_content_changed" | ||
} | ||
], | ||
"request": { | ||
"url": "https://webhook", | ||
"method": "POST", | ||
"headers": { | ||
"Foo": "bar", | ||
"Bar": "foo" | ||
}, | ||
"body": { | ||
"some": "body" | ||
} | ||
}, | ||
"teamUuid": "2abbc12a-427d-432a-a521-c870af1739d9" | ||
} | ||
} | ||
``` | ||
Pactflow will respond with: | ||
```json | ||
{ | ||
"status": 201, | ||
"headers": { | ||
"Content-Type": "application/hal+json;charset=utf-8" | ||
}, | ||
"body": { | ||
"description": "a webhook", | ||
"teamUuid": "2abbc12a-427d-432a-a521-c870af1739d9", | ||
"_links": { | ||
"self": { | ||
"href": "http://localhost:1234/some-url", | ||
"title": "A title" | ||
} | ||
} | ||
} | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
### Pacts for Pact Broker Client | ||
|
||
* [Pact Broker](Pact%20Broker%20Client%20-%20Pact%20Broker.md) | ||
* [Pactflow](Pact%20Broker%20Client%20-%20Pactflow.md) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#!/bin/sh | ||
|
||
bundle exec bin/pact-broker create-webhook \ | ||
'https://api.github.com/repos/foo/bar/statuses/${pactbroker.consumerVersionNumber}' \ | ||
-X POST \ | ||
-H "Content-Type: application/json" \ | ||
-d '{ "state": "${pactbroker.githubVerificationStatus}", "description": "Pact Verification Tests ${pactbroker.providerVersionTags}", "context": "${pactbroker.providerName}", "target_url": "${pactbroker.verificationResultUrl}" }' \ | ||
--user username:password \ | ||
--description "Publish pact verification status to Github" \ | ||
--contract-published \ | ||
--provider-verification-published \ | ||
--team-uuid 4ac05ed8-9e3b-4159-96c0-ad19e3b93658 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1846,7 +1846,6 @@ | |
} | ||
], | ||
"request": { | ||
"url": null, | ||
"method": "POST", | ||
"headers": { | ||
"Foo": "bar", | ||
|
Oops, something went wrong.