Skip to content

Commit

Permalink
Merge branch 'master' into feat/can-i-merge
Browse files Browse the repository at this point in the history
  • Loading branch information
bethesque authored Aug 1, 2023
2 parents f8949f6 + 4feba6f commit fc91e85
Show file tree
Hide file tree
Showing 40 changed files with 508 additions and 68 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/release_gem.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-ruby@v1
- uses: actions/checkout@v3
- uses: ruby/setup-ruby@v1
with:
ruby-version: '2.6'
ruby-version: '3.2'
- run: |
gem install bundler -v 2.1
gem install bundler -v 2.4
bundle install
- name: Test
run: bundle exec rake
Expand All @@ -28,7 +28,7 @@ jobs:
version: ${{ steps.release.outputs.version }}
increment: ${{ steps.release.outputs.increment }}
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: pact-foundation/[email protected]
Expand Down
11 changes: 11 additions & 0 deletions .github/workflows/smartbear-issue-label-added.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: SmartBear Supported Issue Label Added

on:
issues:
types:
- labeled

jobs:
call-workflow:
uses: pact-foundation/.github/.github/workflows/smartbear-issue-label-added.yml@master
secrets: inherit
13 changes: 6 additions & 7 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,14 @@ on: [push, pull_request]

jobs:
test:
runs-on: "ubuntu-latest"
continue-on-error: ${{ matrix.experimental }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
ruby_version: ["2.7", "3.0", "3.1"]
experimental: [false]
ruby_version: ["2.7", "3.0", "3.1", "3.2"]
os: ["ubuntu-latest","windows-latest","macos-latest"]
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby_version }}
Expand All @@ -26,10 +25,10 @@ jobs:
matrix:
feature: [""]
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- uses: ruby/setup-ruby@v1
with:
ruby-version: "2.7"
ruby-version: "3.2"
- run: "bundle install"
- run: |
rm -rf spec/pacts/*
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/trigger_pact_docs_update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ on:
repository_dispatch:
types:
- gem-released
workflow_dispatch:

jobs:
build:
Expand Down
2 changes: 1 addition & 1 deletion .ruby-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.7
3.2
52 changes: 51 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,53 @@
<a name="v1.68.0"></a>
### v1.68.0 (2023-07-08)

#### Features

* support Cirrus CI environment ([7610f28](/../../commit/7610f28))

#### Bug Fixes

* pact-broker --help command failed with Could not find command "__broker_base_url" (#135) ([7edfd58](/../../commit/7edfd58))

<a name="v1.67.0"></a>
### v1.67.0 (2023-05-04)

#### Features

* colour first url in magenta for ease of reading ([90e8f51](/../../commit/90e8f51))
* output provider contract link on publish (#118) ([132b024](/../../commit/132b024))
* add helper text for Docker usage when pact file not found ([2aab2d5](/../../commit/2aab2d5))

#### Bug Fixes

* trim trailing slash from base url ([ccd6417](/../../commit/ccd6417))
* do not allow an empty environment name to be used in the can-i-deploy command ([a3bfe8a](/../../commit/a3bfe8a))

<a name="v1.66.1"></a>
### v1.66.1 (2023-01-11)

#### Bug Fixes

* **deps**
* update httparty for https://github.com/jnunemaker/httparty/security/advisories/GHSA-5pq7-52mg-hr42 ([08597c2](/../../commit/08597c2))

<a name="v1.66.0"></a>
### v1.66.0 (2022-12-01)

#### Features

* **can-i-deploy**
* support specifying --ignore using the environment variable PACT_BROKER_CAN_I_DEPLOY_IGNORE ([04a0894](/../../commit/04a0894))

* refactor can-i-deploy to use HAL Client instead of HTTParty ([d21efe6](/../../commit/d21efe6))

#### Bug Fixes

* found the missing computer arm when computer says no (#120) ([7b8ea24](/../../commit/7b8ea24))

* **publish-provider-contract**
* raise validation error when pact broker base URL is missing or blank ([2d719c3](/../../commit/2d719c3))

<a name="v1.65.0"></a>
### v1.65.0 (2022-06-24)

Expand Down Expand Up @@ -189,7 +239,7 @@

#### Features

* support specifying team UUID when creating a webhook in Pactflow ([c4201e1](/../../commit/c4201e1))
* support specifying team UUID when creating a webhook in PactFlow ([c4201e1](/../../commit/c4201e1))

<a name="v1.45.0"></a>
### v1.45.0 (2021-06-16)
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ruby:3.1-alpine
FROM ruby:3.2-alpine

RUN apk add --no-cache -X http://dl-cdn.alpinelinux.org/alpine/edge/testing hub
RUN apk add --update --no-cache git openssh bash
Expand Down
31 changes: 22 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Pact Broker Client

A client for the [Pact Broker](https://docs.pact.io/pact_broker/) and [Pactflow](https://pactflow.io/?utm_source=ossdocs&utm_campaign=pact_broker_client_readme). Publishes and retrieves pacts, pacticipants, pacticipant versions, environments, deployments and releases. Supports publishing provider contracts for Pactflow. The functionality is available via a CLI, or via Ruby Rake tasks. You can also use the [Pact CLI Docker image](https://hub.docker.com/r/pactfoundation/pact-cli).
A client for the [Pact Broker](https://docs.pact.io/pact_broker/) and [PactFlow](https://pactflow.io/?utm_source=ossdocs&utm_campaign=pact_broker_client_readme). Publishes and retrieves pacts, pacticipants, pacticipant versions, environments, deployments and releases. Supports publishing provider contracts for PactFlow. The functionality is available via a CLI, or via Ruby Rake tasks. You can also use the [Pact CLI Docker image](https://hub.docker.com/r/pactfoundation/pact-cli).

![Build status](https://github.com/pact-foundation/pact_broker-client/workflows/Test/badge.svg)

Expand Down Expand Up @@ -32,15 +32,15 @@ To connect to a Pact Broker that uses custom SSL cerificates, set the environmen

## Usage - CLI

All commands prefixed with `pact-broker` can be used with the OSS Pact Broker and Pactflow. Commands prefixed with `pactflow` can only be used with Pactflow.
All commands prefixed with `pact-broker` can be used with the OSS Pact Broker and PactFlow. Commands prefixed with `pactflow` can only be used with PactFlow.

The Pact Broker base URL can be specified either using the environment variable `$PACT_BROKER_BASE_URL` or the `-b` or `--broker-base-url` parameters.

Pact Broker authentication can be performed either using basic auth or a bearer token.

Basic auth parameters can be specified using the `$PACT_BROKER_USERNAME` and `$PACT_BROKER_PASSWORD` environment variables, or the `-u` or `--broker-username` and `-p` or `--broker-password` parameters.

Authentication using a bearer token can be specified using the environment variable `$PACT_BROKER_TOKEN` or the `-k` or `--broker-token` parameters. This bearer token authentication is used by [Pactflow](https://pactflow.io) and is not available in the [OSS Pact Broker](https://docs.pact.io/pact_broker/), which only supports basic auth.
Authentication using a bearer token can be specified using the environment variable `$PACT_BROKER_TOKEN` or the `-k` or `--broker-token` parameters. This bearer token authentication is used by [PactFlow](https://pactflow.io) and is not available in the [OSS Pact Broker](https://docs.pact.io/pact_broker/), which only supports basic auth.


<!-- start-autogenerated-docs -->
Expand Down Expand Up @@ -434,6 +434,13 @@ Options:
-e, [--version=VERSION]
# The pacticipant version. Must be entered after the
--pacticipant that it relates to.
[--ignore=IGNORE]
# The pacticipant name to ignore. Use once for each pacticipant
being ignored. A specific version can be ignored by also
specifying a --version after the pacticipant name option. The
environment variable PACT_BROKER_CAN_I_DEPLOY_IGNORE may also
be used to specify a pacticipant name to ignore, with commas to
separate multiple pacticipant names if necessary.
-l, [--latest=[TAG]]
# Use the latest pacticipant version. Optionally specify a TAG
to use the latest version with the specified tag.
Expand Down Expand Up @@ -523,6 +530,12 @@ Description:

$ pact-broker can-i-deploy --pacticipant Foo 173153ae0 \ --pacticipant Bar --latest main

##### Polling

If the verification process takes a long time and there are results missing when the can-i-deploy command runs in your CI/CD pipeline, you can configure the
command to poll and wait for the missing results to arrive. The arguments to specify are `--retry-while-unknown TIMES` and `--retry-interval SECONDS`, set to
appropriate values for your pipeline.

### Pacticipants

#### create-or-update-pacticipant
Expand Down Expand Up @@ -651,8 +664,8 @@ Options:
# Trigger this webhook when a contract is published that
requires verification
[--team-uuid=UUID]
# UUID of the Pactflow team to which the webhook should be
assigned (Pactflow only)
# UUID of the PactFlow team to which the webhook should be
assigned (PactFlow only)
-b, --broker-base-url=BROKER_BASE_URL
# The base URL of the Pact Broker
-u, [--broker-username=BROKER_USERNAME]
Expand Down Expand Up @@ -714,8 +727,8 @@ Options:
# Trigger this webhook when a contract is published that
requires verification
[--team-uuid=UUID]
# UUID of the Pactflow team to which the webhook should be
assigned (Pactflow only)
# UUID of the PactFlow team to which the webhook should be
assigned (PactFlow only)
-b, --broker-base-url=BROKER_BASE_URL
# The base URL of the Pact Broker
-u, [--broker-username=BROKER_USERNAME]
Expand Down Expand Up @@ -876,7 +889,7 @@ Options:

Generate a UUID for use when calling create-or-update-webhook

### Provider contracts (Pactflow only)
### Provider contracts (PactFlow only)

#### publish-provider-contract

Expand Down Expand Up @@ -932,7 +945,7 @@ Options:
# Verbose output. Default: false
```

Publish provider contract to Pactflow
Publish provider contract to PactFlow

<!-- end-autogenerated-docs -->

Expand Down
51 changes: 47 additions & 4 deletions doc/pacts/markdown/Pact Broker Client - Pactflow.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
### A pact between Pact Broker Client and Pactflow
### A pact between Pact Broker Client and PactFlow

#### Requests from Pact Broker Client to 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 provider contract](#a_request_to_create_a_provider_contract)

* [A request to create a provider contract](#a_request_to_create_a_provider_contract_given_there_is_a_pf:ui_href_in_the_response) given there is a pf:ui href in the response

* [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
Expand All @@ -21,7 +23,7 @@ Upon receiving **a request for the index resource** from Pact Broker Client, wit
}
}
```
Pactflow will respond with:
PactFlow will respond with:
```json
{
"status": 200,
Expand Down Expand Up @@ -68,12 +70,53 @@ Upon receiving **a request to create a provider contract** from Pact Broker Clie
}
}
```
PactFlow will respond with:
```json
{
"status": 201,
"headers": {
"Content-Type": "application/hal+json;charset=utf-8"
}
}
```
<a name="a_request_to_create_a_provider_contract_given_there_is_a_pf:ui_href_in_the_response"></a>
Given **there is a pf:ui href in the response**, upon receiving **a request to create a provider contract** from Pact Broker Client, with
```json
{
"method": "put",
"path": "/contracts/provider/Bar/version/1",
"headers": {
"Content-Type": "application/json",
"Accept": "application/hal+json"
},
"body": {
"content": "LS0tCjpzb21lOiBjb250cmFjdAo=",
"contractType": "oas",
"contentType": "application/yaml",
"verificationResults": {
"success": true,
"content": "c29tZSByZXN1bHRz",
"contentType": "text/plain",
"format": "text",
"verifier": "my custom tool",
"verifierVersion": "1.0"
}
}
}
```
Pactflow will respond with:
```json
{
"status": 201,
"headers": {
"Content-Type": "application/hal+json;charset=utf-8"
},
"body": {
"_links": {
"pf:ui": {
"href": "http://localhost:1235/contracts/bi-directional/provider/Bar/version/1/provider-contract"
}
}
}
}
```
Expand Down Expand Up @@ -109,7 +152,7 @@ Given **a team with UUID 2abbc12a-427d-432a-a521-c870af1739d9 exists**, upon rec
}
}
```
Pactflow will respond with:
PactFlow will respond with:
```json
{
"status": 201,
Expand Down
2 changes: 1 addition & 1 deletion doc/pacts/markdown/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
### Pacts for Pact Broker Client

* [Pact Broker](Pact%20Broker%20Client%20-%20Pact%20Broker.md)
* [Pactflow](Pact%20Broker%20Client%20-%20Pactflow.md)
* [PactFlow](Pact%20Broker%20Client%20-%20Pactflow.md)
Loading

0 comments on commit fc91e85

Please sign in to comment.