Showcase Consumer-Driven & Bi-Directional Contract Testing working together.
The main aim of this workflow is to show how BDCT/CDCT can be used to the same consumer/provider pair, provide a dual safety net.
It also provides a secondary function, which is to show how you can utilise an OpenAPI specification, to get early feedback at design-time, and for the best authoring experience, storing the OpenAPI spec master in SwaggerHub, and syncing it back to this project
This PR includes a GitHub Actions workflow ./github/workflows/ProviderDesignFeedback.yml
Changes in oas/** folder are detected, on swaggerhub* branch or design-candidate
oas/openapi.yaml is uploaded to Pactflow, as pactflow-example-provider representing our Product Provider API with a unique version number consisting of the OpenAPI Version + Commit SHA + design
The specification is checked against any deployed or released consumers and their respective head of the main branches, registered with the provider.
Click the API name, switch to the Integrations tab, and click Add New Integrations:
Select GitHub Sync.
In the subsequent dialog, specify the integration parameters:
Name – Required. A display name for the integration. gh-design-to-pactflow
GitHub Token – Required. The GitHub access token that SwaggerHub will use to access the target GitHub repository.
The easiest way to get the token is to click Connect to GitHub and allow SwaggerHub to retrieve information from your GitHub account:
Click Next in the GitHub Token edit box to continue. SwaggerHub will validate the token and then display other parameters.
Repository Owner – Select you GitHub user or organization that owns the repository where you forked this example provider project
Repository – Select the forked example-provider project
Sync Method – Select the synchronization type: Basic Sync
Branch – Required. The repository branch to push the code to. If this branch does not exist, it will be created based on the repository’s default branch. Choose swaggerhub
Generated API Code – Required. Select what you want to generate: YAML(Resolved)
Showcase Consumer-Driven & Bi-Directional Contract Testing working together.
./github/workflows/ProviderDesignFeedback.yml
oas/**
folder are detected, onswaggerhub*
branch ordesign-candidate
oas/openapi.yaml
is uploaded to Pactflow, aspactflow-example-provider
representing our Product Provider API with a unique version number consisting of the OpenAPI Version + Commit SHA +design
This can also be linked up with SwaggerHub
gh-design-to-pactflow
Basic Sync
swaggerhub
YAML(Resolved)
oas
openapi.yaml
Create And Execute
->Done
.