GitHub
02/08/2024, 2:15 PM<https://github.com/pact-foundation/pact-ruby-standalone/tree/master|master>
by YOU54F
<https://github.com/pact-foundation/pact-ruby-standalone/commit/87ee83670e86b39b785156f0c91f4d51c26c4aa6|87ee8367>
- chore(deps): upgrade traveling-ruby to 20240205-3.3.0
<https://github.com/pact-foundation/pact-ruby-standalone/commit/22f549dd92c0be42afb0a01e7f383e5189e5652c|22f549dd>
- Merge pull request #128 from pact-foundation/deps/traveling-ruby-20240205-3.3.0
pact-foundation/pact-ruby-standaloneGitHub
02/08/2024, 2:27 PM<https://github.com/pact-foundation/pact-ruby-standalone/tree/master|master>
by github-actions[bot]
<https://github.com/pact-foundation/pact-ruby-standalone/commit/217815b41f49b50498f49042f974637bc5f9e398|217815b4>
- chore(release): version 2.2.0
pact-foundation/pact-ruby-standaloneGitHub
02/08/2024, 2:27 PMcurl -fsSL <https://raw.githubusercontent.com/pact-foundation/pact-ruby-standalone/master/install.sh> | PACT_CLI_VERSION=v2.2.0 bash
MacOS
x86_64
curl -LO <https://github.com/pact-foundation/pact-ruby-standalone/releases/download/v2.2.0/pact-2.2.0-osx-x86_64.tar.gz>
tar xzf pact-2.2.0-osx-x86_64.tar.gz
arm64
curl -LO <https://github.com/pact-foundation/pact-ruby-standalone/releases/download/v2.2.0/pact-2.2.0-osx-arm64.tar.gz>
tar xzf pact-2.2.0-osx-arm64.tar.gz
Linux
x86_64
curl -LO <https://github.com/pact-foundation/pact-ruby-standalone/releases/download/v2.2.0/pact-2.2.0-linux-x86_64.tar.gz>
tar xzf pact-2.2.0-linux-x86_64.tar.gz
arm64
curl -LO <https://github.com/pact-foundation/pact-ruby-standalone/releases/download/v2.2.0/pact-2.2.0-linux-arm64.tar.gz>
tar xzf pact-2.2.0-linux-arm64.tar.gz
Windows
x86_64
curl -LO <https://github.com/pact-foundation/pact-ruby-standalone/releases/download/v2.2.0/pact-2.2.0-windows-x86_64.zip>
unzip pact-2.2.0-windows-x86_64.zip
x86
curl -LO <https://github.com/pact-foundation/pact-ruby-standalone/releases/download/v2.2.0/pact-2.2.0-windows-x86.zip>
unzip pact-2.2.0-windows-x86.zip
Pact Ruby Standalone
Build
Creates a standalone pact command line executable using the ruby pact implementation and Traveling Ruby
Package contents
This version (2.2.0) of the Pact standalone executables package contains:
• pact gem 1.64.0
• pact-mock_service gem 3.11.2
• pact-support gem 1.20.0
• pact-provider-verifier gem 1.38.0
• pact_broker-client gem 1.75.1
• pact-message gem 0.11.1
Binaries will be extracted into `pact/bin`:
./pact/bin/
├── pact
├── pact-broker
├── pactflow
├── pact-message
├── pact-mock-service
├── pact-provider-verifier
└── pact-stub-service
Windows Users
Please append .bat
to any of the provided binaries
eg.
.\pact\bin\pact-broker.bat
Installation
See the release page.
Supported Platforms
Ruby is not required on the host platform, Ruby 3.3.0 is provided in the distributable.
🚧 - Tested under emulation mode x86 / x86_64 in Windows on ARM
Usage
pact-mock-service
Commands:
pact-mock-service control # Run a Pact mock service control s...
pact-mock-service control-restart # Start a Pact mock service control...
pact-mock-service control-start # Start a Pact mock service control...
pact-mock-service control-stop # Stop a Pact mock service control ...
pact-mock-service help [COMMAND] # Describe available commands or on...
pact-mock-service restart # Start or restart a mock service. ...
pact-mock-service service # Start a mock service. If the cons...
pact-mock-service start # Start a mock service. If the cons...
pact-mock-service stop -p, --port=PORT # Stop a Pact mock service
pact-mock-service version # Show the pact-mock-service gem version
Usage:
pact-mock-service service
Options:
[--consumer=CONSUMER] # Consumer name
[--provider=PROVIDER] # Provider name
-p, [--port=PORT] # Port on which to run the service
-h, [--host=HOST] # Host on which to bind the service
# Default: localhost
-d, [--pact-dir=PACT_DIR] # Directory to which the pacts will be written
-m, [--pact-file-write-mode=PACT_FILE_WRITE_MODE] # `overwrite` or `merge`. Use `merge` when running multiple mock service instances in parallel for the same consumer/provider pair. Ensure the pact file is deleted before running tests when using this option so that interactions deleted from the code are not maintained in the file.
# Default: overwrite
-i, [--pact-specification-version=PACT_SPECIFICATION_VERSION] # The pact specification version to use when writing the pact. Note that only versions 1 and 2 are currently supported.
# Default: 2
-l, [--log=LOG] # File to which to log output
[--log-level=LOG_LEVEL] # Log level. Options are DEBUG INFO WARN ERROR
# Default: DEBUG
-o, [--cors=CORS] # Support browser security in tests by responding to OPTIONS requests and adding CORS headers to mocked responses
[--ssl], [--no-ssl] # Use a self-signed SSL cert to run the service over HTTPS
# Default: false
[--sslcert=SSLCERT] # Specify the path to the SSL cert to use when running the service over HTTPS
[--sslkey=SSLKEY] # Specify the path to the SSL key to use when running the service over HTTPS
Start a mock service. If the consumer, provider and pact-dir options are provided, the pact will be written automatically on shutdown (INT).
pact-stub-service
```
Usage:
pact-stub-service PACT_URI ...
Options:
-p, [--port=PORT] # Port on which to run the service
-h, [--host=HOST] # Host on which to bind the service
# Default: localhost
-l, [--log=LOG] # File to which to log output
-n, [--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 (can also be set using the PACT_BROKER_TOKEN environment variable)
[--log-level=LOG_LEVEL] # Log level. Options are DEBUG INFO WARN ERROR
# Default: DEBUG
-o, [--cors=CORS] # Support browser security in tests by responding to OPTIONS requests and adding CORS headers to mocked responses
[--ssl], [--no-ssl] # Use a self-signed SSL cert to run the service over HTTPS
# Default: false
[--sslcert=SSLCERT] # Specify the path to the SSL cert to use when running the service over HTTPS
[--sslkey=SSLKEY] # Specify the path to the SSL key to use when running the service over HTTPS
Description:
Start a stub service with the given pact file(s) or directories. Pact URIs
may be local file or directory paths, or HTTP. Include any basic auth details
in the URL using the format https://USERNAME:PASSWORD@URI. Where multiple
matching interactions are found, the interactions will be sorted by response
status, and the first one will be returned. This may lead to some
non-deterministic behaviour. If you are having problems with this, please
raise it on the pact-dev google group, and we can discuss some potential
enhancements. Note that only versions 1 and 2 of the pact specification are
currently fully supported. Pacts using the v3 format may be used, however,
any matching features added in v3 will currently be ignored.
`…
pact-foundation/pact-ruby-standaloneGitHub
02/08/2024, 2:34 PM<https://github.com/pact-foundation/pact-ruby-standalone/tree/master|master>
by YOU54F
<https://github.com/pact-foundation/pact-ruby-standalone/commit/74a6be3a895f97a2a2af3dd196f58b629a3adce1|74a6be3a>
- feat: use sh for wrapper scripts
<https://github.com/pact-foundation/pact-ruby-standalone/commit/1f03a9e8b158b8ce4b6ca062e089fa213324d08d|1f03a9e8>
- ci: test against bash and sh
<https://github.com/pact-foundation/pact-ruby-standalone/commit/d9faf54485cdbe45ffdf620b9d40114092dac3fa|d9faf544>
- Merge pull request #115 from pact-foundation/feat/use_sh_wrappers
pact-foundation/pact-ruby-standaloneGitHub
02/08/2024, 2:34 PMGitHub
02/08/2024, 2:34 PMGitHub
02/08/2024, 2:38 PM<https://github.com/pact-foundation/pact-ruby-standalone/tree/master|master>
by github-actions[bot]
<https://github.com/pact-foundation/pact-ruby-standalone/commit/fd23112396c2b8669c08ed3a35348159d91e0d1c|fd231123>
- chore(release): version 2.3.0
pact-foundation/pact-ruby-standaloneGitHub
02/08/2024, 2:38 PMcurl -fsSL <https://raw.githubusercontent.com/pact-foundation/pact-ruby-standalone/master/install.sh> | PACT_CLI_VERSION=v2.3.0 bash
MacOS
x86_64
curl -LO <https://github.com/pact-foundation/pact-ruby-standalone/releases/download/v2.3.0/pact-2.3.0-osx-x86_64.tar.gz>
tar xzf pact-2.3.0-osx-x86_64.tar.gz
arm64
curl -LO <https://github.com/pact-foundation/pact-ruby-standalone/releases/download/v2.3.0/pact-2.3.0-osx-arm64.tar.gz>
tar xzf pact-2.3.0-osx-arm64.tar.gz
Linux
x86_64
curl -LO <https://github.com/pact-foundation/pact-ruby-standalone/releases/download/v2.3.0/pact-2.3.0-linux-x86_64.tar.gz>
tar xzf pact-2.3.0-linux-x86_64.tar.gz
arm64
curl -LO <https://github.com/pact-foundation/pact-ruby-standalone/releases/download/v2.3.0/pact-2.3.0-linux-arm64.tar.gz>
tar xzf pact-2.3.0-linux-arm64.tar.gz
Windows
x86_64
curl -LO <https://github.com/pact-foundation/pact-ruby-standalone/releases/download/v2.3.0/pact-2.3.0-windows-x86_64.zip>
unzip pact-2.3.0-windows-x86_64.zip
x86
curl -LO <https://github.com/pact-foundation/pact-ruby-standalone/releases/download/v2.3.0/pact-2.3.0-windows-x86.zip>
unzip pact-2.3.0-windows-x86.zip
Pact Ruby Standalone
Build
Creates a standalone pact command line executable using the ruby pact implementation and Traveling Ruby
Package contents
This version (2.3.0) of the Pact standalone executables package contains:
• pact gem 1.64.0
• pact-mock_service gem 3.11.2
• pact-support gem 1.20.0
• pact-provider-verifier gem 1.38.0
• pact_broker-client gem 1.75.1
• pact-message gem 0.11.1
Binaries will be extracted into `pact/bin`:
./pact/bin/
├── pact
├── pact-broker
├── pactflow
├── pact-message
├── pact-mock-service
├── pact-provider-verifier
└── pact-stub-service
Windows Users
Please append .bat
to any of the provided binaries
eg.
.\pact\bin\pact-broker.bat
Installation
See the release page.
Supported Platforms
Ruby is not required on the host platform, Ruby 3.3.0 is provided in the distributable.
🚧 - Tested under emulation mode x86 / x86_64 in Windows on ARM
Usage
pact-mock-service
Commands:
pact-mock-service control # Run a Pact mock service control s...
pact-mock-service control-restart # Start a Pact mock service control...
pact-mock-service control-start # Start a Pact mock service control...
pact-mock-service control-stop # Stop a Pact mock service control ...
pact-mock-service help [COMMAND] # Describe available commands or on...
pact-mock-service restart # Start or restart a mock service. ...
pact-mock-service service # Start a mock service. If the cons...
pact-mock-service start # Start a mock service. If the cons...
pact-mock-service stop -p, --port=PORT # Stop a Pact mock service
pact-mock-service version # Show the pact-mock-service gem version
Usage:
pact-mock-service service
Options:
[--consumer=CONSUMER] # Consumer name
[--provider=PROVIDER] # Provider name
-p, [--port=PORT] # Port on which to run the service
-h, [--host=HOST] # Host on which to bind the service
# Default: localhost
-d, [--pact-dir=PACT_DIR] # Directory to which the pacts will be written
-m, [--pact-file-write-mode=PACT_FILE_WRITE_MODE] # `overwrite` or `merge`. Use `merge` when running multiple mock service instances in parallel for the same consumer/provider pair. Ensure the pact file is deleted before running tests when using this option so that interactions deleted from the code are not maintained in the file.
# Default: overwrite
-i, [--pact-specification-version=PACT_SPECIFICATION_VERSION] # The pact specification version to use when writing the pact. Note that only versions 1 and 2 are currently supported.
# Default: 2
-l, [--log=LOG] # File to which to log output
[--log-level=LOG_LEVEL] # Log level. Options are DEBUG INFO WARN ERROR
# Default: DEBUG
-o, [--cors=CORS] # Support browser security in tests by responding to OPTIONS requests and adding CORS headers to mocked responses
[--ssl], [--no-ssl] # Use a self-signed SSL cert to run the service over HTTPS
# Default: false
[--sslcert=SSLCERT] # Specify the path to the SSL cert to use when running the service over HTTPS
[--sslkey=SSLKEY] # Specify the path to the SSL key to use when running the service over HTTPS
Start a mock service. If the consumer, provider and pact-dir options are provided, the pact will be written automatically on shutdown (INT).
pact-stub-service
```
Usage:
pact-stub-service PACT_URI ...
Options:
-p, [--port=PORT] # Port on which to run the service
-h, [--host=HOST] # Host on which to bind the service
# Default: localhost
-l, [--log=LOG] # File to which to log output
-n, [--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 (can also be set using the PACT_BROKER_TOKEN environment variable)
[--log-level=LOG_LEVEL] # Log level. Options are DEBUG INFO WARN ERROR
# Default: DEBUG
-o, [--cors=CORS] # Support browser security in tests by responding to OPTIONS requests and adding CORS headers to mocked responses
[--ssl], [--no-ssl] # Use a self-signed SSL cert to run the service over HTTPS
# Default: false
[--sslcert=SSLCERT] # Specify the path to the SSL cert to use when running the service over HTTPS
[--sslkey=SSLKEY] # Specify the path to the SSL key to use when running the service over HTTPS
Description:
Start a stub service with the given pact file(s) or directories. Pact URIs
may be local file or directory paths, or HTTP. Include any basic auth details
in the URL using the format https://USERNAME:PASSWORD@URI. Where multiple
matching interactions are found, the interactions will be sorted by response
status, and the first one will be returned. This may lead to some
non-deterministic behaviour. If you are having problems with this, please
raise it on the pact-dev google group, and we can discuss some potential
enhancements. Note that only versions 1 and 2 of the pact specification are
currently fully supported. Pacts using the v3 format may be used, however,
any matching features added in v3 will currently be ignored.
`…
pact-foundation/pact-ruby-standaloneGitHub
02/08/2024, 3:52 PM<https://github.com/pact-foundation/pact-ruby-standalone/tree/master|master>
by YOU54F
<https://github.com/pact-foundation/pact-ruby-standalone/commit/2b43c309e23f3fab0f63db6c00fc73c335ac2c36|2b43c309>
- Revert "chore(deps): upgrade traveling-ruby to 20240205-3.3.0"
<https://github.com/pact-foundation/pact-ruby-standalone/commit/3f9cf3ffa01f45431688ee27d5e8d1a04187229a|3f9cf3ff>
- Merge pull request #129 from pact-foundation/revert-128-deps/traveling-ruby-20240205-3.3.0
pact-foundation/pact-ruby-standaloneGitHub
02/08/2024, 3:54 PM<https://github.com/pact-foundation/pact-ruby-standalone/tree/master|master>
by github-actions[bot]
<https://github.com/pact-foundation/pact-ruby-standalone/commit/e08008cb2dae1a13c1934be566ac345fc87e9e68|e08008cb>
- chore(release): version 2.3.1
pact-foundation/pact-ruby-standaloneGitHub
02/08/2024, 3:54 PMcurl -fsSL <https://raw.githubusercontent.com/pact-foundation/pact-ruby-standalone/master/install.sh> | PACT_CLI_VERSION=v2.3.1 bash
MacOS
x86_64
curl -LO <https://github.com/pact-foundation/pact-ruby-standalone/releases/download/v2.3.1/pact-2.3.1-osx-x86_64.tar.gz>
tar xzf pact-2.3.1-osx-x86_64.tar.gz
arm64
curl -LO <https://github.com/pact-foundation/pact-ruby-standalone/releases/download/v2.3.1/pact-2.3.1-osx-arm64.tar.gz>
tar xzf pact-2.3.1-osx-arm64.tar.gz
Linux
x86_64
curl -LO <https://github.com/pact-foundation/pact-ruby-standalone/releases/download/v2.3.1/pact-2.3.1-linux-x86_64.tar.gz>
tar xzf pact-2.3.1-linux-x86_64.tar.gz
arm64
curl -LO <https://github.com/pact-foundation/pact-ruby-standalone/releases/download/v2.3.1/pact-2.3.1-linux-arm64.tar.gz>
tar xzf pact-2.3.1-linux-arm64.tar.gz
Windows
x86_64
curl -LO <https://github.com/pact-foundation/pact-ruby-standalone/releases/download/v2.3.1/pact-2.3.1-windows-x86_64.zip>
unzip pact-2.3.1-windows-x86_64.zip
x86
curl -LO <https://github.com/pact-foundation/pact-ruby-standalone/releases/download/v2.3.1/pact-2.3.1-windows-x86.zip>
unzip pact-2.3.1-windows-x86.zip
Pact Ruby Standalone
Build
Creates a standalone pact command line executable using the ruby pact implementation and Traveling Ruby
Package contents
This version (2.3.1) of the Pact standalone executables package contains:
• pact gem 1.64.0
• pact-mock_service gem 3.11.2
• pact-support gem 1.20.0
• pact-provider-verifier gem 1.38.0
• pact_broker-client gem 1.75.1
• pact-message gem 0.11.1
Binaries will be extracted into `pact/bin`:
./pact/bin/
├── pact
├── pact-broker
├── pactflow
├── pact-message
├── pact-mock-service
├── pact-provider-verifier
└── pact-stub-service
Windows Users
Please append .bat
to any of the provided binaries
eg.
.\pact\bin\pact-broker.bat
Installation
See the release page.
Supported Platforms
Ruby is not required on the host platform, Ruby 3.2.2 is provided in the distributable.
🚧 - Tested under emulation mode x86 / x86_64 in Windows on ARM
Usage
pact-mock-service
Commands:
pact-mock-service control # Run a Pact mock service control s...
pact-mock-service control-restart # Start a Pact mock service control...
pact-mock-service control-start # Start a Pact mock service control...
pact-mock-service control-stop # Stop a Pact mock service control ...
pact-mock-service help [COMMAND] # Describe available commands or on...
pact-mock-service restart # Start or restart a mock service. ...
pact-mock-service service # Start a mock service. If the cons...
pact-mock-service start # Start a mock service. If the cons...
pact-mock-service stop -p, --port=PORT # Stop a Pact mock service
pact-mock-service version # Show the pact-mock-service gem version
Usage:
pact-mock-service service
Options:
[--consumer=CONSUMER] # Consumer name
[--provider=PROVIDER] # Provider name
-p, [--port=PORT] # Port on which to run the service
-h, [--host=HOST] # Host on which to bind the service
# Default: localhost
-d, [--pact-dir=PACT_DIR] # Directory to which the pacts will be written
-m, [--pact-file-write-mode=PACT_FILE_WRITE_MODE] # `overwrite` or `merge`. Use `merge` when running multiple mock service instances in parallel for the same consumer/provider pair. Ensure the pact file is deleted before running tests when using this option so that interactions deleted from the code are not maintained in the file.
# Default: overwrite
-i, [--pact-specification-version=PACT_SPECIFICATION_VERSION] # The pact specification version to use when writing the pact. Note that only versions 1 and 2 are currently supported.
# Default: 2
-l, [--log=LOG] # File to which to log output
[--log-level=LOG_LEVEL] # Log level. Options are DEBUG INFO WARN ERROR
# Default: DEBUG
-o, [--cors=CORS] # Support browser security in tests by responding to OPTIONS requests and adding CORS headers to mocked responses
[--ssl], [--no-ssl] # Use a self-signed SSL cert to run the service over HTTPS
# Default: false
[--sslcert=SSLCERT] # Specify the path to the SSL cert to use when running the service over HTTPS
[--sslkey=SSLKEY] # Specify the path to the SSL key to use when running the service over HTTPS
Start a mock service. If the consumer, provider and pact-dir options are provided, the pact will be written automatically on shutdown (INT).
pact-stub-service
```
Usage:
pact-stub-service PACT_URI ...
Options:
-p, [--port=PORT] # Port on which to run the service
-h, [--host=HOST] # Host on which to bind the service
# Default: localhost
-l, [--log=LOG] # File to which to log output
-n, [--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 (can also be set using the PACT_BROKER_TOKEN environment variable)
[--log-level=LOG_LEVEL] # Log level. Options are DEBUG INFO WARN ERROR
# Default: DEBUG
-o, [--cors=CORS] # Support browser security in tests by responding to OPTIONS requests and adding CORS headers to mocked responses
[--ssl], [--no-ssl] # Use a self-signed SSL cert to run the service over HTTPS
# Default: false
[--sslcert=SSLCERT] # Specify the path to the SSL cert to use when running the service over HTTPS
[--sslkey=SSLKEY] # Specify the path to the SSL key to use when running the service over HTTPS
Description:
Start a stub service with the given pact file(s) or directories. Pact URIs
may be local file or directory paths, or HTTP. Include any basic auth details
in the URL using the format https://USERNAME:PASSWORD@URI. Where multiple
matching interactions are found, the interactions will be sorted by response
status, and the first one will be returned. This may lead to some
non-deterministic behaviour. If you are having problems with this, please
raise it on the pact-dev google group, and we can discuss some potential
enhancements. Note that only versions 1 and 2 of the pact specification are
currently fully supported. Pacts using the v3 format may be used, however,
any matching features added in v3 will currently be ignored.
`…
pact-foundation/pact-ruby-standaloneYousaf Nabi (pactflow.io)
GitHub
02/09/2024, 12:10 PM├── pact
├── pactflow
├── pact-broker
├── pact-message
├── pact-mock-service
├── pact-stub-service
├── pact-provider-verifier
├── pact_mock_server_cli
├── pact-stub-server
├── pact_verifier_cli
└── pact-plugin-cli
If that is produced in one place, its easy for HomeBrew / Scoop and our scripted installed to provide a ruby-standalone or full-fat cli experience.
Ideally we could use Rust going forward as a way to provide a directory to install all the cli tooling, the pact-plugin-cli
provides a nice template for that.
Could a pact-cli
command in Rust, abstract away the rubyisms behind, so a pact-cli broker
command feels natural and the fact it is ruby or rust in the backend is a moot point.
For tools there are duplicated in rust/ruby, we could provide an abstraction through a single command (rather than having two) and use a switch --legacy
or PACT_USE_LEGACY=1
env var to switch between either the rust or the ruby impl.
├── pact-mock-service
├── pact-stub-service
├── pact-provider-verifier
├── pact_mock_server_cli
├── pact-stub-server
├── pact_verifier_cli
Brain dump
The pact-ruby-standalone project recently added the pact-plugin-cli to the bundle
This weighs in at 12Mb and hugely inflates our bundle.
This proposal suggests a couple of different packages
• pact - ruby only pact packages
• pact-rust - ruby + rust packages
• pact-ffi - ruby + pact_ffi lib and pact-ffi gem
• pact-cli - ruby + rust + pact_ffi lib and pact-ffi gem
for any of the combinations above, they can have
• pact--slim
augmentations, which seek to trim out as much as possible from the ruby runtime.
Note:- the slim versions may not work and need throughly testing, cursory testing has been
done so far.
The overall aim is provide users with a single bundled distribution called pact-cli
which contains every single pact executable so the users can get all the pact goodness at their
fingertips.
This will have benefits for packaging with HomeBrew/Scoop/Choco and our own install script.
In the future it would be nice to extend pact-plugin-cli which can discover and install plugins
to discover all of the pact tooling (official and community provided) and provide a mechanism to install
to a shared location such as PACT_HOME_DIR which would default to $HOME/.pact
This pattern is already in use in the pact-plugin-cli
Could we further this, so users only need the standalone in a single location, and the ffi libs in a single location, and our various client libraries to point to the relevant home folder, and not require the packages to contain the host libraries themselves. This may not be practical for some libs which need to build from source, but if the source was already on their machine, via our installer, maybe that makes it less of an issue.
The tree of all tools would currently look like this
├── pact
├── pactflow
├── pact-broker
├── pact-message
├── pact-mock-service
├── pact-stub-service
├── pact-provider-verifier
├── pact_mock_server_cli
├── pact-stub-server
├── pact_verifier_cli
└── pact-plugin-cli
Users would be able to interact with the FFI by
`${PATH_TO_RUBY}ruby -rpact/ffi -e "puts PactFfi.pactffi_version"`
Package sizes
Full Ruby Bundle - with pact-plugin-cli
As per todays release.
49M pkg/pact
16M pkg/pact-2.0.2-linux-arm64.tar.gz
16M pkg/pact-2.0.2-linux-x86_64.tar.gz
14M pkg/pact-2.0.2-osx-arm64.tar.gz
15M pkg/pact-2.0.2-osx-x86_64.tar.gz
11M pkg/pact-2.0.2-windows-x86.zip
16M pkg/pact-2.0.2-windows-x86_64.zip
Full Ruby (only) Bundle
37M pkg/pact
12M pkg/pact-2.0.2-windows-x86_64.zip
12M pkg/pact-2.0.2-windows-x86.zip
10M pkg/pact-2.0.2-osx-x86_64.tar.gz
10M pkg/pact-2.0.2-linux-x86_64.tar.gz
9.0M pkg/pact-2.0.2-osx-arm64.tar.gz
9.0M pkg/pact-2.0.2-linux-arm64.tar.gz
Trimmed Ruby (only) Bundle
TRIM_PACKAGE_FULL=true bundle exec rake package
28M pkg/pact
10M pact-2.0.2-windows-x86.zip
9.7M pact-2.0.2-windows-x86_64.zip
7.0M pact-2.0.2-linux-arm64.tar.gz
7.0M pact-2.0.2-linux-x86_64.tar.gz
7.0M pact-2.0.2-osx-arm64.tar.gz
7.0M pact-2.0.2-osx-x86_64.tar.gz
Full Ruby Bundle + Pact Rust Tools
PACKAGE_PACT_RUST_TOOLS=true bundle exec rake package
98M pkg/pact
41M pkg/pact-2.0.2-linux-x86_64.tar.gz
39M pkg/pact-2.0.2-linux-arm64.tar.gz
34M pkg/pact-2.0.2-osx-x86_64.tar.gz
33M pkg/pact-2.0.2-osx-arm64.tar.gz
33M pkg/pact-2.0.2-windows-x86_64.zip
11M pkg/pact-2.0.2-windows-x86.zip
du -sh pkg/pact/bin/* | sort -nr
18M pkg/pact/bin/pact_verifier_cli
17M pkg/pact/bin/pact_mock_server_cli
14M pkg/pact/bin/pact-stub-server
12M pkg/pact/bin/pact-plugin-cli
Ruby (only) + Pact-Ffi Gem (and pact_ffi libs) Bundle
PACKAGE_PACT_FFI=true bundle exec rake package
64M pkg/pact
21M pkg/pact-2.0.2-windows-x86_64.zip
21M pkg/pact-2.0.2-windows-x86.zip
19M pkg/pact-2.0.2-osx-x86_64.tar.gz
19M pkg/pact-2.0.2-osx-arm64.tar.gz
19M pkg/pact-2.0.2-linux-x86_64.tar.gz
19M pkg/pact-2.0.2-linux-arm64.tar.gz
24M pkg/pact/lib/vendor/ruby/3.2.0/gems/pact-ffi-0.0.2-arm64-darwin/ffi/macos-arm64/libpact_ffi.dylib
Full Ruby Bundle + Pact Rust Tools + Pact-Ffi Gem (and pact_ffi libs)
PACKAGE_PACT_RUST_TOOLS=true PACKAGE_PACT_FFI=true bundle exec rake package
123M pkg/pact-cli
52M pkg/pact-cli-2.0.2-linux-x86_64.tar.gz
51M pkg/pact-cli-2.0.2-linux-arm64.tar.gz
43M pkg/pact-cli-2.0.2-osx-x86_64.tar.gz
41M pkg/pact-cli-2.0.2-osx-arm64.tar.gz
33M pkg/pact-cli-2.0.2-windows-x86_64.zip
12M pkg/pact-cli-2.0.2-windows-x86.zip
24M pkg/pact/lib/vendor/ruby/3.2.0/gems/pact-ffi-0.0.2-arm64-darwin/ffi/macos-arm64/libpact_ffi.dylib
Building & Testing.
You can easily run through the testing by passing the same env vars.
The following scenario will
• package the pact-ruby-standalone for osx:arm64
• include the rust tools
• include the pact ffi
• unpack the built package that would be distributed to users
• runs a smoke test against the package
PACKAGE_PACT_RUST_TOOLS=true PACKAGE_PACT_FFI=true bundle exec rake package:osx:arm64
PACKAGE_PACT_RUST_TOOLS=true PACKAGE_PACT_FFI=true PACKAGE_NAME=pact-cli ./script/unpack-and-test.sh
You can run the smoke tests anyway, your standalone directory lives.
• Run the script /script/test.sh
• Set your env vars
• PATH_TO_BIN=pkg/pact-cli/bin/
default is $PACKAGE_NAME/bin/
• ensure it has a trailing /
• if windows, reverse the slashes \
• PACKAGE_NAME
default is pact
Example scenario
• runs a smoke test against the package
• includes tests for the rust tools
• includes test for the pact ffi
PACKAGE_PACT_RUST_TOOLS=true PACKAGE_PACT_FFI=true PACKAGE_NAME=pact-cli PATH_TO_BIN=pkg/pact-cli/bin/ ./script/test.sh
pact-foundation/pact-ruby-standalone
✅ All checks have passed
24/24 successful checksGitHub
02/09/2024, 12:11 PMGitHub
02/09/2024, 1:07 PM<https://github.com/pact-foundation/pact-ruby-standalone/tree/master|master>
by YOU54F
<https://github.com/pact-foundation/pact-ruby-standalone/commit/d16ec5fc3002536b45a4a6554dfcdac60925acb9|d16ec5fc>
- Revert "Revert "chore(deps): upgrade traveling-ruby to 20240205-3.3.0""
<https://github.com/pact-foundation/pact-ruby-standalone/commit/8efbf971d22e6fbef20bad3fc3aed0207a8a4e46|8efbf971>
- Merge pull request #130 from pact-foundation/revert-129-revert-128-deps/traveling-ruby-20240205-3.3.0
pact-foundation/pact-ruby-standaloneGitHub
02/09/2024, 1:09 PM#!/bin/sh
However, the syntax is bash specific. This is fine for systems the have /bin/sh
pointing to bash. This is not the case for many new linux systems (/bin/sh
points to dash in new debian based destros).
For example:
if [[ $TARGET == /* ]]; then
is bash specific and it would never evaluate to true and will cause issues when trying to create relative symlinks to the shell scripts.
Wouldn't it be better to change it to:
#!/bin/bash
If the aim was to provide a POSIX based script, then the logic will need to change slightly to accommodate using [ <cmd> ]
instead of [[ <comd> ]]
Thanks
Amr
pact-foundation/pact-ruby-standaloneGitHub
02/09/2024, 1:13 PM<https://github.com/pact-foundation/pact-ruby-standalone/tree/master|master>
by github-actions[bot]
<https://github.com/pact-foundation/pact-ruby-standalone/commit/53b6151decc9604dea5f8ff0954841d4d7e22a2d|53b6151d>
- chore(release): version 2.4.0
pact-foundation/pact-ruby-standaloneGitHub
02/09/2024, 1:13 PMcurl -fsSL <https://raw.githubusercontent.com/pact-foundation/pact-ruby-standalone/master/install.sh> | PACT_CLI_VERSION=v2.4.0 bash
MacOS
x86_64
curl -LO <https://github.com/pact-foundation/pact-ruby-standalone/releases/download/v2.4.0/pact-2.4.0-osx-x86_64.tar.gz>
tar xzf pact-2.4.0-osx-x86_64.tar.gz
arm64
curl -LO <https://github.com/pact-foundation/pact-ruby-standalone/releases/download/v2.4.0/pact-2.4.0-osx-arm64.tar.gz>
tar xzf pact-2.4.0-osx-arm64.tar.gz
Linux
x86_64
curl -LO <https://github.com/pact-foundation/pact-ruby-standalone/releases/download/v2.4.0/pact-2.4.0-linux-x86_64.tar.gz>
tar xzf pact-2.4.0-linux-x86_64.tar.gz
arm64
curl -LO <https://github.com/pact-foundation/pact-ruby-standalone/releases/download/v2.4.0/pact-2.4.0-linux-arm64.tar.gz>
tar xzf pact-2.4.0-linux-arm64.tar.gz
Windows
x86_64
curl -LO <https://github.com/pact-foundation/pact-ruby-standalone/releases/download/v2.4.0/pact-2.4.0-windows-x86_64.zip>
unzip pact-2.4.0-windows-x86_64.zip
x86
curl -LO <https://github.com/pact-foundation/pact-ruby-standalone/releases/download/v2.4.0/pact-2.4.0-windows-x86.zip>
unzip pact-2.4.0-windows-x86.zip
Pact Ruby Standalone
Build
Creates a standalone pact command line executable using the ruby pact implementation and Traveling Ruby
Package contents
This version (2.4.0) of the Pact standalone executables package contains:
• pact gem 1.64.0
• pact-mock_service gem 3.11.2
• pact-support gem 1.20.0
• pact-provider-verifier gem 1.38.0
• pact_broker-client gem 1.75.1
• pact-message gem 0.11.1
Binaries will be extracted into `pact/bin`:
./pact/bin/
├── pact
├── pact-broker
├── pactflow
├── pact-message
├── pact-mock-service
├── pact-provider-verifier
└── pact-stub-service
Windows Users
Please append .bat
to any of the provided binaries
eg.
.\pact\bin\pact-broker.bat
Installation
See the release page.
Supported Platforms
Ruby is not required on the host platform, Ruby 3.3.0 is provided in the distributable.
🚧 - Tested under emulation mode x86 / x86_64 in Windows on ARM
Usage
pact-mock-service
Commands:
pact-mock-service control # Run a Pact mock service control s...
pact-mock-service control-restart # Start a Pact mock service control...
pact-mock-service control-start # Start a Pact mock service control...
pact-mock-service control-stop # Stop a Pact mock service control ...
pact-mock-service help [COMMAND] # Describe available commands or on...
pact-mock-service restart # Start or restart a mock service. ...
pact-mock-service service # Start a mock service. If the cons...
pact-mock-service start # Start a mock service. If the cons...
pact-mock-service stop -p, --port=PORT # Stop a Pact mock service
pact-mock-service version # Show the pact-mock-service gem version
Usage:
pact-mock-service service
Options:
[--consumer=CONSUMER] # Consumer name
[--provider=PROVIDER] # Provider name
-p, [--port=PORT] # Port on which to run the service
-h, [--host=HOST] # Host on which to bind the service
# Default: localhost
-d, [--pact-dir=PACT_DIR] # Directory to which the pacts will be written
-m, [--pact-file-write-mode=PACT_FILE_WRITE_MODE] # `overwrite` or `merge`. Use `merge` when running multiple mock service instances in parallel for the same consumer/provider pair. Ensure the pact file is deleted before running tests when using this option so that interactions deleted from the code are not maintained in the file.
# Default: overwrite
-i, [--pact-specification-version=PACT_SPECIFICATION_VERSION] # The pact specification version to use when writing the pact. Note that only versions 1 and 2 are currently supported.
# Default: 2
-l, [--log=LOG] # File to which to log output
[--log-level=LOG_LEVEL] # Log level. Options are DEBUG INFO WARN ERROR
# Default: DEBUG
-o, [--cors=CORS] # Support browser security in tests by responding to OPTIONS requests and adding CORS headers to mocked responses
[--ssl], [--no-ssl] # Use a self-signed SSL cert to run the service over HTTPS
# Default: false
[--sslcert=SSLCERT] # Specify the path to the SSL cert to use when running the service over HTTPS
[--sslkey=SSLKEY] # Specify the path to the SSL key to use when running the service over HTTPS
Start a mock service. If the consumer, provider and pact-dir options are provided, the pact will be written automatically on shutdown (INT).
pact-stub-service
```
Usage:
pact-stub-service PACT_URI ...
Options:
-p, [--port=PORT] # Port on which to run the service
-h, [--host=HOST] # Host on which to bind the service
# Default: localhost
-l, [--log=LOG] # File to which to log output
-n, [--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 (can also be set using the PACT_BROKER_TOKEN environment variable)
[--log-level=LOG_LEVEL] # Log level. Options are DEBUG INFO WARN ERROR
# Default: DEBUG
-o, [--cors=CORS] # Support browser security in tests by responding to OPTIONS requests and adding CORS headers to mocked responses
[--ssl], [--no-ssl] # Use a self-signed SSL cert to run the service over HTTPS
# Default: false
[--sslcert=SSLCERT] # Specify the path to the SSL cert to use when running the service over HTTPS
[--sslkey=SSLKEY] # Specify the path to the SSL key to use when running the service over HTTPS
Description:
Start a stub service with the given pact file(s) or directories. Pact URIs
may be local file or directory paths, or HTTP. Include any basic auth details
in the URL using the format https://USERNAME:PASSWORD@URI. Where multiple
matching interactions are found, the interactions will be sorted by response
status, and the first one will be returned. This may lead to some
non-deterministic behaviour. If you are having problems with this, please
raise it on the pact-dev google group, and we can discuss some potential
enhancements. Note that only versions 1 and 2 of the pact specification are
currently fully supported. Pacts using the v3 format may be used, however,
any matching features added in v3 will currently be ignored.
`…
pact-foundation/pact-ruby-standaloneGitHub
02/12/2024, 10:57 PM/app # apk add gcompat
fetch <https://dl-cdn.alpinelinux.org/alpine/v3.19/main/aarch64/APKINDEX.tar.gz>
fetch <https://dl-cdn.alpinelinux.org/alpine/v3.19/community/aarch64/APKINDEX.tar.gz>
(1/3) Installing musl-obstack (1.2.3-r2)
(2/3) Installing libucontext (1.2-r2)
(3/3) Installing gcompat (1.1.0-r4)
OK: 8 MiB in 18 packages
/app # pact/bin/pact-mock-service
mock WARN: Please note: we are tracking events anonymously to gather important usage statistics like Pact-Ruby version and operating system. To disable tracking, set the 'PACT_DO_NOT_TRACK' environment variable to 'true'.
INFO WEBrick 1.8.1
INFO ruby 3.2.3 (2024-01-18) [aarch64-linux]
INFO WEBrick::HTTPServer#start: pid=9 port=45811
Pre change with Ruby 3.3.0
```
mock WARN: Please note: we are tracking events anonymously to gather important usage statistics like Pact-Ruby version and operating system. To disable tracking, set the 'PACT_DO_NOT_TRACK' environment variable to 'true'.
/pact/lib/vendor/ruby/3.3.0/gems/find_a_port-1.0.1/lib/find_a_port.rb16 [BUG] Segmentation fault at 0x00000000000062e0
ruby 3.3.0 (2023-12-25 revision 5124f9ac75) [aarch64-linux]
-- Control frame information -----------------------------------------------
c:0014 p:---- s:0082 e:000081 CFUNC :addr
c:0013 p:0013 s:0078 e:000077 METHOD /pact/lib/vendor/ruby/3.3.0/gems/find_a_port-1.0.1/lib/find_a_port.rb:16
c:0012 p:0022 s:0073 e:000072 METHOD /pact/lib/vendor/ruby/3.3.0/gems/pact-mock_service-3.11.2/lib/pact/mock_service/run.rb:111
c:0011 p:0044 s:0069 e:000065 METHOD /pact/lib/vendor/ruby/3.3.0/gems/pact-mock_service-3.11.2/lib/pact/mock_service/run.rb:119
c:0010 p:0034 s:0062 e:000059 METHOD /pact/lib/vendor/ruby/3.3.0/gems/pact-mock_service-3.11.2/lib/pact/mock_service/run.rb:40
c:0009 p:0029 s:0055 E:001670 METHOD /pact/lib/vendor/ruby/3.3.0/gems/pact-mock_service-3.11.2/lib/pact/mock_service/run.rb:29
c:0008 p:0007 s:0050 e:000049 METHOD /pact/lib/vendor/ruby/3.3.0/gems/pact-mock_service-3.11.2/lib/pact/mock_service/run.rb:14
c:0007 p:0017 s:0045 e:000044 METHOD /pact/lib/vendor/ruby/3.3.0/gems/pact-mock_service-3.11.2/lib/pact/mock_service/cli.rb:32
c:0006 p:0054 s:0041 e:000040 METHOD /pact/lib/vendor/ruby/3.3.0/gems/thor-1.3.0/lib/thor/command.rb:28
c:0005 p:0040 s:0033 e:000032 METHOD /pact/lib/vendor/ruby/3.3.0/gems/thor-1.3.0/lib/thor/invocation.rb:127
c:0004 p:0213 s:0026 e:000025 METHOD /pact/lib/vendor/ruby/3.3.0/gems/thor-1.3.0/lib/thor.rb:527
c:0003 p:0044 s:0013 e:000012 METHOD /pact/lib/vendor/ruby/3.3.0/gems/thor-1.3.0/lib/thor/base.rb:584
c:0002 p:0018 s:0006 e:000005 EVAL /pact/lib/app/pact-mock-service.rb:15 [FINISH]
c:0001 p:0000 s:0003 E:000ae0 DUMMY [FINISH]
-- Ruby level backtrace information ----------------------------------------
/pact/lib/app/pact-mock-service.rb15in `<main>'
/pact/lib/vendor/ruby/3.3.0/gems/thor-1.3.0/lib/thor/base.rb584in `start'
/pact/lib/vendor/ruby/3.3.0/gems/thor-1.3.0/lib/thor.rb527in `dispatch'
/pact/lib/vendor/ruby/3.3.0/gems/thor-1.3.0/lib/thor/invocation.rb127in `invoke_command'
/pact/lib/vendor/ruby/3.3.0/gems/thor-1.3.0/lib/thor/command.rb28in `run'
/pact/lib/vendor/ruby/3.3.0/gems/pact-mock_service-3.11.2/lib/pact/mock_service/cli.rb32in `service'
/pact/lib/vendor/ruby/3.3.0/gems/pact-mock_service-3.11.2/lib/pact/mock_service/run.rb14in `call'
/pact/lib/vendor/ruby/3.3.0/gems/pact-mock_service-3.11.2/lib/pact/mock_service/run.rb29in `call'
/pact/lib/vendor/ruby/3.3.0/gems/pact-mock_service-3.11.2/lib/pact/mock_service/run.rb40in `mock_service'
/pact/lib/vendor/ruby/3.3.0/gems/pact-mock_service-3.11.2/lib/pact/mock_service/run.rb119in `base_url'
/pact/lib/vendor/ruby/3.3.0/gems/pact-mock_service-3.11.2/lib/pact/mock_service/run.rb111in `port'
/pact/lib/vendor/ruby/3.3.0/gems/find_a_port-1.0.1/lib/find_a_port.rb16in `available_port'
/pact/lib/vendor/ruby/3.3.0/gems/find_a_port-1.0.1/lib/find_a_port.rb16in `addr'
-- Threading information ---------------------------------------------------
Total ractor count: 1
Ruby thread count for this ractor: 2
-- Machine register context ------------------------------------------------
x0: 0x0000ffffc4297ed0 x1: 0x0000000000000080 x2: 0x0000ffffc4297f10
x3: 0x0000ffff9ad515c0 x4: 0x0000000000000001 x5: 0x000000007fffffff
x6: 0x0000000000000000 x7: 0x0000000000000000 x18: 0x0000000000000000
x19: 0x0000ffffc4297f10 x20: 0x0000ffff9a69d4e0 x21: 0x0000ffff7edb93a8
x22: 0x0000ffffc4297ec8 x23: 0x0000ffffc4297ff0 x24: 0x0000000000000400
x25: 0x0000ffffc4297ed0 x26: 0x0000000000000010 x27: 0x0000ffff9a69d4a0
x28: 0x00000000000008b0 x29: 0x0000ffffc4297e20 sp: 0x0000ffffc4297e20
fau: 0x00000000000062e0
-- C level backtrace information -------------------------------------------
/pact/lib/ruby/bin.real/ruby(0xffff9aa0ab80) [0xffff9aa0ab80]
-- Other runtime information -----------------------------------------------
* Loaded script: /pact/lib/app/pact-mock-service.rb
* Loaded features:
0 enumerator.so
1 thread.rb
2 fiber.so
3 rational.so
4 complex.so
5 ruby2_keywords.rb
6 /pact/lib/ruby/lib/ruby/3.3.0/aarch64-linux/enc/encdb.so
7 /pact/lib/ruby/lib/ruby/3.3.0/aarch64-linux/enc/trans/transdb.so
8 /pact/lib/ruby/lib/ruby/3.3.0/aarch64-linux/rbconfig.rb
9 /pact/lib/ruby/lib/ruby/site_ruby/3.3.0/rubygems/compatibility.rb
10 /pact/lib/ruby/lib/ruby/site_ruby/3.3.0/rubygems/defaults.rb
11 /pact/lib/ruby/lib/ruby/site_ruby/3.3.0/rubygems/deprecate.rb
12 /pact/lib/ruby/lib/ruby/site_ruby/3.3.0/rubygems/errors.rb
13 /pact/lib/ruby/lib/ruby/site_ruby/3.3.0/rubygems/unknown_command_spell_checker.rb
14 /pact/lib/ruby/lib/ruby/site_ruby/3.3.0/rubygems/exceptions.rb
15 /pact/lib/ruby/lib/ruby/site_ruby/3.3.0/rubygems/basic_specification.rb
16 /pact/lib/ruby/lib/ruby/site_ruby/3.3.0/rubygems/stub_specification.rb
17 /pact/lib/ruby/lib/ruby/site_ruby/3.3.0/rubygems/platform.rb
18 /pact/lib/ruby/lib/ruby/site_ruby/3.3.0/rubygems/version.rb
19 /pact/lib/ruby/lib/ruby/site_ruby/3.3.0/rubygems/requirement.rb
20 /pact/lib/ruby/lib/ruby/site_ruby/3.3.0/rubygems/text.rb
21 /pact/lib/ruby/lib/ruby/site_ruby/3.3.0/rubygems/user_interaction.rb
22 /pact/lib/ruby/lib/ruby/site_ruby/3.3.0/rubygems/specification_policy.rb
23 /pact/lib/ruby/lib/ruby/site_ruby/3.3.0/rubygems/util/list.rb
24 /pact/lib/ruby/lib/ruby/site_ruby/3.3.0/rubygems/specification.rb
25 /pact/lib/ruby/lib/ruby/site_ruby/3.3.0/rubygems/util.rb
26 /pact/lib/ruby/lib/ruby/site_ruby/3.3.0/rubygems/dependency.rb
27 /pact/lib/ruby/lib/ruby/site_ruby/3.3.0/rubygems/core_ext/kernel_gem.rb
28 /pact/lib/ruby/lib/ruby/3.3.0/aarch64-linux/monitor.so
29 /pact/lib/ruby/lib/ruby/3.3.0/monitor.rb
30 /pact/lib/ruby/lib/ruby/site_ruby/3.3.0/rubygems/core_ext/kernel_require.rb
31 /pact/lib/ruby/lib/ruby/site_ruby/3.3.0/rubygems/core_ext/kernel_warn.rb
32 /pact/lib/ruby/lib/ruby/site_ruby/3.3.0/rubygems.rb
33 /pact/lib/ruby/lib/ruby/3.3.0/bundled_gems.rb
34 /pact/lib/ruby/lib/ruby/3.3.0/error_highlight/version.rb
35 /pact/lib/ruby/lib/ruby/3.3.0/error_highlight/base.rb
36 /pact/lib/ruby/lib/ruby/3.3.0/error_highlight/formatter.rb
37 /pact/lib/ruby/lib/ruby/3.3.0/error_highlight/core_ext.rb
38 /pact/lib/ruby/lib/ruby/3.3.0/error_highlight.rb
39 /pact/lib/ruby/lib/ruby/3.3.0/did_you_mean/version.rb
40 /pact/lib/ruby/lib/ruby/3.3.0/did_you_mean/core_ext/name_error.rb
41 /pact/lib/ruby/lib/ruby/3.3.0/did_you_mean/levenshtein.rb
42 /pact/lib/ruby/lib/ruby/3.3.0/did_you_mean/jaro_winkler.rb
43 /pact/lib/ruby/lib/ruby/3.3.0/did_you_mean/spell_checker.rb
44 /pact/lib/ruby/lib/ruby/3.3.0/did_you_mean/spell_checkers/…
pact-foundation/pact-ruby-standalone
✅ All checks have passed
15/15 successful checksGitHub
02/13/2024, 10:17 AM<https://github.com/pact-foundation/pact-ruby-standalone/tree/master|master>
by YOU54F
<https://github.com/pact-foundation/pact-ruby-standalone/commit/960313fac6fec5ce0b9f7671e61141e01a95c694|960313fa>
- fix: drop traveling-ruby to 3.2.3 due to segfaults on alpine
<https://github.com/pact-foundation/pact-ruby-standalone/commit/4ac73cb93c0ee7dd9d8f50001fdbd2d200aa1609|4ac73cb9>
- Merge pull request #131 from pact-foundation/fix/drop_tr_to_3_2_3
pact-foundation/pact-ruby-standaloneGitHub
02/13/2024, 10:19 AM<https://github.com/pact-foundation/pact-ruby-standalone/tree/master|master>
by github-actions[bot]
<https://github.com/pact-foundation/pact-ruby-standalone/commit/f4eb9a33492bad029e7761dc1b9760a1419821d7|f4eb9a33>
- chore(release): version 2.4.1
pact-foundation/pact-ruby-standaloneGitHub
02/13/2024, 10:19 AMcurl -fsSL <https://raw.githubusercontent.com/pact-foundation/pact-ruby-standalone/master/install.sh> | PACT_CLI_VERSION=v2.4.1 bash
MacOS
x86_64
curl -LO <https://github.com/pact-foundation/pact-ruby-standalone/releases/download/v2.4.1/pact-2.4.1-osx-x86_64.tar.gz>
tar xzf pact-2.4.1-osx-x86_64.tar.gz
arm64
curl -LO <https://github.com/pact-foundation/pact-ruby-standalone/releases/download/v2.4.1/pact-2.4.1-osx-arm64.tar.gz>
tar xzf pact-2.4.1-osx-arm64.tar.gz
Linux
x86_64
curl -LO <https://github.com/pact-foundation/pact-ruby-standalone/releases/download/v2.4.1/pact-2.4.1-linux-x86_64.tar.gz>
tar xzf pact-2.4.1-linux-x86_64.tar.gz
arm64
curl -LO <https://github.com/pact-foundation/pact-ruby-standalone/releases/download/v2.4.1/pact-2.4.1-linux-arm64.tar.gz>
tar xzf pact-2.4.1-linux-arm64.tar.gz
Windows
x86_64
curl -LO <https://github.com/pact-foundation/pact-ruby-standalone/releases/download/v2.4.1/pact-2.4.1-windows-x86_64.zip>
unzip pact-2.4.1-windows-x86_64.zip
x86
curl -LO <https://github.com/pact-foundation/pact-ruby-standalone/releases/download/v2.4.1/pact-2.4.1-windows-x86.zip>
unzip pact-2.4.1-windows-x86.zip
Pact Ruby Standalone
Build
Creates a standalone pact command line executable using the ruby pact implementation and Traveling Ruby
Package contents
This version (2.4.1) of the Pact standalone executables package contains:
• pact gem 1.64.0
• pact-mock_service gem 3.11.2
• pact-support gem 1.20.0
• pact-provider-verifier gem 1.38.0
• pact_broker-client gem 1.75.1
• pact-message gem 0.11.1
Binaries will be extracted into `pact/bin`:
./pact/bin/
├── pact
├── pact-broker
├── pactflow
├── pact-message
├── pact-mock-service
├── pact-provider-verifier
└── pact-stub-service
Windows Users
Please append .bat
to any of the provided binaries
eg.
.\pact\bin\pact-broker.bat
Installation
See the release page.
Supported Platforms
Ruby is not required on the host platform, Ruby 3.2.3 is provided in the distributable.
🚧 - Tested under emulation mode x86 / x86_64 in Windows on ARM
Usage
pact-mock-service
Commands:
pact-mock-service control # Run a Pact mock service control s...
pact-mock-service control-restart # Start a Pact mock service control...
pact-mock-service control-start # Start a Pact mock service control...
pact-mock-service control-stop # Stop a Pact mock service control ...
pact-mock-service help [COMMAND] # Describe available commands or on...
pact-mock-service restart # Start or restart a mock service. ...
pact-mock-service service # Start a mock service. If the cons...
pact-mock-service start # Start a mock service. If the cons...
pact-mock-service stop -p, --port=PORT # Stop a Pact mock service
pact-mock-service version # Show the pact-mock-service gem version
Usage:
pact-mock-service service
Options:
[--consumer=CONSUMER] # Consumer name
[--provider=PROVIDER] # Provider name
-p, [--port=PORT] # Port on which to run the service
-h, [--host=HOST] # Host on which to bind the service
# Default: localhost
-d, [--pact-dir=PACT_DIR] # Directory to which the pacts will be written
-m, [--pact-file-write-mode=PACT_FILE_WRITE_MODE] # `overwrite` or `merge`. Use `merge` when running multiple mock service instances in parallel for the same consumer/provider pair. Ensure the pact file is deleted before running tests when using this option so that interactions deleted from the code are not maintained in the file.
# Default: overwrite
-i, [--pact-specification-version=PACT_SPECIFICATION_VERSION] # The pact specification version to use when writing the pact. Note that only versions 1 and 2 are currently supported.
# Default: 2
-l, [--log=LOG] # File to which to log output
[--log-level=LOG_LEVEL] # Log level. Options are DEBUG INFO WARN ERROR
# Default: DEBUG
-o, [--cors=CORS] # Support browser security in tests by responding to OPTIONS requests and adding CORS headers to mocked responses
[--ssl], [--no-ssl] # Use a self-signed SSL cert to run the service over HTTPS
# Default: false
[--sslcert=SSLCERT] # Specify the path to the SSL cert to use when running the service over HTTPS
[--sslkey=SSLKEY] # Specify the path to the SSL key to use when running the service over HTTPS
Start a mock service. If the consumer, provider and pact-dir options are provided, the pact will be written automatically on shutdown (INT).
pact-stub-service
```
Usage:
pact-stub-service PACT_URI ...
Options:
-p, [--port=PORT] # Port on which to run the service
-h, [--host=HOST] # Host on which to bind the service
# Default: localhost
-l, [--log=LOG] # File to which to log output
-n, [--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 (can also be set using the PACT_BROKER_TOKEN environment variable)
[--log-level=LOG_LEVEL] # Log level. Options are DEBUG INFO WARN ERROR
# Default: DEBUG
-o, [--cors=CORS] # Support browser security in tests by responding to OPTIONS requests and adding CORS headers to mocked responses
[--ssl], [--no-ssl] # Use a self-signed SSL cert to run the service over HTTPS
# Default: false
[--sslcert=SSLCERT] # Specify the path to the SSL cert to use when running the service over HTTPS
[--sslkey=SSLKEY] # Specify the path to the SSL key to use when running the service over HTTPS
Description:
Start a stub service with the given pact file(s) or directories. Pact URIs
may be local file or directory paths, or HTTP. Include any basic auth details
in the URL using the format https://USERNAME:PASSWORD@URI. Where multiple
matching interactions are found, the interactions will be sorted by response
status, and the first one will be returned. This may lead to some
non-deterministic behaviour. If you are having problems with this, please
raise it on the pact-dev google group, and we can discuss some potential
enhancements. Note that only versions 1 and 2 of the pact specification are
currently fully supported. Pacts using the v3 format may be used, however,
any matching features added in v3 will currently be ignored.
`…
pact-foundation/pact-ruby-standaloneGitHub
02/27/2024, 1:20 PMx
):
☑︎ Upgraded to the latest version of the relevant libraries
☑︎ Checked to see if the issue has already been raised
☐ Created an executable example that demonstrates the issue using either:
• a Dockerfile
• a fork of https://github.com/pact-foundation/pact-ruby-standalone-e2e-example
• a Git repository with a Travis or Appveyor (or similar) build
• a gist with all the relevant code and full instructions on how to run it
N/A
Software versions
• pact-ruby-standalone: eg 2.4.1
Expected behaviour
Vulnerabilities fixed by updating the used rack version. Current version: 2.2.8 Versions with fix: 2.2.8.1, 3.0.9.1
Vulnerabilities fixed by updating the used openssl version. Current version 3.1.0 Versions with fix: 3.1.5, 3.2.1
Actual behaviour
High vulnerabilities raised in /home/builder/deps/pact/lib/vendor/ruby/3.2.0/specifications/rack-2.2.8.gemspec
Warn vulnerabilities raised in /home/builder/deps/pact/lib/ruby/lib/ruby/gems/3.2.0/specifications/default/openssl-3.1.0.gemspec
Steps to reproduce
Run software as normal. Vulnerabilities spotted through internal image scanning which includes the pact standalone binaries.
pact-foundation/pact-ruby-standaloneGitHub
02/27/2024, 2:20 PMGitHub
02/27/2024, 2:24 PM<https://github.com/pact-foundation/pact-ruby-standalone/tree/master|master>
by YOU54F
<https://github.com/pact-foundation/pact-ruby-standalone/commit/3e3e6ca4709fa85721d359d993ce9553b37d125e|3e3e6ca4>
- feat(deps): update rack 2.2.8.1
<https://github.com/pact-foundation/pact-ruby-standalone/commit/7caf65b111f9e5c83596f5c31403cec9d07a8927|7caf65b1>
- Merge pull request #133 from pact-foundation/fix/issue_132
pact-foundation/pact-ruby-standaloneGitHub
02/27/2024, 2:25 PM<https://github.com/pact-foundation/pact-ruby-standalone/tree/master|master>
by github-actions[bot]
<https://github.com/pact-foundation/pact-ruby-standalone/commit/abeee3dc705df36bad560fc53b71600e8fde7baa|abeee3dc>
- chore(release): version 2.4.2
pact-foundation/pact-ruby-standaloneGitHub
02/27/2024, 2:25 PMcurl -fsSL <https://raw.githubusercontent.com/pact-foundation/pact-ruby-standalone/master/install.sh> | PACT_CLI_VERSION=v2.4.2 bash
MacOS
x86_64
curl -LO <https://github.com/pact-foundation/pact-ruby-standalone/releases/download/v2.4.2/pact-2.4.2-osx-x86_64.tar.gz>
tar xzf pact-2.4.2-osx-x86_64.tar.gz
arm64
curl -LO <https://github.com/pact-foundation/pact-ruby-standalone/releases/download/v2.4.2/pact-2.4.2-osx-arm64.tar.gz>
tar xzf pact-2.4.2-osx-arm64.tar.gz
Linux
x86_64
curl -LO <https://github.com/pact-foundation/pact-ruby-standalone/releases/download/v2.4.2/pact-2.4.2-linux-x86_64.tar.gz>
tar xzf pact-2.4.2-linux-x86_64.tar.gz
arm64
curl -LO <https://github.com/pact-foundation/pact-ruby-standalone/releases/download/v2.4.2/pact-2.4.2-linux-arm64.tar.gz>
tar xzf pact-2.4.2-linux-arm64.tar.gz
Windows
x86_64
curl -LO <https://github.com/pact-foundation/pact-ruby-standalone/releases/download/v2.4.2/pact-2.4.2-windows-x86_64.zip>
unzip pact-2.4.2-windows-x86_64.zip
x86
curl -LO <https://github.com/pact-foundation/pact-ruby-standalone/releases/download/v2.4.2/pact-2.4.2-windows-x86.zip>
unzip pact-2.4.2-windows-x86.zip
Pact Ruby Standalone
Build
Creates a standalone pact command line executable using the ruby pact implementation and Traveling Ruby
Package contents
This version (2.4.2) of the Pact standalone executables package contains:
• pact gem 1.64.0
• pact-mock_service gem 3.11.2
• pact-support gem 1.20.0
• pact-provider-verifier gem 1.38.0
• pact_broker-client gem 1.75.1
• pact-message gem 0.11.1
Binaries will be extracted into `pact/bin`:
./pact/bin/
├── pact
├── pact-broker
├── pactflow
├── pact-message
├── pact-mock-service
├── pact-provider-verifier
└── pact-stub-service
Windows Users
Please append .bat
to any of the provided binaries
eg.
.\pact\bin\pact-broker.bat
Installation
See the release page.
Supported Platforms
Ruby is not required on the host platform, Ruby 3.2.3 is provided in the distributable.
🚧 - Tested under emulation mode x86 / x86_64 in Windows on ARM
Usage
pact-mock-service
Commands:
pact-mock-service control # Run a Pact mock service control s...
pact-mock-service control-restart # Start a Pact mock service control...
pact-mock-service control-start # Start a Pact mock service control...
pact-mock-service control-stop # Stop a Pact mock service control ...
pact-mock-service help [COMMAND] # Describe available commands or on...
pact-mock-service restart # Start or restart a mock service. ...
pact-mock-service service # Start a mock service. If the cons...
pact-mock-service start # Start a mock service. If the cons...
pact-mock-service stop -p, --port=PORT # Stop a Pact mock service
pact-mock-service version # Show the pact-mock-service gem version
Usage:
pact-mock-service service
Options:
[--consumer=CONSUMER] # Consumer name
[--provider=PROVIDER] # Provider name
-p, [--port=PORT] # Port on which to run the service
-h, [--host=HOST] # Host on which to bind the service
# Default: localhost
-d, [--pact-dir=PACT_DIR] # Directory to which the pacts will be written
-m, [--pact-file-write-mode=PACT_FILE_WRITE_MODE] # `overwrite` or `merge`. Use `merge` when running multiple mock service instances in parallel for the same consumer/provider pair. Ensure the pact file is deleted before running tests when using this option so that interactions deleted from the code are not maintained in the file.
# Default: overwrite
-i, [--pact-specification-version=PACT_SPECIFICATION_VERSION] # The pact specification version to use when writing the pact. Note that only versions 1 and 2 are currently supported.
# Default: 2
-l, [--log=LOG] # File to which to log output
[--log-level=LOG_LEVEL] # Log level. Options are DEBUG INFO WARN ERROR
# Default: DEBUG
-o, [--cors=CORS] # Support browser security in tests by responding to OPTIONS requests and adding CORS headers to mocked responses
[--ssl], [--no-ssl], [--skip-ssl] # Use a self-signed SSL cert to run the service over HTTPS
# Default: false
[--sslcert=SSLCERT] # Specify the path to the SSL cert to use when running the service over HTTPS
[--sslkey=SSLKEY] # Specify the path to the SSL key to use when running the service over HTTPS
Start a mock service. If the consumer, provider and pact-dir options are provided, the pact will be written automatically on shutdown (INT).
pact-stub-service
```
Usage:
pact-stub-service PACT_URI ...
Options:
-p, [--port=PORT] # Port on which to run the service
-h, [--host=HOST] # Host on which to bind the service
# Default: localhost
-l, [--log=LOG] # File to which to log output
-n, [--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 (can also be set using the PACT_BROKER_TOKEN environment variable)
[--log-level=LOG_LEVEL] # Log level. Options are DEBUG INFO WARN ERROR
# Default: DEBUG
-o, [--cors=CORS] # Support browser security in tests by responding to OPTIONS requests and adding CORS headers to mocked responses
[--ssl], [--no-ssl], [--skip-ssl] # Use a self-signed SSL cert to run the service over HTTPS
# Default: false
[--sslcert=SSLCERT] # Specify the path to the SSL cert to use when running the service over HTTPS
[--sslkey=SSLKEY] # Specify the path to the SSL key to use when running the service over HTTPS
Description:
Start a stub service with the given pact file(s) or directories. Pact URIs
may be local file or directory paths, or HTTP. Include any basic auth details
in the URL using the format https://USERNAME:PASSWORD@URI. Where multiple
matching interactions are found, the interactions will be sorted by response
status, and the first one will be returned. This may lead to some
non-deterministic behaviour. If you are having problems with this, please
raise it on the pact-dev google group, and we can discuss some potential
enhancements. Note that only versions 1 and 2 of the pact specification are
currently fully supported. Pacts using the v3 format may be used, however,
any matching features added in v3 will currently be ignored.
`…
pact-foundation/pact-ruby-standaloneGitHub
04/16/2024, 12:15 PMx
):
☑︎ Upgraded to the latest version of the relevant libraries
☑︎ Checked to see if the issue has already been raised
Software versions
• pact-ruby-standalone: eg 2.4.2
• OS: e.g. ubuntu
Expected behaviour
No critical vulnerabilities raised when installing pact standalone. Blocks us from publishing new images internally with pact standalone installations.
Actual behaviour
A critical vulnerability raised for`rdoc v6.5.0`
Fixes in versions 6.3.4.1, 6.4.1.1, 6.5.1.1, 6.6.3.1
See fixes in official ruby docs https://www.ruby-lang.org/en/news/2024/03/21/rce-rdoc-cve-2024-27281/
Steps to reproduce
Installing pact standalone and running it through a security check.
pact-foundation/pact-ruby-standaloneGitHub
04/24/2024, 6:51 PMruby:3.3.1-alpine
, as this image has only 0 known vulnerabilities. To do this, merge this pull request, then verify your application still works as expected.
Some of the most important vulnerabilities in your base image include:
* * *
Note: You are seeing this because you or someone else with access to this repository has authorized Snyk to open fix PRs.
For more information: https://camo.githubusercontent.com/352e9ab8f4f40adcfeaa461ba8f47bf1f7668a3c8888f1b802f5fbc9b77c0b97/68747470733a2f2f6170692e7365676d656e742e696f2f76312f706978656c2f747261636b3f646174613d65794a33636d6c305a55746c65534936496e4a79576d785a634564485932527954485a7362306c596430645563566734576b4652546e4e434f5545774969776959573576626e6c746233567a535751694f694a684d6d5a684d6d457a4f43307a597a67784c54526a5a446b745954426b4d69316c5a5749324d4755334e444134595451694c434a6c646d567564434936496c425349485a705a58646c5a434973496e42796233426c636e52705a584d694f6e736963484a4a5a434936496d45795a6d457959544d344c544e6a4f4445744e474e6b4f5331684d4751794c57566c596a59775a5463304d4468684e434a3966513d3d
🧐 View latest project report
🛠️ Adjust project settings
* * *
Learn how to fix vulnerabilities with free interactive lessons:
🦉 Learn about vulnerability in an interactive lesson of Snyk Learn.
pact-foundation/pact-ruby-standalone
✅ All checks have passed
15/15 successful checksGitHub
04/25/2024, 1:11 AMruby:3.3.1-alpine
, as this image has only 0 known vulnerabilities. To do this, merge this pull request, then verify your application still works as expected.
Some of the most important vulnerabilities in your base image include:
* * *
Note: You are seeing this because you or someone else with access to this repository has authorized Snyk to open fix PRs.
For more information: https://camo.githubusercontent.com/083633f3b52a1982d2839c4ffeff939e4542181577d4f2ffb61469c18f0f7172/68747470733a2f2f6170692e7365676d656e742e696f2f76312f706978656c2f747261636b3f646174613d65794a33636d6c305a55746c65534936496e4a79576d785a634564485932527954485a7362306c596430645563566734576b4652546e4e434f5545774969776959573576626e6c746233567a535751694f694a6a4e44646d4e5756694e7930774d446b304c5451324e446b7459546b304d53316d4e446731596a4a6b4d4745324e544d694c434a6c646d567564434936496c425349485a705a58646c5a434973496e42796233426c636e52705a584d694f6e736963484a4a5a434936496d4d304e3259315a5749334c5441774f5451744e4459304f5331684f5451784c5759304f4456694d6d5177595459314d794a3966513d3d
🧐 View latest project report
🛠️ Adjust project settings
* * *
Learn how to fix vulnerabilities with free interactive lessons:
🦉 Learn about vulnerability in an interactive lesson of Snyk Learn.
pact-foundation/pact-ruby-standalone
✅ All checks have passed
15/15 successful checks