Giter Club home page Giter Club logo

pact_broker-client's Introduction

Pact Broker Client

A client for the Pact Broker and PactFlow. 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.

Build status

Gem Version

Trigger update to docs.pact.io

Installation

Docker

The Pact Broker CLI is packaged with the other Ruby command line tools in the pactfoundation/pact-cli Docker image.

docker pull pactfoundation/pact-cli:latest

Standalone executable

Download the latest pact-ruby-standalone package. You do not need Ruby to run the CLI, as the Ruby runtime is packaged with the executable using Travelling Ruby.

Ruby

Add gem 'pact_broker-client' to your Gemfile and run bundle install, or install the gem directly by running gem install pact_broker-client.

Connecting to a Pact Broker with a self signed certificate

To connect to a Pact Broker that uses custom SSL cerificates, set the environment variable $SSL_CERT_FILE or $SSL_CERT_DIR to a path that contains the appropriate certificate. Read more at https://docs.pact.io/pact_broker/advanced_topics/using-tls#for-non-jvm

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.

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 and is not available in the OSS Pact Broker, which only supports basic auth.

Handling unknown options

By default, the underlying library used for the Pact Broker CLI (Thor) does not raise an error in every situation where there is an unknown option used. This can allow invalid commands to be executed that do not perform as expected.

From version 1.73.0, warnings will be printed for unknown options, and if the environment variable PACT_BROKER_ERROR_ON_UNKNOWN_OPTION=true is set, an error will be raised when an unknown option is used.

In the next major version, an error will be raised by default.

Pacts

publish

Usage:
  pact-broker publish PACT_DIRS_OR_FILES ... -b, --broker-base-url=BROKER_BASE_URL

Options:
  -a, [--consumer-app-version=CONSUMER_APP_VERSION]
              # The consumer application version
  -h, [--branch=BRANCH]
              # Repository branch of the consumer version
  -r, [--auto-detect-version-properties], [--no-auto-detect-version-properties]
              # Automatically detect the repository commit, branch and build
                URL from known CI environment variables or git CLI. Supports
                Buildkite, Circle CI, Travis CI, GitHub Actions, Jenkins,
                Hudson, AppVeyor, GitLab, CodeShip, Bitbucket and Azure DevOps.
              # Default: false
  -t, [--tag=TAG]
              # Tag name for consumer version. Can be specified multiple
                times.
  -g, [--tag-with-git-branch], [--no-tag-with-git-branch]
              # Tag consumer version with the name of the current git branch.
                Supports Buildkite, Circle CI, Travis CI, GitHub Actions,
                Jenkins, Hudson, AppVeyor, GitLab, CodeShip, Bitbucket and
                Azure DevOps.
              # Default: false
      [--build-url=BUILD_URL]
              # The build URL that created the pact
      [--merge], [--no-merge]
              # If a pact already exists for this consumer version and
                provider, merge the contents. Useful when running Pact tests
                concurrently on different build nodes.
              # Default: false
  -o, [--output=OUTPUT]
              # json or text
              # Default: text
  -b, --broker-base-url=BROKER_BASE_URL
              # The base URL of the Pact Broker
  -u, [--broker-username=BROKER_USERNAME]
              # Pact Broker basic auth username
  -p, [--broker-password=BROKER_PASSWORD]
              # Pact Broker basic auth password
  -k, [--broker-token=BROKER_TOKEN]
              # Pact Broker bearer token
  -v, [--verbose], [--no-verbose]
              # Verbose output.
              # Default: false

Publish pacts to a Pact Broker.

list-latest-pact-versions

Usage:
  pact-broker list-latest-pact-versions -b, --broker-base-url=BROKER_BASE_URL

Options:
  -b, --broker-base-url=BROKER_BASE_URL
              # The base URL of the Pact Broker
  -u, [--broker-username=BROKER_USERNAME]
              # Pact Broker basic auth username
  -p, [--broker-password=BROKER_PASSWORD]
              # Pact Broker basic auth password
  -k, [--broker-token=BROKER_TOKEN]
              # Pact Broker bearer token
  -v, [--verbose], [--no-verbose]
              # Verbose output.
              # Default: false
  -o, [--output=OUTPUT]
              # json or table
              # Default: table

List the latest pact for each integration

Environments

create-environment

Usage:
  pact-broker create-environment --name=NAME -b, --broker-base-url=BROKER_BASE_URL

Options:
      --name=NAME
              # The uniquely identifying name of the environment as used in
                deployment code
      [--display-name=DISPLAY_NAME]
              # The display name of the environment
      [--production], [--no-production]
              # Whether or not this environment is a production environment.
                This is currently informational only.
              # Default: false
      [--contact-name=CONTACT_NAME]
              # The name of the team/person responsible for this environment
      [--contact-email-address=CONTACT_EMAIL_ADDRESS]
              # The email address of the team/person responsible for this
                environment
  -o, [--output=OUTPUT]
              # json or text
              # Default: text
  -b, --broker-base-url=BROKER_BASE_URL
              # The base URL of the Pact Broker
  -u, [--broker-username=BROKER_USERNAME]
              # Pact Broker basic auth username
  -p, [--broker-password=BROKER_PASSWORD]
              # Pact Broker basic auth password
  -k, [--broker-token=BROKER_TOKEN]
              # Pact Broker bearer token
  -v, [--verbose], [--no-verbose]
              # Verbose output.
              # Default: false

Create an environment resource in the Pact Broker to represent a real world deployment or release environment.

update-environment

Usage:
  pact-broker update-environment --uuid=UUID -b, --broker-base-url=BROKER_BASE_URL

Options:
      --uuid=UUID
              # The UUID of the environment to update
      [--name=NAME]
              # The uniquely identifying name of the environment as used in
                deployment code
      [--display-name=DISPLAY_NAME]
              # The display name of the environment
      [--production], [--no-production]
              # Whether or not this environment is a production environment.
                This is currently informational only.
              # Default: false
      [--contact-name=CONTACT_NAME]
              # The name of the team/person responsible for this environment
      [--contact-email-address=CONTACT_EMAIL_ADDRESS]
              # The email address of the team/person responsible for this
                environment
  -o, [--output=OUTPUT]
              # json or text
              # Default: text
  -b, --broker-base-url=BROKER_BASE_URL
              # The base URL of the Pact Broker
  -u, [--broker-username=BROKER_USERNAME]
              # Pact Broker basic auth username
  -p, [--broker-password=BROKER_PASSWORD]
              # Pact Broker basic auth password
  -k, [--broker-token=BROKER_TOKEN]
              # Pact Broker bearer token
  -v, [--verbose], [--no-verbose]
              # Verbose output.
              # Default: false

Update an environment resource in the Pact Broker.

describe-environment

Usage:
  pact-broker describe-environment --uuid=UUID -b, --broker-base-url=BROKER_BASE_URL

Options:
      --uuid=UUID
              # The UUID of the environment to describe
  -o, [--output=OUTPUT]
              # json or text
              # Default: text
  -b, --broker-base-url=BROKER_BASE_URL
              # The base URL of the Pact Broker
  -u, [--broker-username=BROKER_USERNAME]
              # Pact Broker basic auth username
  -p, [--broker-password=BROKER_PASSWORD]
              # Pact Broker basic auth password
  -k, [--broker-token=BROKER_TOKEN]
              # Pact Broker bearer token
  -v, [--verbose], [--no-verbose]
              # Verbose output.
              # Default: false

Describe an environment

delete-environment

Usage:
  pact-broker delete-environment --uuid=UUID -b, --broker-base-url=BROKER_BASE_URL

Options:
      --uuid=UUID
              # The UUID of the environment to delete
  -o, [--output=OUTPUT]
              # json or text
              # Default: text
  -b, --broker-base-url=BROKER_BASE_URL
              # The base URL of the Pact Broker
  -u, [--broker-username=BROKER_USERNAME]
              # Pact Broker basic auth username
  -p, [--broker-password=BROKER_PASSWORD]
              # Pact Broker basic auth password
  -k, [--broker-token=BROKER_TOKEN]
              # Pact Broker bearer token
  -v, [--verbose], [--no-verbose]
              # Verbose output.
              # Default: false

Delete an environment

list-environments

Usage:
  pact-broker list-environments -b, --broker-base-url=BROKER_BASE_URL

Options:
  -o, [--output=OUTPUT]
              # json or text
              # Default: text
  -b, --broker-base-url=BROKER_BASE_URL
              # The base URL of the Pact Broker
  -u, [--broker-username=BROKER_USERNAME]
              # Pact Broker basic auth username
  -p, [--broker-password=BROKER_PASSWORD]
              # Pact Broker basic auth password
  -k, [--broker-token=BROKER_TOKEN]
              # Pact Broker bearer token
  -v, [--verbose], [--no-verbose]
              # Verbose output.
              # Default: false

List environments

Deployments

record-deployment

Usage:
  pact-broker record-deployment --environment=ENVIRONMENT -a, --pacticipant=PACTICIPANT -b, --broker-base-url=BROKER_BASE_URL -e, --version=VERSION

Options:
  -a, --pacticipant=PACTICIPANT
              # The name of the pacticipant that was deployed.
  -e, --version=VERSION
              # The pacticipant version number that was deployed.
      --environment=ENVIRONMENT
              # The name of the environment that the pacticipant version was
                deployed to.
      [--application-instance=APPLICATION_INSTANCE]
              # Optional. The application instance to which the deployment has
                occurred - a logical identifer required to differentiate
                deployments when there are multiple instances of the same
                application in an environment. This field was called 'target'
                in a beta release.
      [--target=TARGET]
              # Renamed to application_instance
  -o, [--output=OUTPUT]
              # json or text
              # Default: text
  -b, --broker-base-url=BROKER_BASE_URL
              # The base URL of the Pact Broker
  -u, [--broker-username=BROKER_USERNAME]
              # Pact Broker basic auth username
  -p, [--broker-password=BROKER_PASSWORD]
              # Pact Broker basic auth password
  -k, [--broker-token=BROKER_TOKEN]
              # Pact Broker bearer token
  -v, [--verbose], [--no-verbose]
              # Verbose output.
              # Default: false

Record deployment of a pacticipant version to an environment. See https://docs.pact.io/record-deployment for more information.

record-undeployment

Usage:
  pact-broker record-undeployment --environment=ENVIRONMENT -a, --pacticipant=PACTICIPANT -b, --broker-base-url=BROKER_BASE_URL

Options:
  -a, --pacticipant=PACTICIPANT
              # The name of the pacticipant that was undeployed.
      --environment=ENVIRONMENT
              # The name of the environment that the pacticipant version was
                undeployed from.
      [--application-instance=APPLICATION_INSTANCE]
              # Optional. The application instance from which the application
                is being undeployed - a logical identifer required to
                differentiate deployments when there are multiple instances of
                the same application in an environment. This field was called
                'target' in a beta release.
      [--target=TARGET]
              # Optional. The target that the application is being undeployed
                from - a logical identifer required to differentiate
                deployments when there are multiple instances of the same
                application in an environment.
  -o, [--output=OUTPUT]
              # json or text
              # Default: text
  -b, --broker-base-url=BROKER_BASE_URL
              # The base URL of the Pact Broker
  -u, [--broker-username=BROKER_USERNAME]
              # Pact Broker basic auth username
  -p, [--broker-password=BROKER_PASSWORD]
              # Pact Broker basic auth password
  -k, [--broker-token=BROKER_TOKEN]
              # Pact Broker bearer token
  -v, [--verbose], [--no-verbose]
              # Verbose output.
              # Default: false

Description: Note that use of this command is only required if you are permanently removing an application instance from an environment. It is not required if you are deploying over a previous version, as record-deployment will automatically mark the previously deployed version as undeployed for you. See https://docs.pact.io/record-undeployment for more information.

Releases

record-release

Usage:
  pact-broker record-release --environment=ENVIRONMENT -a, --pacticipant=PACTICIPANT -b, --broker-base-url=BROKER_BASE_URL -e, --version=VERSION

Options:
  -a, --pacticipant=PACTICIPANT
              # The name of the pacticipant that was released.
  -e, --version=VERSION
              # The pacticipant version number that was released.
      --environment=ENVIRONMENT
              # The name of the environment that the pacticipant version was
                released to.
  -o, [--output=OUTPUT]
              # json or text
              # Default: text
  -b, --broker-base-url=BROKER_BASE_URL
              # The base URL of the Pact Broker
  -u, [--broker-username=BROKER_USERNAME]
              # Pact Broker basic auth username
  -p, [--broker-password=BROKER_PASSWORD]
              # Pact Broker basic auth password
  -k, [--broker-token=BROKER_TOKEN]
              # Pact Broker bearer token
  -v, [--verbose], [--no-verbose]
              # Verbose output.
              # Default: false

Record release of a pacticipant version to an environment. See See https://docs.pact.io/record-release for more information.

record-support-ended

Usage:
  pact-broker record-support-ended --environment=ENVIRONMENT -a, --pacticipant=PACTICIPANT -b, --broker-base-url=BROKER_BASE_URL -e, --version=VERSION

Options:
  -a, --pacticipant=PACTICIPANT
              # The name of the pacticipant.
  -e, --version=VERSION
              # The pacticipant version number for which support is ended.
      --environment=ENVIRONMENT
              # The name of the environment in which the support is ended.
  -o, [--output=OUTPUT]
              # json or text
              # Default: text
  -b, --broker-base-url=BROKER_BASE_URL
              # The base URL of the Pact Broker
  -u, [--broker-username=BROKER_USERNAME]
              # Pact Broker basic auth username
  -p, [--broker-password=BROKER_PASSWORD]
              # Pact Broker basic auth password
  -k, [--broker-token=BROKER_TOKEN]
              # Pact Broker bearer token
  -v, [--verbose], [--no-verbose]
              # Verbose output.
              # Default: false

Record the end of support for a pacticipant version in an environment. See https://docs.pact.io/record-support-ended for more information.

Matrix

can-i-deploy

Usage:
  pact-broker can-i-deploy -a, --pacticipant=PACTICIPANT -b, --broker-base-url=BROKER_BASE_URL

Options:
  -a, --pacticipant=PACTICIPANT
              # The pacticipant name. Use once for each pacticipant being
                checked.
  -e, [--version=VERSION]
              # The pacticipant version. Must be entered after the
                --pacticipant that it relates to.
      [--ignore=PACTICIPANT]
              # 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.
      [--branch=BRANCH]
              # The branch of the version for which you want to check the
                verification results.
      [--main-branch], [--no-main-branch]
              # Use the latest version of the configured main branch of the
                pacticipant as the version for which you want to check the
                verification results
              # Default: false
      [--to-environment=ENVIRONMENT]
              # The environment into which the pacticipant(s) are to be
                deployed
      [--to=TAG]
              # The tag that represents the branch or environment of the
                integrated applications for which you want to check the
                verification result status.
  -o, [--output=OUTPUT]
              # json or table
              # Default: table
      [--retry-while-unknown=TIMES]
              # The number of times to retry while there is an unknown
                verification result (ie. the provider verification is likely
                still running)
              # Default: 0
      [--retry-interval=SECONDS]
              # The time between retries in seconds. Use in conjuction with
                --retry-while-unknown
              # Default: 10
      [--dry-run], [--no-dry-run]
              # When dry-run is enabled, always exit process with a success
                code. Can also be enabled by setting the environment variable
                PACT_BROKER_CAN_I_DEPLOY_DRY_RUN=true. This mode is useful when
                setting up your CI/CD pipeline for the first time, or in a
                'break glass' situation where you need to knowingly deploy what
                Pact considers a breaking change. For the second scenario, it
                is recommended to use the environment variable and just set it
                for the build required to deploy that particular version, so
                you don't accidentally leave the dry run mode enabled.
              # Default: false
  -b, --broker-base-url=BROKER_BASE_URL
              # The base URL of the Pact Broker
  -u, [--broker-username=BROKER_USERNAME]
              # Pact Broker basic auth username
  -p, [--broker-password=BROKER_PASSWORD]
              # Pact Broker basic auth password
  -k, [--broker-token=BROKER_TOKEN]
              # Pact Broker bearer token
  -v, [--verbose], [--no-verbose]
              # Verbose output.
              # Default: false

Description: Returns exit code 0 or 1, indicating whether or not the specified application (pacticipant) has a successful verification result with each of the application versions that are already deployed to a particular environment. Prints out the relevant pact/verification details, indicating any missing or failed verification results.

The can-i-deploy tool was originally written to support specifying versions and dependencies using tags. This usage has now been superseded by first class support for environments, deployments and releases. For documentation on how to use can-i-deploy with tags, please see https://docs.pact.io/pact_broker/client_cli/can_i_deploy_usage_with_tags/

Before can-i-deploy can be used, the relevant environment resources must first be created in the Pact Broker using the create-environment command. The "test" and "production" environments will have been seeded for you. You can check the existing environments by running pact-broker list-environments. See https://docs.pact.io/pact_broker/client_cli/readme#environments for more information.

$ pact-broker create-environment --name "uat" --display-name "UAT" --no-production

After an application is deployed or released, its deployment must be recorded using the record-deployment or record-release commands. See https://docs.pact.io/pact_broker/recording_deployments_and_releases/ for more information.

$ pact-broker record-deployment --pacticipant Foo --version 173153ae0 --environment uat

Before an application is deployed or released to an environment, the can-i-deploy command must be run to check that the application version is safe to deploy with the versions of each integrated application that are already in that environment.

$ pact-broker can-i-deploy --pacticipant PACTICIPANT --version VERSION --to-environment ENVIRONMENT

Example: can I deploy version 173153ae0 of application Foo to the test environment?

$ pact-broker can-i-deploy --pacticipant Foo --version 173153ae0 --to-environment test

Can-i-deploy can also be used to check if arbitrary versions have a successful verification. When asking "Can I deploy this application version with the latest version from the main branch of another application" it functions as a "can I merge" check.

$ 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.

can-i-merge

Usage:
  pact-broker can-i-merge -a, --pacticipant=PACTICIPANT -b, --broker-base-url=BROKER_BASE_URL

Options:
  -a, --pacticipant=PACTICIPANT
              # The pacticipant name. Use once for each pacticipant being
                checked.
  -e, [--version=VERSION]
              # The pacticipant version. Must be entered after the
                --pacticipant that it relates to.
  -o, [--output=OUTPUT]
              # json or table
              # Default: table
      [--retry-while-unknown=TIMES]
              # The number of times to retry while there is an unknown
                verification result (ie. the provider verification is likely
                still running)
              # Default: 0
      [--retry-interval=SECONDS]
              # The time between retries in seconds. Use in conjuction with
                --retry-while-unknown
              # Default: 10
      [--dry-run], [--no-dry-run]
              # When dry-run is enabled, always exit process with a success
                code. Can also be enabled by setting the environment variable
                PACT_BROKER_CAN_I_MERGE_DRY_RUN=true. This mode is useful when
                setting up your CI/CD pipeline for the first time, or in a
                'break glass' situation where you need to knowingly deploy what
                Pact considers a breaking change. For the second scenario, it
                is recommended to use the environment variable and just set it
                for the build required to deploy that particular version, so
                you don't accidentally leave the dry run mode enabled.
              # Default: false
  -b, --broker-base-url=BROKER_BASE_URL
              # The base URL of the Pact Broker
  -u, [--broker-username=BROKER_USERNAME]
              # Pact Broker basic auth username
  -p, [--broker-password=BROKER_PASSWORD]
              # Pact Broker basic auth password
  -k, [--broker-token=BROKER_TOKEN]
              # Pact Broker bearer token
  -v, [--verbose], [--no-verbose]
              # Verbose output.
              # Default: false

Description: Checks if the specified pacticipant version is compatible with the configured main branch of each of the pacticipants with which it is integrated.

Pacticipants

create-or-update-pacticipant

Usage:
  pact-broker create-or-update-pacticipant --name=NAME -b, --broker-base-url=BROKER_BASE_URL

Options:
      --name=NAME
              # Pacticipant name
      [--display-name=DISPLAY_NAME]
              # Display name
      [--main-branch=MAIN_BRANCH]
              # The main development branch of the pacticipant repository
      [--repository-url=REPOSITORY_URL]
              # The repository URL of the pacticipant
  -o, [--output=OUTPUT]
              # json or text
              # Default: text
  -b, --broker-base-url=BROKER_BASE_URL
              # The base URL of the Pact Broker
  -u, [--broker-username=BROKER_USERNAME]
              # Pact Broker basic auth username
  -p, [--broker-password=BROKER_PASSWORD]
              # Pact Broker basic auth password
  -k, [--broker-token=BROKER_TOKEN]
              # Pact Broker bearer token
  -v, [--verbose], [--no-verbose]
              # Verbose output.
              # Default: false

Create or update pacticipant by name

describe-pacticipant

Usage:
  pact-broker describe-pacticipant --name=NAME -b, --broker-base-url=BROKER_BASE_URL

Options:
      --name=NAME
              # Pacticipant name
  -o, [--output=OUTPUT]
              # json or text
              # Default: text
  -b, --broker-base-url=BROKER_BASE_URL
              # The base URL of the Pact Broker
  -u, [--broker-username=BROKER_USERNAME]
              # Pact Broker basic auth username
  -p, [--broker-password=BROKER_PASSWORD]
              # Pact Broker basic auth password
  -k, [--broker-token=BROKER_TOKEN]
              # Pact Broker bearer token
  -v, [--verbose], [--no-verbose]
              # Verbose output.
              # Default: false

Describe a pacticipant

list-pacticipants

Usage:
  pact-broker list-pacticipants -b, --broker-base-url=BROKER_BASE_URL

Options:
  -o, [--output=OUTPUT]
              # json or text
              # Default: text
  -b, --broker-base-url=BROKER_BASE_URL
              # The base URL of the Pact Broker
  -u, [--broker-username=BROKER_USERNAME]
              # Pact Broker basic auth username
  -p, [--broker-password=BROKER_PASSWORD]
              # Pact Broker basic auth password
  -k, [--broker-token=BROKER_TOKEN]
              # Pact Broker bearer token
  -v, [--verbose], [--no-verbose]
              # Verbose output.
              # Default: false

List pacticipants

Webhooks

create-webhook

Usage:
  pact-broker create-webhook URL -X, --request=METHOD -b, --broker-base-url=BROKER_BASE_URL

Options:
  -X, --request=METHOD
              # Webhook HTTP method
  -H, [--header=one two three]
              # Webhook Header
  -d, [--data=DATA]
              # Webhook payload. Provide a JSON string (remember to escape
                characters appropriately for the shell) or a file path prefixed
                with the @ symbol, as per the curl usage for this flag.
  -u, [--user=USER]
              # Webhook basic auth username and password eg. username:password
      [--consumer=CONSUMER]
              # Consumer name
      [--consumer-label=CONSUMER_LABEL]
              # Consumer label, mutually exclusive with consumer name
      [--provider=PROVIDER]
              # Provider name
      [--provider-label=PROVIDER_LABEL]
              # Provider label, mutually exclusive with provider name
      [--description=DESCRIPTION]
              # Webhook description
      [--contract-content-changed], [--no-contract-content-changed]
              # Trigger this webhook when the pact content changes
      [--contract-published], [--no-contract-published]
              # Trigger this webhook when a pact is published
      [--provider-verification-published], [--no-provider-verification-published]
              # Trigger this webhook when a provider verification result is
                published
      [--provider-verification-failed], [--no-provider-verification-failed]
              # Trigger this webhook when a failed provider verification
                result is published
      [--provider-verification-succeeded], [--no-provider-verification-succeeded]
              # Trigger this webhook when a successful provider verification
                result is published
      [--contract-requiring-verification-published], [--no-contract-requiring-verification-published]
              # 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)
  -b, --broker-base-url=BROKER_BASE_URL
              # The base URL of the Pact Broker
  -u, [--broker-username=BROKER_USERNAME]
              # Pact Broker basic auth username
  -p, [--broker-password=BROKER_PASSWORD]
              # Pact Broker basic auth password
  -k, [--broker-token=BROKER_TOKEN]
              # Pact Broker bearer token
  -v, [--verbose], [--no-verbose]
              # Verbose output.
              # Default: false

Description: Create a curl command that executes the request that you want your webhook to execute, then replace "curl" with "pact-broker create-webhook" and add the consumer, provider, event types and broker details. Note that the URL must be the first parameter when executing create-webhook.

Note that the -u option from the curl command clashes with the -u option from the pact-broker CLI. When used in this command, the -u will be used as a curl option. Please use the --broker-username or environment variable for the Pact Broker username.

create-or-update-webhook

Usage:
  pact-broker create-or-update-webhook URL --uuid=UUID -X, --request=METHOD -b, --broker-base-url=BROKER_BASE_URL

Options:
  -X, --request=METHOD
              # Webhook HTTP method
  -H, [--header=one two three]
              # Webhook Header
  -d, [--data=DATA]
              # Webhook payload. Provide a JSON string (remember to escape
                characters appropriately for the shell) or a file path prefixed
                with the @ symbol, as per the curl usage for this flag.
  -u, [--user=USER]
              # Webhook basic auth username and password eg. username:password
      [--consumer=CONSUMER]
              # Consumer name
      [--consumer-label=CONSUMER_LABEL]
              # Consumer label, mutually exclusive with consumer name
      [--provider=PROVIDER]
              # Provider name
      [--provider-label=PROVIDER_LABEL]
              # Provider label, mutually exclusive with provider name
      [--description=DESCRIPTION]
              # Webhook description
      [--contract-content-changed], [--no-contract-content-changed]
              # Trigger this webhook when the pact content changes
      [--contract-published], [--no-contract-published]
              # Trigger this webhook when a pact is published
      [--provider-verification-published], [--no-provider-verification-published]
              # Trigger this webhook when a provider verification result is
                published
      [--provider-verification-failed], [--no-provider-verification-failed]
              # Trigger this webhook when a failed provider verification
                result is published
      [--provider-verification-succeeded], [--no-provider-verification-succeeded]
              # Trigger this webhook when a successful provider verification
                result is published
      [--contract-requiring-verification-published], [--no-contract-requiring-verification-published]
              # 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)
  -b, --broker-base-url=BROKER_BASE_URL
              # The base URL of the Pact Broker
  -u, [--broker-username=BROKER_USERNAME]
              # Pact Broker basic auth username
  -p, [--broker-password=BROKER_PASSWORD]
              # Pact Broker basic auth password
  -k, [--broker-token=BROKER_TOKEN]
              # Pact Broker bearer token
  -v, [--verbose], [--no-verbose]
              # Verbose output.
              # Default: false
      --uuid=UUID
              # Specify the uuid for the webhook

Description: Create a curl command that executes the request that you want your webhook to execute, then replace "curl" with "pact-broker create-or-update-webhook" and add the consumer, provider, event types and broker details. Note that the URL must be the first parameter when executing create-or-update-webhook and a uuid must also be provided. You can generate a valid UUID by using the generate-uuid command.

Note that the -u option from the curl command clashes with the -u option from the pact-broker CLI. When used in this command, the -u will be used as a curl option. Please use the --broker-username or environment variable for the Pact Broker username.

test-webhook

Usage:
  pact-broker test-webhook --uuid=UUID -b, --broker-base-url=BROKER_BASE_URL

Options:
      --uuid=UUID
              # Specify the uuid for the webhook
  -b, --broker-base-url=BROKER_BASE_URL
              # The base URL of the Pact Broker
  -u, [--broker-username=BROKER_USERNAME]
              # Pact Broker basic auth username
  -p, [--broker-password=BROKER_PASSWORD]
              # Pact Broker basic auth password
  -k, [--broker-token=BROKER_TOKEN]
              # Pact Broker bearer token
  -v, [--verbose], [--no-verbose]
              # Verbose output.
              # Default: false

Test the execution of a webhook

Branches

delete-branch

Usage:
  pact-broker delete-branch --branch=BRANCH -a, --pacticipant=PACTICIPANT -b, --broker-base-url=BROKER_BASE_URL

Options:
  -a, --pacticipant=PACTICIPANT
              # The name of the pacticipant that the branch belongs to.
      --branch=BRANCH
              # The pacticipant branch name.
      [--error-when-not-found], [--no-error-when-not-found]
              # Raise an error if the branch that is to be deleted is not
                found.
              # Default: true
  -b, --broker-base-url=BROKER_BASE_URL
              # The base URL of the Pact Broker
  -u, [--broker-username=BROKER_USERNAME]
              # Pact Broker basic auth username
  -p, [--broker-password=BROKER_PASSWORD]
              # Pact Broker basic auth password
  -k, [--broker-token=BROKER_TOKEN]
              # Pact Broker bearer token
  -v, [--verbose], [--no-verbose]
              # Verbose output.
              # Default: false

Deletes a pacticipant branch. Does not delete the versions or pacts/verifications associated with the branch, but does make the pacts inaccessible for verification via consumer versions selectors or WIP pacts.

Tags

create-version-tag

Usage:
  pact-broker create-version-tag -a, --pacticipant=PACTICIPANT -b, --broker-base-url=BROKER_BASE_URL -e, --version=VERSION

Options:
  -a, --pacticipant=PACTICIPANT
              # The pacticipant name
  -e, --version=VERSION
              # The pacticipant version
  -t, [--tag=TAG]
              # Tag name for pacticipant version. Can be specified multiple
                times.
      [--auto-create-version], [--no-auto-create-version]
              # Automatically create the pacticipant version if it does not
                exist.
              # Default: false
  -g, [--tag-with-git-branch], [--no-tag-with-git-branch]
              # Tag pacticipant version with the name of the current git
                branch.
              # Default: false
  -b, --broker-base-url=BROKER_BASE_URL
              # The base URL of the Pact Broker
  -u, [--broker-username=BROKER_USERNAME]
              # Pact Broker basic auth username
  -p, [--broker-password=BROKER_PASSWORD]
              # Pact Broker basic auth password
  -k, [--broker-token=BROKER_TOKEN]
              # Pact Broker bearer token
  -v, [--verbose], [--no-verbose]
              # Verbose output.
              # Default: false

Add a tag to a pacticipant version

Versions

describe-version

Usage:
  pact-broker describe-version -a, --pacticipant=PACTICIPANT -b, --broker-base-url=BROKER_BASE_URL

Options:
  -a, --pacticipant=PACTICIPANT
              # The name of the pacticipant that the version belongs to.
  -e, [--version=VERSION]
              # The pacticipant version number.
  -l, [--latest=[TAG]]
              # Describe the latest pacticipant version. Optionally specify a
                TAG to describe the latest version with the specified tag.
  -o, [--output=OUTPUT]
              # json or table or id
              # Default: table
  -b, --broker-base-url=BROKER_BASE_URL
              # The base URL of the Pact Broker
  -u, [--broker-username=BROKER_USERNAME]
              # Pact Broker basic auth username
  -p, [--broker-password=BROKER_PASSWORD]
              # Pact Broker basic auth password
  -k, [--broker-token=BROKER_TOKEN]
              # Pact Broker bearer token
  -v, [--verbose], [--no-verbose]
              # Verbose output.
              # Default: false

Describes a pacticipant version. If no version or tag is specified, the latest version is described.

create-or-update-version

Usage:
  pact-broker create-or-update-version -a, --pacticipant=PACTICIPANT -b, --broker-base-url=BROKER_BASE_URL -e, --version=VERSION

Options:
  -a, --pacticipant=PACTICIPANT
              # The pacticipant name
  -e, --version=VERSION
              # The pacticipant version number
      [--branch=BRANCH]
              # The repository branch name
  -t, [--tag=TAG]
              # Tag name for pacticipant version. Can be specified multiple
                times.
  -b, --broker-base-url=BROKER_BASE_URL
              # The base URL of the Pact Broker
  -u, [--broker-username=BROKER_USERNAME]
              # Pact Broker basic auth username
  -p, [--broker-password=BROKER_PASSWORD]
              # Pact Broker basic auth password
  -k, [--broker-token=BROKER_TOKEN]
              # Pact Broker bearer token
  -v, [--verbose], [--no-verbose]
              # Verbose output.
              # Default: false
  -o, [--output=OUTPUT]
              # json or text
              # Default: text

Create or update pacticipant version by version number

Miscellaneous

generate-uuid

Usage:
  pact-broker generate-uuid

Options:

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

Provider contracts (PactFlow only)

publish-provider-contract

Usage:
  pactflow publish-provider-contract CONTRACT_FILE ... --provider=PROVIDER -a, --provider-app-version=PROVIDER_APP_VERSION -b, --broker-base-url=BROKER_BASE_URL

Options:
      --provider=PROVIDER
              # The provider name
  -a, --provider-app-version=PROVIDER_APP_VERSION
              # The provider application version
  -h, [--branch=BRANCH]
              # Repository branch of the provider version
  -t, [--tag=TAG]
              # Tag name for provider version. Can be specified multiple
                times.
      [--specification=SPECIFICATION]
              # The contract specification
              # Default: oas
      [--content-type=CONTENT_TYPE]
              # The content type. eg. application/yml
      [--verification-success], [--no-verification-success]
              # Whether or not the self verification passed successfully.
      [--verification-exit-code=N]
              # The exit code of the verification process. Can be used instead
                of --verification-success|--no-verification-success for a
                simpler build script.
      [--verification-results=VERIFICATION_RESULTS]
              # The path to the file containing the output from the
                verification process
      [--verification-results-content-type=VERIFICATION_RESULTS_CONTENT_TYPE]
              # The content type of the verification output eg. text/plain,
                application/yaml
      [--verification-results-format=VERIFICATION_RESULTS_FORMAT]
              # The format of the verification output eg. junit, text
      [--verifier=VERIFIER]
              # The tool used to verify the provider contract
      [--verifier-version=VERIFIER_VERSION]
              # The version of the tool used to verify the provider contract
      [--build-url=BUILD_URL]
              # The build URL that created the provider contract
  -o, [--output=OUTPUT]
              # json or text
              # Default: text
  -b, --broker-base-url=BROKER_BASE_URL
              # The base URL of the Pact Broker
  -u, [--broker-username=BROKER_USERNAME]
              # Pact Broker basic auth username
  -p, [--broker-password=BROKER_PASSWORD]
              # Pact Broker basic auth password
  -k, [--broker-token=BROKER_TOKEN]
              # Pact Broker bearer token
  -v, [--verbose], [--no-verbose]
              # Verbose output.
              # Default: false

Publish provider contract to PactFlow

Usage - Ruby

Consumer

# In Gemfile

gem "pact_broker-client"
# In Rakefile

require 'pact_broker/client/tasks'

PactBroker::Client::PublicationTask.new do | task |
  require 'my_consumer/version'
  task.consumer_version = ENV["GIT_COMMIT"]
  task.pattern = 'custom/path/to/pacts/*.json' # optional, default value is 'spec/pacts/*.json'
  task.pact_broker_base_url = "http://pact-broker"
  task.branch = ENV["GIT_BRANCH"] # Optional but STRONGLY RECOMMENDED.
  task.tag_with_git_branch = true|false # Superseeded by the `branch` property
  task.tags = ["dev"] # optional
  task.build_url = ENV["CI_BUILD_URL"]
  task.pact_broker_basic_auth =  { username: 'basic_auth_user', password: 'basic_auth_pass'} # optional
  task.pact_broker_token = "1234abcd" # Bearer token
  task.write_method = :merge # optional, this will merge the published pact into an existing pact rather than overwriting it if one exists. Not recommended, as it makes a mulch of the workflow on the broker.
end
# In CI script

bundle exec rake pact:publish

pact_broker-client's People

Contributors

aushm avatar barthez avatar bethesque avatar davidjgoss avatar dependabot[bot] avatar gmolki avatar guppy0356 avatar jmortlock avatar juliancbc avatar konalegi avatar laverya avatar lifeifei avatar lkwg82 avatar mefellows avatar mycargus avatar nicpillinger avatar p0deje avatar rabotyaga avatar redayy avatar sergei-matheson avatar taiki45 avatar timothyjones avatar tinexw avatar trammel avatar vixplows avatar you54f avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pact_broker-client's Issues

Document how bearer token authentication works

Following on from #66 I ended up in a similar situation where I wanted to bypass some third party authentication for our CI builds and ended up rolling my own version of the server-side part of the bearer token authentication.

It would be nice if the way that authentication works was documented as that would have saved me a lot of time and effort.

Something like:

## Authentication

### Basic Auth

Calculates a basic auth header based on the `--broker-username` and `--broker-password` parameters or ... environment variables and passes that with all requests

... example goes here ...

### Bearer Token

This passes the value provided in the `--broker-token` parameter or `...` environment variable in a `Authorization` header prefixed with the word "bearer".

Example header:

Authorization: Bearer abcdef1234567890

If it would be helpful, I'm more than happy to document how my particular setup is configured.

pact-broker create-webhook fails to authenticate

Hi,
first of all thanks for the great work on pact in general!

I am trying to create a webhook using the CLI, but I fail to authenticate. The following command always returns 401

$ ./node_modules/.bin/pact-broker create-webhook 'https://gitlab.com/api/v4/projects/XXX/ref/master/trigger/pipeline?token=XXX&variables[PACT_CONSUMER_TAG]=feature123' -X POST --provider order-service --consumer backoffice-view --broker-base-url https://XXX.pact.dius.com.au --broker-token XXX --contract-content-changed
Error creating webhook. response status=401 body=

edit:
I have this in my package.json:

"devDependencies": {
    "@pact-foundation/pact-node": "^8.4.0",
    "@pact-foundation/pact": "^8.2.3"
}

Verify for basic auth

what is the command to verify basic auth (username and password)

for ex this is for token how can get the same for basic auth

mvn clean install -Dpactbroker.host= -Dpactbroker.protocol=<broker_protocol> -Dpactbroker.auth.scheme=bearer -Dpactbroker.auth.username=

Missing Thor dependency?

I think that pact_broker-client-1.13.0 is missing a thor dependency.

Here are my steps to reproduce:

90-N6SPFD57-3EV:~ frank.tobia$ docker run --rm -it ruby:2.2 /bin/bash
root@27c3e5c5f857:/# gem install pact_broker-client
Fetching: multi_xml-0.6.0.gem (100%)
Successfully installed multi_xml-0.6.0
Fetching: httparty-0.15.6.gem (100%)
When you HTTParty, you must party hard!
Successfully installed httparty-0.15.6
Fetching: tins-1.15.1.gem (100%)
Successfully installed tins-1.15.1
Fetching: term-ansicolor-1.6.0.gem (100%)
Successfully installed term-ansicolor-1.6.0
Fetching: table_print-1.5.6.gem (100%)
Successfully installed table_print-1.5.6
Fetching: pact_broker-client-1.13.0.gem (100%)
Successfully installed pact_broker-client-1.13.0
6 gems installed
root@27c3e5c5f857:/# pact-broker
/usr/local/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:59:in `require': cannot load such file -- thor (LoadError)
	from /usr/local/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:59:in `require'
	from /usr/local/bundle/gems/pact_broker-client-1.13.0/lib/pact_broker/client/cli/custom_thor.rb:1:in `<top (required)>'
	from /usr/local/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:59:in `require'
	from /usr/local/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:59:in `require'
	from /usr/local/bundle/gems/pact_broker-client-1.13.0/lib/pact_broker/client/cli/broker.rb:5:in `<top (required)>'
	from /usr/local/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:59:in `require'
	from /usr/local/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:59:in `require'
	from /usr/local/bundle/gems/pact_broker-client-1.13.0/bin/pact-broker:2:in `<top (required)>'
	from /usr/local/bundle/bin/pact-broker:23:in `load'
	from /usr/local/bundle/bin/pact-broker:23:in `<main>'
root@27c3e5c5f857:/# gem install thor
Fetching: thor-0.20.0.gem (100%)
Successfully installed thor-0.20.0
1 gem installed
root@27c3e5c5f857:/# pact-broker
Commands:
  pact-broker can-i-deploy -a, --pacticipant=PACTICIPANT -b, --broker-base-url=BROKER_BASE_URL                                      #
  pact-broker create-version-tag -a, --pacticipant=PACTICIPANT -b, --broker-base-url=BROKER_BASE_URL -e, --version=VERSION          # Ad...
  pact-broker help [COMMAND]                                                                                                        # De...
  pact-broker publish PACT_DIRS_OR_FILES ... -a, --consumer-app-version=CONSUMER_APP_VERSION -b, --broker-base-url=BROKER_BASE_URL  # Pu...
  pact-broker version                                                                                                               # Sh...

root@27c3e5c5f857:/#

NameError on publish

Hi team, i had experienced NameError when publish to pact broker.

 "dependencies": {
    "@pact-foundation/pact": "^9.12.0",
    "axios": "^0.19.0",
    "faker": "^5.1.0",
    "kafkajs": "^1.14.0",
    "uuid": "^8.3.0"
  },

publish code is same as example repo

onst child_process = require('child_process');
const exec = command =>
  child_process
    .execSync(command)
    .toString()
    .trim()
const path = require("path")
const { Publisher } = require("@pact-foundation/pact")
const branch = exec("git rev-parse --abbrev-ref HEAD")
// publish to local docker
// const opts = {
//   pactBroker: 'localhost:9292',
//   consumerVersion: '1',
//   pactFilesOrDirs: ['./pacts'],
// };
const gitSha =  exec("git rev-parse HEAD")
const opts = {
  pactFilesOrDirs: [path.resolve(process.cwd(), "pacts")],
  pactBroker: "https://test.pact.dius.com.au",
  pactBrokerUsername: "dXfltyFMgNOFZAxr8io9wJ37iUpY42M",
  pactBrokerPassword: "O5AIZWxelWbLvqMd8PkAVycBJh2Psyg1",
  consumerVersion: gitSha,
  tags: [branch],
}
new Publisher(opts).publishPacts().then(() => {
  console.log("Pact contract publishing complete!")
  console.log("")
  console.log("Head over to https://test.pact.dius.com.au/ and login with")
  console.log("=> Username: dXfltyFMgNOFZAxr8io9wJ37iUpY42M")
  console.log("=> Password: O5AIZWxelWbLvqMd8PkAVycBJh2Psyg1")
  console.log("to see your published contracts.")
})
  .catch(e => {
    console.log("Pact contract publishing failed: ", e)
  })
$ node publish.ts
[2020-09-29T01:04:15.001Z]  INFO: [email protected]/45810 on wilkinsliang: Publishing Pacts to Broker
[2020-09-29T01:04:15.002Z]  INFO: [email protected]/45810 on wilkinsliang: Publishing pacts to broker at: https://test.pact.dius.com.au
[2020-09-29T01:04:15.316Z]  WARN: [email protected]/45810 on wilkinsliang: Pact exited with code 1.
[2020-09-29T01:04:15.317Z] ERROR: [email protected]/45810 on wilkinsliang: 
    Could not publish pact:
    /dummydir/consumer/node_modules/@pact-foundation/pact-node/standalone/linux-x64-1.86.0/pact/lib/vendor/ruby/2.2.0/gems/pact_broker-client-1.27.0/lib/pact_broker/client/cli/broker.rb:59:in `rescue in publish': uninitialized constant PactBroker::Client::Error (NameError)
        from /dummydir/consumer/node_modules/@pact-foundation/pact-node/standalone/linux-x64-1.86.0/pact/lib/vendor/ruby/2.2.0/gems/pact_broker-client-1.27.0/lib/pact_broker/client/cli/broker.rb:55:in `publish'
        from /dummydir/consumer/node_modules/@pact-foundation/pact-node/standalone/linux-x64-1.86.0/pact/lib/vendor/ruby/2.2.0/gems/thor-0.20.3/lib/thor/command.rb:27:in `run'
        from /dummydir/consumer/node_modules/@pact-foundation/pact-node/standalone/linux-x64-1.86.0/pact/lib/vendor/ruby/2.2.0/gems/thor-0.20.3/lib/thor/invocation.rb:126:in `invoke_command'
        from /dummydir/consumer/node_modules/@pact-foundation/pact-node/standalone/linux-x64-1.86.0/pact/lib/vendor/ruby/2.2.0/gems/thor-0.20.3/lib/thor.rb:387:in `dispatch'
        from /dummydir/consumer/node_modules/@pact-foundation/pact-node/standalone/linux-x64-1.86.0/pact/lib/vendor/ruby/2.2.0/gems/thor-0.20.3/lib/thor/base.rb:466:in `start'
        from /dummydir/consumer/node_modules/@pact-foundation/pact-node/standalone/linux-x64-1.86.0/pact/lib/vendor/ruby/2.2.0/gems/pact_broker-client-1.27.0/lib/pact_broker/client/cli/custom_thor.rb:15:in `start'
        from /dummydir/consumer/node_modules/@pact-foundation/pact-node/standalone/linux-x64-1.86.0/pact/lib/app/pact-broker.rb:28:in `<main>'
    
Pact contract publishing failed:  Error: /dummydir/consumer/node_modules/@pact-foundation/pact-node/standalone/linux-x64-1.86.0/pact/lib/vendor/ruby/2.2.0/gems/pact_broker-client-1.27.0/lib/pact_broker/client/cli/broker.rb:59:in `rescue in publish': uninitialized constant PactBroker::Client::Error (NameError)
        from /dummydir/consumer/node_modules/@pact-foundation/pact-node/standalone/linux-x64-1.86.0/pact/lib/vendor/ruby/2.2.0/gems/pact_broker-client-1.27.0/lib/pact_broker/client/cli/broker.rb:55:in `publish'
        from /dummydir/consumer/node_modules/@pact-foundation/pact-node/standalone/linux-x64-1.86.0/pact/lib/vendor/ruby/2.2.0/gems/thor-0.20.3/lib/thor/command.rb:27:in `run'
        from /dummydir/consumer/node_modules/@pact-foundation/pact-node/standalone/linux-x64-1.86.0/pact/lib/vendor/ruby/2.2.0/gems/thor-0.20.3/lib/thor/invocation.rb:126:in `invoke_command'
        from /dummydir/consumer/node_modules/@pact-foundation/pact-node/standalone/linux-x64-1.86.0/pact/lib/vendor/ruby/2.2.0/gems/thor-0.20.3/lib/thor.rb:387:in `dispatch'
        from /dummydir/consumer/node_modules/@pact-foundation/pact-node/standalone/linux-x64-1.86.0/pact/lib/vendor/ruby/2.2.0/gems/thor-0.20.3/lib/thor/base.rb:466:in `start'
        from /dummydir/consumer/node_modules/@pact-foundation/pact-node/standalone/linux-x64-1.86.0/pact/lib/vendor/ruby/2.2.0/gems/pact_broker-client-1.27.0/lib/pact_broker/client/cli/custom_thor.rb:15:in `start'
        from /dummydir/consumer/node_modules/@pact-foundation/pact-node/standalone/linux-x64-1.86.0/pact/lib/app/pact-broker.rb:28:in `<main>'

    at ChildProcess.<anonymous> (/dummydir/consumer/node_modules/@pact-foundation/pact-node/src/publisher.js:72:40)
    at Object.onceWrapper (events.js:421:26)
    at ChildProcess.emit (events.js:326:22)
    at maybeClose (internal/child_process.js:1051:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:287:5)

Missing option to distinguish error codes for failing and missing contract verification

I am adding contract tests to continuous delivery pipeline. There are steps to:

  • run contract tests (consumer pipeline)
  • publish contract (consumer pipeline)
  • trigger pipeline with contract verification (provider pipeline)
  • check the contract verification result (consumer pipeline)
  • deploy (consumer pipeline)

I have a problem with verification the contract result because there are two options that gives exit 1 code:

  • the verification is missing because provider pipeline is still running ("Missing one or more verification results")
  • the verification is failed ("One or more verifications have failed")

I would like to have an option to distinguish these two cases so that I can break pipeline in case of verification failure or set retry if contract is missing (because provider is still running their tests).

Could you help me with that?

Not able to verify pacts in pact broker

Hi

We are using old pact broker let me know for any issues however my test are passing also in pact folder

cmd line used :
mvn clean install -Dpactbroker.host=dev.pact.cerebro.ing.net -Dpactbroker.protocol=https -Dpactbroker.auth.scheme=username -Dpactbroker.auth.scheme=password -Dpactbroker.auth.username= -Dpactbroker.auth.password=

error log

[ERROR] Errors:
[ERROR] Product1BrokerTest » RequestFailed Request to path '/' failed with response 'H...
[INFO]
[ERROR] Tests run: 3, Failures: 0, Errors: 1, Skipped: 0
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 37.530 s
[INFO] Finished at: 2020-05-26T15:15:20+05:30
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.22.1:test (default-test) on project provider1: There are test fa
ilures.
[ERROR]
[ERROR] Please refer to C:\Sridhar\Repository\pact-demo\provider1\target\surefire-reports for the individual test results.
[ERROR] Please refer to dump files (if any exist) [date].dump, [date]-jvmRun[N].dump and [date].dumpstream.
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:

please help

describe-version cuts off version

When I run the following command

./pact/bin/pact-broker describe-version -a user-service -b http://localhost -l prod 

I get the following output:

NUMBER                         | TAGS
-------------------------------|-----
a83153b34648b4a7fb17700ff09... | prod

The actual version is a83153b34648b4a7fb17700ff09519f893c520a7. Is there an option to print the whole version in the table without the ellipsis?

allow passing custom headers to commands

I want to add API gateway in front of pact-broker so I can use its default auth methods with api keys. But I don't want to write a custom authorizer. All the other commands for pact-broker allow the passing of custom headers but not publish. Is this something we can add?

regex for header in pact is not applied

I have a pact test that passes well when verifying with pact-jvm.

It's about a header matching some regex.

However, when running the verification with the broker client, it fails. All the rest of tests pass well, but not this one.

This is the relevant contract file fragment:

...
"response": {
        "status": 200,
        "headers": {
          "Cache-Control": "max-age=96002",
          "Content-Type": "application/json"
        },
...
"matchingRules": {
          "header": {
            "Cache-Control": {
              "matchers": [
                {
                  "match": "regex",
                  "regex": "max-age=\\d+"
                }
              ],
              "combine": "AND"
            },

and this is the error:

verification_1         | 
verification_1         | Failures:
verification_1         | 
verification_1         |   1) Verifying a pact between io.payworks.services.credentials.client and io.payworks.services.credentials Given  Request for signing keys with GET /signing-keys returns a response which includes headers "Cache-Control" which equals "max-age=96002"
verification_1         |      Failure/Error: expect(header_value).to match_header(name, expected_header_value)
verification_1         |        Expected header "Cache-Control" to equal "max-age=96002", but was "max-age=3600"

Any idea about what could be wrong?

can-i-deploy --to=TAG fails if there's no participant version with such tag

Hi!
We want to use the recommended approach for pact testing (we don't have CD) with can-i-deploy --to=TAG command.
When a consumer publishes new pact, it is tagged with the name of a feature branch and verified by provider.
After successful deployment it is tagged with the name of the stage.

So before deploy to production we want to use command:
./pact-broker can-i-deploy -a backend-catalog -e eaae34f4 --to prod

But we face the following problem.
If there is some participant which doesn't yet have participant version tagged with "prod" this command fails.
It returns:

{"error":{"message":"No version of UI-xxx found with tag prod"}}
script returned exit code 1

Does this really should fail?
This means that every new consumer which publishes new pact with tag different from somehow expected to have prod version at once.
But how it can be achieved?
The first step is consumer publish pact and provider verifies it.
And only after provider deploys version which will verify this pact - consumer version will be deployed and tagged as "prod". But provider can't deploy its version because of the error.

We expect that this command will not fail if there is no version with some tag for some participant.

How to trigger provider tests if contract has not been changed but provider changed their contract tests to start passing verification

Hi,

I have a problem with webhook to trigger provider contract tests when contract has not been changed but provider tests have been.

For consumer I developed new contract on branch with specific version and tag name. Then published it, triggered webhook to run provider tests for this contract. Provider was not ready so the verification failed.

After it provider added new contract tests at his site and released it.

Now, as a consumer I have a problem to pass can-i-deploy step because in my pipeline I am:

  • running contract tests - it passed
  • publishing contract - it passed however it will not trigger provider pipeline because contract has not been changed.

As a result I still see that can-i-deploy returns false.

How can I solve this problem?

SSL certification issue for `can-i-deploy`

We have been trying to use https://hub.docker.com/r/pactfoundation/pact-cli to use it's can-i-deploy mechanism. It keeps throwing
Error making request - OpenSSL::SSL::SSLError SSL_connect returned=1 errno=0 state=error: certificate verify failed (unable to get local issuer certificate) /usr/lib/ruby/gems/2.5.0/gems/pact_broker-client-1.20.0/lib/pact_broker/client/matrix.rb:13:in get', attempt 1 of 3`

We even tried passing SSL cert as an environment parameter but no luck.

Could someone help us as to how we can move forward ?

can-i-deploy : can not specify tag that should exist before deploying specific version

I want to specify a tag that should exist before I deploy a version with the new tag.
For example for service Foo I am deploying a tag Prod with version 1.0.0,
but before that I want to be sure that tag Stage exists.

We can do this for latest version using below command
pact-broker can-i-deploy --pacticipant Foo --latest Stage --to Prod ...

in above case it will check for the latest version of Foo.
we cannot specify specific version and a tag to exist.

I want to do something like
pact-broker can-i-deploy --pacticipant Foo --version 1.0.0 --ensure-tag Stage --to Prod ...

any solutions ??
Thanks in advance.

Pact-Provider-Verifier Errors When Consumer-Version-Tag Contains Slashes

Hi

When I try to run the the pact-provider-verifier when the --consumer-version-tag contains "/" it errors. I have tried wrapping the tag in quotes but it still errors

i.e

pact-provider-verifier --pact-broker-base-url http://localhost:1234 --provider-base-url http://localhost:1111 --provider-states-setup-url http://localhost:1111/provider-states --consumer-version-tag "<TAG WITH / SLASH>" --provider "<PROVIDER>" -v

Here is the output of the error I receive

C:/Program Files (x86)/pact-1.61.0-win32/pact/lib/vendor/ruby/2.2.0/gems/pact-1.36.0/lib/pact/pact_broker/fetch_pacts.rb:84:in 'pact_urls': undefined method 'collect' for nil:NilClass (NoMethodErr ) from C:/Program Files (x86)/pact-1.61.0-win32/pact/lib/vendor/ruby/2.2.0/gems/pact-1.36.0/lib/pact/pact_broker/fetch_pacts.rb:58:in 'block in tagged_pacts_for_provider' from C:/Program Files (x86)/pact-1.61.0-win32/pact/lib/vendor/ruby/2.2.0/gems/pact-1.36.0/lib/pact/pact_broker/fetch_pacts.rb:56:in 'collect' from C:/Program Files (x86)/pact-1.61.0-win32/pact/lib/vendor/ruby/2.2.0/gems/pact-1.36.0/lib/pact/pact_broker/fetch_pacts.rb:56:in 'tagged_pacts_for_provider' from C:/Program Files (x86)/pact-1.61.0-win32/pact/lib/vendor/ruby/2.2.0/gems/pact-1.36.0/lib/pact/pact_broker/fetch_pacts.rb:40:in 'call' from C:/Program Files (x86)/pact-1.61.0-win32/pact/lib/vendor/ruby/2.2.0/gems/pact-1.36.0/lib/pact/pact_broker/fetch_pacts.rb:33:in 'call' from C:/Program Files (x86)/pact-1.61.0-win32/pact/lib/vendor/ruby/2.2.0/gems/pact-1.36.0/lib/pact/pact_broker.rb:12:in 'fetch_pact_uris' from C:/Program Files (x86)/pact-1.61.0-win32/pact/lib/vendor/ruby/2.2.0/gems/pact-provider-verifier-1.20.0/lib/pact/provider_verifier/aggregate_pact_configs.rb:38:in 'non_pending_pact_uri from C:/Program Files (x86)/pact-1.61.0-win32/pact/lib/vendor/ruby/2.2.0/gems/pact-provider-verifier-1.20.0/lib/pact/provider_verifier/aggregate_pact_configs.rb:31:in 'pacts_urls_from_brok ' from C:/Program Files (x86)/pact-1.61.0-win32/pact/lib/vendor/ruby/2.2.0/gems/pact-provider-verifier-1.20.0/lib/pact/provider_verifier/aggregate_pact_configs.rb:21:in 'call' from C:/Program Files (x86)/pact-1.61.0-win32/pact/lib/vendor/ruby/2.2.0/gems/pact-provider-verifier-1.20.0/lib/pact/provider_verifier/aggregate_pact_configs.rb:9:in 'call' from C:/Program Files (x86)/pact-1.61.0-win32/pact/lib/vendor/ruby/2.2.0/gems/pact-provider-verifier-1.20.0/lib/pact/provider_verifier/app.rb:168:in 'all_pact_urls' from C:/Program Files (x86)/pact-1.61.0-win32/pact/lib/vendor/ruby/2.2.0/gems/pact-provider-verifier-1.20.0/lib/pact/provider_verifier/app.rb:32:in 'call' from C:/Program Files (x86)/pact-1.61.0-win32/pact/lib/vendor/ruby/2.2.0/gems/pact-provider-verifier-1.20.0/lib/pact/provider_verifier/app.rb:26:in 'call' from C:/Program Files (x86)/pact-1.61.0-win32/pact/lib/vendor/ruby/2.2.0/gems/pact-provider-verifier-1.20.0/lib/pact/provider_verifier/cli/verify.rb:36:in 'verify' from C:/Program Files (x86)/pact-1.61.0-win32/pact/lib/vendor/ruby/2.2.0/gems/thor-0.20.0/lib/thor/command.rb:27:in 'run' from C:/Program Files (x86)/pact-1.61.0-win32/pact/lib/vendor/ruby/2.2.0/gems/thor-0.20.0/lib/thor/invocation.rb:126:in 'invoke_command' from C:/Program Files (x86)/pact-1.61.0-win32/pact/lib/vendor/ruby/2.2.0/gems/thor-0.20.0/lib/thor.rb:387:in 'dispatch' from C:/Program Files (x86)/pact-1.61.0-win32/pact/lib/vendor/ruby/2.2.0/gems/thor-0.20.0/lib/thor/base.rb:466:in 'start' from C:/Program Files (x86)/pact-1.61.0-win32/pact/lib/vendor/ruby/2.2.0/gems/pact-provider-verifier-1.20.0/lib/pact/provider_verifier/cli/custom_thor.rb:17:in 'start' from C:/Program Files (x86)/pact-1.61.0-win32/pact/lib/app/pact-provider-verifier.rb:33:in '<main>'

Remove published pact contract on the pact broker

Hi,

We've published some testing pact contracts on the broker when we building the pact broker. Now we would like to remove these testing contracts from the broker.

I had a look at the source code, the pact broker client/participants class only has patch/get methods to support list and publish pact contracts. Do we have rake task to remove the contracts?

Thanks,

Lifei

can-i-deploy command returns true even though version was not verified against given tag

Pre issue-raising checklist

I have already (please mark the applicable with an x):

  • Upgraded to the latest Pact Broker OR
  • Checked the CHANGELOG to see if the issue I am about to raise has been fixed

Software versions

  • pact-broker version: 2.23.3
  • pact broker client details: pact-ruby-standalone CLI v 1.47.1 and pact-jvm v 3.5.19

Expected behaviour

I have one consumer de.tine.foo and two providers de.tine.bar and de.tine.baz.

They have the following matrix:
matrix-bar
matrix-baz

If I run

can-i-deploy -a de.tine.foo -e 3.0.0 --to prod

I expect that the command fails because version 3.0.0 of de.tine.foo was not verified against the latest prod tag of de.tine.bar.

Actual behaviour

The command succeeds. Output:

Computer says yes \o/ 

CONSUMER    | C.VERSION | PROVIDER    | P.VERSION | SUCCESS?
------------|-----------|-------------|-----------|---------
de.tine.foo | 3.0.0     | de.tine.baz | 20.0.0    | true    

All verification results are published and successful

Steps to reproduce

Code to reproduce in https://github.com/tinexw/pact-broker-example. Please see README in repo for details.
Data was already published once to the https://test.pact.dius.com.au broker, s. https://test.pact.dius.com.au/matrix/provider/de.tine.bar/consumer/de.tine.foo and https://test.pact.dius.com.au/matrix/provider/de.tine.baz/consumer/de.tine.foo

The whole issue seems to be caused by the fact that an old provider version is used again. This should actually not happen in a correct setup. However, it did happen in my organization because of a misconfiguration of the provider. But I think that the can-i-deploy command should prevent us from deploying even in those cases. Additionally, it might be a valid configuration after all in case the provider does a rollback to a previous version.

Relevent log files

Output when running with --verbose option.

opening connection to test.pact.dius.com.au:443...
opened
starting SSL for test.pact.dius.com.au:443...
SSL established
<- "GET /matrix?q[][pacticipant]=de.tine.foo&q[][version]=3.0.0&latestby=cvp&latest=true&tag=prod HTTP/1.1\r\nAccept: application/hal+json, application/json\r\nAuthorization: Basic <snip>==\r\nConnection: close\r\nHost: test.pact.dius.com.au\r\n\r\n"
-> "HTTP/1.1 200 OK\r\n"
-> "Content-Type: application/hal+json;charset=utf-8\r\n"
-> "Date: Sun, 01 Jul 2018 11:24:38 GMT\r\n"
-> "Server: Webmachine-Ruby/1.5.0 Rack/1.3\r\n"
-> "Status: 200 OK\r\n"
-> "Vary: Accept\r\n"
-> "X-Content-Type-Options: nosniff\r\n"
-> "X-Pact-Broker-Git-Sha: ed634ba7507dc130125d95ca8d5acc2b7bd28f23\r\n"
-> "X-Pact-Broker-Version: 2.23.1\r\n"
-> "X-Powered-By: Phusion Passenger 5.0.29\r\n"
-> "Content-Length: 939\r\n"
-> "Connection: Close\r\n"
-> "\r\n"
reading 939 bytes...
-> "{\"summary\":{\"deployable\":true,\"reason\":\"All verification results are published and successful\"},\"matrix\":[{\"consumer\":{\"name\":\"de.tine.foo\",\"version\":{\"number\":\"3.0.0\",\"_links\":{\"self\":{\"href\":\"https://test.pact.dius.com.au/pacticipants/de.tine.foo/versions/3.0.0\"}}},\"_links\":{\"self\":{\"href\":\"https://test.pact.dius.com.au/pacticipants/de.tine.foo\"}}},\"provider\":{\"name\":\"de.tine.baz\",\"version\":{\"number\":\"20.0.0\"},\"_links\":{\"self\":{\"href\":\"https://test.pact.dius.com.au/pacticipants/de.tine.baz\"}}},\"pact\":{\"createdAt\":\"2018-07-01T21:24:22+10:00\",\"_links\":{\"self\":{\"href\":\"https://test.pact.dius.com.au/pacts/provider/de.tine.baz/consumer/de.tine.foo/version/3.0.0\"}}},\"verificationResult\":{\"success\":true,\"verifiedAt\":\"2018-07-01T21:23:28+10:00\",\"_links\":{\"self\":{\"href\":\"https://test.pact.dius.com.au/pacts/provider/de.tine.baz/consumer/de.tine.foo/pact-version/b74c6ff8b6c7b91375dc0f6a17f1066e6fd72250/verification-results/4952\"}}}}]}"
read 939 bytes
Conn close
Computer says yes \o/ 

CONSUMER    | C.VERSION | PROVIDER    | P.VERSION | SUCCESS?
------------|-----------|-------------|-----------|---------
de.tine.foo | 3.0.0     | de.tine.baz | 20.0.0    | true    

All verification results are published and successful

The GET /matrix request doesn't contain an entry for de.tine.bar:

Request:

curl  'https://test.pact.dius.com.au/matrix?q%5B%5D%5Bpacticipant%5D=de.tine.foo&q%5B%5D%5Bversion%5D=3.0.0&latestby=cvp&latest=true&tag=prod'  -u <snip>

Response:

{
	"summary": {
		"deployable": true,
		"reason": "All verification results are published and successful"
	},
	"matrix": [{
		"consumer": {
			"name": "de.tine.foo",
			"version": {
				"number": "3.0.0",
				"_links": {
					"self": {
						"href": "https://test.pact.dius.com.au/pacticipants/de.tine.foo/versions/3.0.0"
					}
				}
			},
			"_links": {
				"self": {
					"href": "https://test.pact.dius.com.au/pacticipants/de.tine.foo"
				}
			}
		},
		"provider": {
			"name": "de.tine.baz",
			"version": {
				"number": "20.0.0"
			},
			"_links": {
				"self": {
					"href": "https://test.pact.dius.com.au/pacticipants/de.tine.baz"
				}
			}
		},
		"pact": {
			"createdAt": "2018-07-01T21:24:22+10:00",
			"_links": {
				"self": {
					"href": "https://test.pact.dius.com.au/pacts/provider/de.tine.baz/consumer/de.tine.foo/version/3.0.0"
				}
			}
		},
		"verificationResult": {
			"success": true,
			"verifiedAt": "2018-07-01T21:23:28+10:00",
			"_links": {
				"self": {
					"href": "https://test.pact.dius.com.au/pacts/provider/de.tine.baz/consumer/de.tine.foo/pact-version/b74c6ff8b6c7b91375dc0f6a17f1066e6fd72250/verification-results/4952"
				}
			}
		}
	}]
}

Publish pact files with tags

Hi,

I see some support in the pact broker client for reading pacts with tags, is there a task/option to publish tags to the broker?

create-version-tag passes if version does not exist

When the create-version-tag command is called with a non-existing version, it passes.

This can lead to the case that a latest tag is not shown in the UI anymore.

  1. Tag an existing version with prod -> prod tag is shown
./pact-broker create-version-tag -a messaging-app -b http://localhost -e feaba6227a48e03c0eeb1c4a27d685496349e78d -t prod
Tagging messaging-app version feaba6227a48e03c0eeb1c4a27d685496349e78d as prod

image

  1. Tag a non-existing version with prod -> no latest prod tag is shown
./pact-broker create-version-tag -a messaging-app -b http://localhost -e 123 -t prod
Tagging messaging-app version 123 as prod

image

image

I would prefer if the command would fail if the version does not exist.

Distinguishing can-i-deploy cases between pact existance and version differences

I am running into a case that I think is different to other issues I see. #25 is similar but not exactly the same. The crux is I cannot tell difference between:

  • versions of provider and client that have not be tested in this combination (row 3)
  • provider and consumer that both exist but have never had a pact between them

I am trying to use the client to determine if a particular combination has never been tested (which would say that the contracts are different) or if there is no pact at all between these two pacticipants. I half started to write an app to hit the Pact Broker API. I think this would be key functionality in the decision of "can-i-deploy". Is there something that gets me close?

Consumer Name Consumer Version Provider Name Provider Version Success Output Notes Existing Exit Code
PactPhpExampleClient 0.0.30 PactExampleApi 0.1.57 Yes All verification results are published and successful 0
PactPhpExampleClient 0.0.36 PactExampleApi 1.1.71 No One or more verifications have failed 1
PactPhpExampleClient 0.0.36 PactExampleApi 1.1.57 Unknown No results matched the given query An older version of pact exists but says unknown 1
PactPhpExampleClient 0.0.36 ExistantApiButNoneWithPactPhpExampleClient Latest Unknown No results matched the given query No pact ever existed 1

Basic auth not working in latest tag (0.0.6)

The version that's published to rubygems doesn't support basic_auth when publishing, the way it's documented in the README.md (HEAD).
If I run the gem from the HEAD at github it works fine (retries also seems to be implemented #2).
Would it be possible to publish a new version?
Or is there any particular reason why it's not published? (more than lack of time)

I really enjoy working with this whole pact suite of gems, and the pact wiki is has lots of great info on microservices, thank you very much for an awesome job!

Handle running provider tests from webhook againts contract with specific tag and version

Hi,

I have a problem with running a webhook that should trigger provider tests for specific non prod contract. The webhook is defined as:

{
"events": [{
"name": "contract_content_changed"
}],
"request": {
"method": "POST",
"url": "xyz",
"body": {
"thisPactWasPublished" : "${pactbroker.pactUrl}"
}
}
}

and in the log I can see that it was properly run however it triggers tests for prod tag (not the one that was just published). For the provider I have defined:

@PactBroker(host = "xyz", port = "80", tags = "prod"), because I want to run provider tests against prod contract within their normal pipeline (not triggered).

Is there an option to trigger a webhook to run provider tests against specific tagged contract (not the prod one that is hardcoded in the setup)?

Handle new lines in url parameters

If a parameter (eg consumer name, provider name, consumer version number, tag name) has a new line on the front or end, trim it off without error. If there is a new line in the middle of it, raise an error.

can-i-deploy fails if no pact was published by pacticipant

I would expect that the can-i-deploy function returns non-zero exit code

  • if one or more pacts where published by the given pacticipant
  • AND these pacts were not successfully verified

I would expect that the can-i-deploy function returns zero exit code

  • if all published pacts of the pacticipant were successfully verified
  • OR if there are no published pacts

The current implementation returns non-zero exit code if there are no published pacts by the pacticipant.
That stops services from getting deployed, because they have no providers.

pact-broker create-webhook: cannot load such file -- pact/hal/entity (LoadError)

Hi, I installed the pact broker client this way (I'm on Ubuntu 19.10, with Ruby 2.5):

gem install pact_broker-client;

And tried to create a webhook with a command like this one:

pact-broker create-webhook "${CONSUMER_PIPELINE_WEBHOOK}" \
      --request POST \
      --consumer "${CONSUMER}" \
      --provider "${PROVIDER}" \
      --provider-verification-published \
      --broker-username "${HTTP_BASIC_AUTH_USERNAME}" \
      --broker-password "${HTTP_BASIC_AUTH_PASSWORD}" \
      --broker-base-url "${BROKER_BASE_URL}";

But I get the following error:

Traceback (most recent call last):
        16: from /usr/local/bin/pact-broker:23:in `<main>'
        15: from /usr/local/bin/pact-broker:23:in `load'
        14: from /var/lib/gems/2.5.0/gems/pact_broker-client-1.25.0/bin/pact-broker:4:in `<top (required)>'
        13: from /var/lib/gems/2.5.0/gems/pact_broker-client-1.25.0/lib/pact_broker/client/cli/custom_thor.rb:15:in `start'
        12: from /var/lib/gems/2.5.0/gems/thor-0.20.3/lib/thor/base.rb:466:in `start'
        11: from /var/lib/gems/2.5.0/gems/thor-0.20.3/lib/thor.rb:387:in `dispatch'
        10: from /var/lib/gems/2.5.0/gems/thor-0.20.3/lib/thor/invocation.rb:126:in `invoke_command'
         9: from /var/lib/gems/2.5.0/gems/thor-0.20.3/lib/thor/command.rb:27:in `run'
         8: from /var/lib/gems/2.5.0/gems/pact_broker-client-1.25.0/lib/pact_broker/client/cli/broker.rb:121:in `create_webhook'
         7: from /var/lib/gems/2.5.0/gems/pact_broker-client-1.25.0/lib/pact_broker/client/cli/broker.rb:269:in `run_webhook_commands'
         6: from /var/lib/gems/2.5.0/gems/pact_broker-client-1.25.0/lib/pact_broker/client/webhooks/create.rb:17:in `call'
         5: from /var/lib/gems/2.5.0/gems/pact_broker-client-1.25.0/lib/pact_broker/client/webhooks/create.rb:28:in `call'
         4: from /var/lib/gems/2.5.0/gems/pact_broker-client-1.25.0/lib/pact_broker/client/webhooks/create.rb:39:in `create_webhook_with_consumer_and_provider'
         3: from /var/lib/gems/2.5.0/gems/pact_broker-client-1.25.0/lib/pact_broker/client/hal/link.rb:53:in `post'
         2: from /var/lib/gems/2.5.0/gems/pact_broker-client-1.25.0/lib/pact_broker/client/hal/link.rb:65:in `wrap_response'
         1: from /usr/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in `require'
/usr/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in `require': cannot load such file -- pact/hal/entity (LoadError)

I'm not sure if this is due to me passing some incorrect argument (although the error should be different in that case), due to a missing dependency, or due to a bug.

create-webhook - NoMethodError: undefined method `post' for nil:NilClass

Using the container image pactfoundation/pact-cli:latest and I get:

broker create-webhook http://myci.com -X POST -H 'Content-Type: application/json' -d '{"key":"${pact.value}"}' --contract-content-changed -u=pact-broker -p=$BA_PASS
NoMethodError: undefined method `post' for nil:NilClass
  /usr/lib/ruby/gems/2.5.0/gems/pact_broker-client-1.20.0/lib/pact_broker/client/webhooks/create.rb:44:in `create_webhook_with_optional_consumer_and_provider'
  /usr/lib/ruby/gems/2.5.0/gems/pact_broker-client-1.20.0/lib/pact_broker/client/webhooks/create.rb:30:in `call'
  /usr/lib/ruby/gems/2.5.0/gems/pact_broker-client-1.20.0/lib/pact_broker/client/webhooks/create.rb:17:in `call'
  /usr/lib/ruby/gems/2.5.0/gems/pact_broker-client-1.20.0/lib/pact_broker/client/cli/broker.rb:167:in `create_webhook'
  /usr/lib/ruby/gems/2.5.0/gems/thor-0.20.3/lib/thor/command.rb:27:in `run'
  /usr/lib/ruby/gems/2.5.0/gems/thor-0.20.3/lib/thor/invocation.rb:126:in `invoke_command'
  /usr/lib/ruby/gems/2.5.0/gems/thor-0.20.3/lib/thor.rb:387:in `dispatch'
  /usr/lib/ruby/gems/2.5.0/gems/thor-0.20.3/lib/thor/base.rb:466:in `start'
  /usr/lib/ruby/gems/2.5.0/gems/pact_broker-client-1.20.0/lib/pact_broker/client/cli/custom_thor.rb:15:in `start'
  /pact/lib/pact/cli.rb:34:in `broker'
  /usr/lib/ruby/gems/2.5.0/gems/thor-0.20.3/lib/thor/command.rb:27:in `run'
  /usr/lib/ruby/gems/2.5.0/gems/thor-0.20.3/lib/thor/invocation.rb:126:in `invoke_command'
  /usr/lib/ruby/gems/2.5.0/gems/thor-0.20.3/lib/thor.rb:387:in `dispatch'
  /usr/lib/ruby/gems/2.5.0/gems/thor-0.20.3/lib/thor/base.rb:466:in `start'
  bin/pact:9:in `<top (required)>'

When I set the credentials via env vars for the container, it works.

can-i-deploy fails if there are > 100 applicable verifications

Hi,

I am currently running into a situation where can-i-deploy is giving the following example result:
./pact-broker can-i-deploy --pacticipant foo --broker-base-url https://pact.broker.com/ --version abc123 --to staging

Computer says no ¯\_(ツ)_/¯

CONSUMER C.VERSION PROVIDER P.VERSION SUCCESS?
foo abc123 test-provider efg456 true
foo abc123 test-provider2 hijk123 true

There is no verified pact between version abc123 of foo and the latest version of bar with tag staging (xyz123)

However there is clearly a verification for foo -> bar when I check the broker.
Upon debugging further I believe the can-i-deploy script is making the following request:
https://pact.broker.com/matrix?q%5B%5Dpacticipant=foo&q%5B%5Dversion=abc123&tag=staging&latest=true&latestby=cvp
The response from the above request matches the result of can-i-deploy but when I add an additional query (@limit=500), the request will return the correct response which includes the verification for foo -> bar.

My assumption is that the default limit of 100 verifications is not including enough results to correctly evaluate can-i-deploy from a broker with high usage. I think can-i-deploy needs to be refactored to include all results so it can fully evaluate a correct response?

Pact broker returning 406 error on all requests made from Rails console

As an example:

[1] pry(main)> PactBroker::Client::PactBrokerClient.new(base_url: "https://pactbroker.gov", client_options: {basic_auth: {username: "user", password: "pass"}}).pacticipants.list
RuntimeError: 
from /home/vagrant/.rvm/gems/ruby-2.3.0/gems/pact_broker-client-1.1.0/lib/pact_broker/client/base_client.rb:60:in `handle_response'

Doing some monkey-patching of the handle_response method to report information on error (it should probably return the status code as well as the response body as part of the error message) reveals that this is a 406 Not Acceptable error.

Investigating the headers of an example response reveals the issue: the pact broker is responding with the content type application/hal+json when we're only providing Accept: application/json as an option. Removing the Accept header from the request resolves the issue as well.

This is a fairly quick fix if you think it's worth it, but I'm also welcome to workarounds.

gem doesn't support pacticipants that have spaces in their names

Scenario 1 (failure)
Given a pacticipant's name is "Pet Store" (one space)
And the pacticipant has published a Pact file to the Pact broker
When a person runs the following code snippet (see below)
Then pact-broker throws a "bad URI" error (full stack trace: https://gist.github.com/mycargus/e0d52b139d2bd74b2c50b9c2c11ced27)

pact-broker create-version-tag -a "Pet Store" -b pact-broker.net -u pact -p broker -e 1 -t prod

Scenario 2 (failure)
Given a pacticipant's name is "Pet Store" (one space)
And the pacticipant has published a Pact file to the Pact broker
When a person runs the following code snippet (see below)
Then the broker doesn't show a "prod" tag for the specified version
And the command didn't throw an error

pact-broker create-version-tag -a "Pet%20Store" -b pact-broker.net -u pact -p broker -e 1 -t prod

Scenario 3 (success)
Given a pacticipant's name is "PetStore" (no spaces)
And the pacticipant has published a Pact file to the Pact broker
When a person runs the following code snippet (see below)
Then the broker shows a "prod" tag for the specified version

pact-broker create-version-tag -a "PetStore" -b pact-broker.net -u pact -p broker -e 1 -t prod

pact_broker-client version 1.16.0
ruby version 2.4.2p198

No able to Run Provider and validate pacts from pact broker

I had downloaded pact broker from pactflow.io
and url is https://sm.pact.dius.com.au/ and using in my machine local

this is my sample provider (* using pact folder without using pact broker provider Junit is running and reports are generated) when i use Pact broker I am not getting

package com.test.product1;

import org.junit.BeforeClass;
import org.junit.runner.RunWith;
import au.com.dius.pact.provider.junit.PactRunner;
import au.com.dius.pact.provider.junit.Provider;
import au.com.dius.pact.provider.junit.State;
import au.com.dius.pact.provider.junit.VerificationReports;
import au.com.dius.pact.provider.junit.loader.PactBroker;
import au.com.dius.pact.provider.junit.target.HttpTarget;
import au.com.dius.pact.provider.junit.target.Target;
import au.com.dius.pact.provider.junit.target.TestTarget;
import au.com.dius.pact.provider.junit.loader.PactBrokerAuth;

@RunWith(PactRunner.class)
//@PactFolder("C:\Users\Win10\Downloads\New-Pact-master\New-Pact-master\consumer1\target\pacts")

//@PactBroker(host="localhost", port = "80")

@Provider("EcommereceProvider")
@PactBroker(
host = "Pactflow",
scheme = "https",
port = "80",
authentication = @PactBrokerAuth(username = "[email protected]", password = "Kanaga@3479")
)

@VerificationReports(value = { "console", "markdown", "json" })

public class Product1BrokerTest {

private int PORT = 9080;

@BeforeClass

public static void setVersion() {

	// https://github.com/DiUS/pact-jvm/tree/master/provider/pact-jvm-provider-junit#publishing-verification-results-to-a-pact-broker

	System.setProperty("pact.provider.version", "1.0.0");

	System.setProperty("pact.verifier.publishResults", "true");

}

@TestTarget

public final Target target = new HttpTarget("http", "localhost", PORT);

// private static ConfigurableApplicationContext applicationContext;

// @BeforeClass
//
// public static void start() {
//
// applicationContext = SpringApplication.run(EcommerceApplication.class);
//
// }

// @TargetRequestFilter
//
// public void printTheRequestHeaders(HttpRequest request) {
//
// Arrays.asList(request.getAllHeaders())
//
// .forEach(header -> System.out.println(header.getName() + "->" + header.getValue()));

// }

// @afterclass
//
// public static void stop() {
//
// SpringApplication.exit(applicationContext);
//
// }
//
//

@State("HP")

public void withSomeState() {

	System.out.println("get list of products from HP");

}

}

error log

org.apache.http.conn.HttpHostConnectException: Connect to localhost:80 [localhost/127.0.0.1, localhost/0:0:0:0:0:0:0:1] failed: Connection refused: connect
at org.apache.http.impl.conn.DefaultHttpClientConnectionOperator.connect(DefaultHttpClientConnectionOperator.java:156)
at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.connect(PoolingHttpClientConnectionManager.java:374)
at org.apache.http.impl.execchain.MainClientExec.establishRoute(MainClientExec.java:393)
at org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:236)
at org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:186)
at org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:89)
at org.apache.http.impl.execchain.ServiceUnavailableRetryExec.execute(ServiceUnavailableRetryExec.java:85)
at org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:110)
at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:185)
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:83)
at au.com.dius.pact.pactbroker.HalClientBase.getJson(HalClient.kt:263)
at au.com.dius.pact.pactbroker.HalClientBase.fetch(HalClient.kt:249)
at au.com.dius.pact.pactbroker.HalClientBase.fetch(HalClient.kt:244)
at au.com.dius.pact.pactbroker.HalClientBase.navigate(HalClient.kt:237)
at org.codehaus.groovy.vmplugin.v7.IndyInterface.selectMethod(IndyInterface.java:234)
at au.com.dius.pact.provider.broker.PactBrokerClient.fetchConsumers(PactBrokerClient.groovy:40)
at au.com.dius.pact.provider.junit.loader.PactBrokerLoader.loadPactsForProvider(PactBrokerLoader.java:141)
at au.com.dius.pact.provider.junit.loader.PactBrokerLoader.load(PactBrokerLoader.java:84)
at au.com.dius.pact.provider.junit.PactRunner.(PactRunner.kt:79)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at org.junit.internal.builders.AnnotatedBuilder.buildRunner(AnnotatedBuilder.java:104)
at org.junit.vintage.engine.discovery.DefensiveAllDefaultPossibilitiesBuilder$DefensiveAnnotatedBuilder.buildRunner(DefensiveAllDefaultPossibilitiesBuilder.java:113)
at org.junit.internal.builders.AnnotatedBuilder.runnerForClass(AnnotatedBuilder.java:86)
at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:59)
at org.junit.internal.builders.AllDefaultPossibilitiesBuilder.runnerForClass(AllDefaultPossibilitiesBuilder.java:26)
at org.junit.vintage.engine.discovery.DefensiveAllDefaultPossibilitiesBuilder.runnerForClass(DefensiveAllDefaultPossibilitiesBuilder.java:56)
at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:59)
at org.junit.vintage.engine.discovery.ClassSelectorResolver.resolveTestClass(ClassSelectorResolver.java:66)
at org.junit.vintage.engine.discovery.ClassSelectorResolver.resolve(ClassSelectorResolver.java:47)
at org.junit.platform.engine.support.discovery.EngineDiscoveryRequestResolution.lambda$resolve$2(EngineDiscoveryRequestResolution.java:129)
at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193)
at java.util.ArrayList$ArrayListSpliterator.tryAdvance(ArrayList.java:1359)
at java.util.stream.ReferencePipeline.forEachWithCancel(ReferencePipeline.java:126)
at java.util.stream.AbstractPipeline.copyIntoWithCancel(AbstractPipeline.java:499)
at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:486)
at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:472)
at java.util.stream.FindOps$FindOp.evaluateSequential(FindOps.java:152)
at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
at java.util.stream.ReferencePipeline.findFirst(ReferencePipeline.java:464)
at org.junit.platform.engine.support.discovery.EngineDiscoveryRequestResolution.resolve(EngineDiscoveryRequestResolution.java:174)
at org.junit.platform.engine.support.discovery.EngineDiscoveryRequestResolution.resolve(EngineDiscoveryRequestResolution.java:120)
at org.junit.platform.engine.support.discovery.EngineDiscoveryRequestResolution.resolveCompletely(EngineDiscoveryRequestResolution.java:87)
at org.junit.platform.engine.support.discovery.EngineDiscoveryRequestResolution.run(EngineDiscoveryRequestResolution.java:80)
at org.junit.platform.engine.support.discovery.EngineDiscoveryRequestResolver.resolve(EngineDiscoveryRequestResolver.java:112)
at org.junit.vintage.engine.discovery.VintageDiscoverer.discover(VintageDiscoverer.java:42)
at org.junit.vintage.engine.VintageTestEngine.discover(VintageTestEngine.java:62)
at org.junit.platform.launcher.core.DefaultLauncher.discoverEngineRoot(DefaultLauncher.java:177)
at org.junit.platform.launcher.core.DefaultLauncher.discoverRoot(DefaultLauncher.java:164)
at org.junit.platform.launcher.core.DefaultLauncher.discover(DefaultLauncher.java:120)
at org.eclipse.jdt.internal.junit5.runner.JUnit5TestReference.(JUnit5TestReference.java:45)
at org.eclipse.jdt.internal.junit5.runner.JUnit5TestLoader.createUnfilteredTest(JUnit5TestLoader.java:76)
at org.eclipse.jdt.internal.junit5.runner.JUnit5TestLoader.createTest(JUnit5TestLoader.java:66)
at org.eclipse.jdt.internal.junit5.runner.JUnit5TestLoader.loadTests(JUnit5TestLoader.java:53)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:526)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:770)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:464)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:210)
Caused by: java.net.ConnectException: Connection refused: connect
at java.net.DualStackPlainSocketImpl.connect0(Native Method)
at java.net.DualStackPlainSocketImpl.socketConnect(DualStackPlainSocketImpl.java:79)
at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)
at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:172)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
at java.net.Socket.connect(Socket.java:606)
at org.apache.http.conn.socket.PlainConnectionSocketFactory.connectSocket(PlainConnectionSocketFactory.java:75)
at org.apache.http.impl.conn.DefaultHttpClientConnectionOperator.connect(DefaultHttpClientConnectionOperator.java:142)
... 59 more

please let me know ..

can-i-deploy does not retry in case of connection errors

The retry-while-unknown and retry-interval parameters don't work as expected if the CLI cannot connect to the broker:

Expected behavior when passing --retry-while-unknown=5 --retry-interval=60: 5 attempts are made, wait time between tries is 60 seconds.

Actual behavior: 3 attempts are made, wait time between tries is 3(?) seconds (less than 60 in any case).

Kristines-MBP:bin tine$ time ./pact-broker can-i-deploy --retry-while-unknown=5 --retry-interval=60  -a messaging-app -b http://broker_app -e feaba6227a48e03c0eeb1c4a27d685496349e78d
Error making request - [...], attempt 1 of 3
Error making request - [...], attempt 2 of 3
Error making request - [...], attempt 3 of 3
Error retrieving matrix. SocketError - getaddrinfo: nodename nor servname provided, or not known
[...]

real    0m10.391s
user    0m0.301s
sys     0m0.060s

Not sure though if this case should actually be covered by the retry logic. Feel free to close if it shoudn't.

Explicitly listing pacticipants in can-i-deploy does not exclude those not listed

Following a conversation with @bethesque on Slack I understand that the following command:

pact-broker can-i-deploy --pacticipant $CONSUMER --version `cat git-version.txt` --pacticipant $PROVIDER --latest prod_env --broker-base-url $PACT_BROKER --broker-username $PACT_USER --broker-password $PACT_PASSWORD

should check the contracts between $CONSUMER and $PROVIDER and none other. I need this as I currently have a new contract for a second provider where the validation has not yet been set up. However, pact-broker can-i-deploy is failing with a no verified pact error. The broker is running version 2.44.0 and pact-broker is version 1.23.0.

Here is the output of the stage in our pipeline (with some details removed):

10:22:59.877 [go] Start to execute task: <exec command="/bin/bash" >
<arg>-l</arg>
<arg>-c</arg>
<arg>pact-broker can-i-deploy --verbose --pacticipant acdotcom --version `cat git-version.txt` --pacticipant 'WebTeam VehicleReservationService Provider' --latest prod_env --broker-base-url $PACT_BROKER --broker-username $PACT_USER --broker-password $PACT_PASSWORD</arg>
</exec>.
10:23:00.394 Found '/data/go-agent2/pipelines/dev-deploy-testing/.nvmrc' with version <10.15.3>
10:23:00.888 Now using node v10.15.3 (npm v6.4.1)
10:23:00.888 Using node version in .nvmrc
10:23:01.754 opening connection to XXX...
10:23:01.755 opened
10:23:01.756 <- "CONNECT XXX:443 HTTP/1.1\r\nHost: XXX:443\r\n\r\n"
10:23:02.141 -> "HTTP/1.1 200 Connection established\r\n"
10:23:02.141 -> "\r\n"
10:23:02.141 starting SSL for XXX...
10:23:02.757 SSL established
10:23:02.757 <- "GET /matrix?q[][pacticipant]=acdotcom&q[][version]=dc7ad582e91559a58fde16907ff76305bc0a9778&q[][pacticipant]=WebTeam%20VehicleReservationService%20Provider&q[][latest]=true&q[][tag]=prod_env&latestby=cvpv HTTP/1.1\r\nAccept: application/hal+json, application/json\r\nAuthorization: Basic XXX\r\nConnection: close\r\nHost: XXX\r\n\r\n"
10:23:03.229 -> "HTTP/1.1 200 OK\r\n"
10:23:03.229 -> "Date: Wed, 29 Jan 2020 10:23:03 GMT\r\n"
10:23:03.229 -> "Content-Type: application/hal+json;charset=utf-8\r\n"
10:23:03.229 -> "Content-Length: 1604\r\n"
10:23:03.229 -> "Connection: close\r\n"
10:23:03.229 -> "Status: 200 OK\r\n"
10:23:03.229 -> "Vary: Accept\r\n"
10:23:03.229 -> "X-Pact-Broker-Git-Sha: 5a85a5a4b0dc24f7ac680ea23dcc27439b7f0180\r\n"
10:23:03.229 -> "X-Request-Id: 6f71287563b9efd28ad4f41be7fcbc50\r\n"
10:23:03.229 -> "X-Saas-Broker-Git-Sha: 70561302d72510ab42aaa76ec9936ed5997434e6\r\n"
10:23:03.229 -> "X-Pact-Broker-Version: 2.44.0\r\n"
10:23:03.229 -> "X-Frame-Options: SAMEORIGIN\r\n"
10:23:03.229 -> "X-XSS-Protection: 1; mode=block\r\n"
10:23:03.229 -> "X-Content-Type-Options: nosniff\r\n"
10:23:03.229 -> "Referrer-Policy: strict-origin\r\n"
10:23:03.229 -> "Strict-Transport-Security: max-age=31536000 ; includeSubDomains\r\n"
10:23:03.229 -> "\r\n"
10:23:03.229 reading 1604 bytes...
10:23:03.229 -> "{\"summary\":{\"deployable\":null,\"reason\":\"There is no verified pact between version dc7ad582e91559a58fde16907ff76305bc0a9778 of acdotcom and any version of OrderBuilder\",\"success\":1,\"failed\":0,\"unknown\":1},\"matrix\":[{\"consumer\":{\"name\":\"acdotcom\",\"version\":{\"number\":\"dc7ad582e91559a58fde16907ff76305bc0a9778\",\"_links\":{\"self\":{\"href\":\"XXX/pacticipants/acdotcom/versions/dc7ad582e91559a58fde16907ff76305bc0a9778\"}},\"tags\":[{\"name\":\"prod_env\",\"latest\":true}]},\"_links\":{\"self\":{\"href\":\"XXX/pacticipants/acdotcom\"}}},\"provider\":{\"name\":\"WebTeam VehicleReservationService Provider\",\"version\":{\"number\":\"48f3eccc9746f4629eae2ac1cfb602effb401557\",\"_links\":{\"self\":{\"href\":\"XXX/pacticipants/WebTeam%20VehicleReservationService%20Provider/versions/48f3eccc9746f4629eae2ac1cfb602effb401557\"}},\"tags\":[{\"name\":\"prod_env\",\"latest\":true}]},\"_links\":{\"self\":{\"href\":\"XXX/pacticipants/WebTeam%20VehicleReservationService%20Provider\"}}},\"pact\":{\"createdAt\":\"2020-01-29T09:42:32+00:00\",\"_links\":{\"self\":{\"href\":\"XXX/pacts/provider/WebTeam%20VehicleReservationService%20Provider/consumer/acdotcom/version/dc7ad582e91559a58fde16907ff76305bc0a9778\"}}},\"verificationResult\":{\"success\":true,\"verifiedAt\":\"2020-01-29T09:56:55+00:00\",\"_links\":{\"self\":{\"href\":\"XXX/pacts/provider/WebTeam%20VehicleReservationService%20Provider/consumer/acdotcom/pact-version/d264196894c2058a66e1f664d867eaf1368e182d/verification-results/3853\"}}}}]}"
10:23:03.230 read 1604 bytes
10:23:03.230 Conn close
10:23:03.234 Computer says no �\_(?)_/� 
10:23:03.235 
10:23:03.235 CONSUMER | C.VERSION                      | PROVIDER                       | P.VERSION                      | SUCCESS?
10:23:03.235 ---------|--------------------------------|--------------------------------|--------------------------------|---------
10:23:03.235 acdotcom | dc7ad582e91559a58fde16907ff... | WebTeam VehicleReservationS... | 48f3eccc9746f4629eae2ac1cfb... | true    
10:23:03.235 
10:23:03.235 There is no verified pact between version dc7ad582e91559a58fde16907ff76305bc0a9778 of acdotcom and any version of OrderBuilder

Dependency on rake

hi @bethesque so I'll try opening this in the right place now! If you create a Gemfile with just your gem in it eg.
https://gist.github.com/nicpillinger/4de98867b8ad8e1946975dff879f166a

on trying to execute the pact-broker you get this:
https://www.dropbox.com/s/7sf6y21x6f3bc9k/Screenshot%202018-05-29%2010.18.50.png?dl=0

adding rake back into the Gemfile fixes it
https://www.dropbox.com/s/yvorkxps702eltc/Screenshot%202018-05-29%2010.20.56.png?dl=0

this is on OSX, no docker involvement at all. I'm using RVM and ruby 2.4.4

Support webhook upsert

To support putting the webhook configuration in the codebase, rather than making it a once off manual action. Automate all the things.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.