Skip to main content

Pact Open Source Update β€” May 2023

Β· 9 min read

It's May, the sunshine β˜€οΈ is upon us, and you might be reading this in the park 🏞️. If you are, watch out, theres a cyclist 🚴coming. πŸ›ŽοΈ πŸ›ŽοΈ

Phew, that was close. Right, well now we are sorted, we've got some goodies lined up for this month, as the city of open-source never sleeps.

OSS Updates​

Pact-Net​

Repo Slack

V4 of Pact-Net is about to support V4 of the Pact-Specification.

The OCD gods have been appeased. You can all rest easy now, thanks to Adam Rodger.

Pact-PHP​

  • pact-php ffi-dev branch
    • Tien Vo has been working hard on ffi support in pact-php and we are grateful to have had a couple more reviewers join the party. We've wanted to make it easier to consume, for beta testing, in order to get feedback from users, who may be more familiar in their own codebase, than pact-php's. You can read more details about it in this PR on how you can get involved.

Pact-Python​

  • pact-python has put out a deprecation notice, noting that CI testing will soon be switched off for Python 3.6.
    • You can check the Python EOL dates and get prepared. 3.7 will be dropping support shortly, so you might as well take the time to jump up to 3.11 whilst you are there.

Pact-JS​

  • pact-js & pact-js-core have put out deprecation notices, noting that CI testing will soon be switched off for Node 14.
    • You can check the Node EOL dates and get prepared. 16 will be dropping support shortly, so you might as well take the time to jump up to 18 which is the latest LTS but also check that you are compatible with 20, the upcoming LTS
  • pact-js-core will soon come will batteries included - PR
    • All supported platform/arch combo's for libpact_ffi will come pre-packaged in pact-js-core and pact-js, this means users will be able to
    • npm install @pact-foundation/pact --ignore-scripts
    • Not require a full developer tool-chain included Python to run node-gyp in order to generate the required node bindings. We'll do the grunt work, so you don't have to.

Pact-Broker​

pulls stars

As the Pact-Broker nears its birthday, it decided that it better get ready. You'll now find the latest pact_broker and pact_broker-docker projects have been upgrades to support Ruby 3.2, and pact_broker-docker now comes in the following flavours via this PR.

size: amd64 size: arm64 size: arm

New Tagging Format​

On 3 May 2023, the format of the docker tag changed from starting with the Pact Broker gem version (2.107.0.1), to ending with the Pact Broker gem version (2.107.1-pactbroker2.107.1). Read about the new versioning scheme here.

Docker Multi-Arch Info​

You'll be able to pull multi-arch builds for arm/arm64 machines soon, by adding the -multi flag to your pact_broker tag.

By default, vanilla tags, are built only for amd64

docker run --platform=linux/amd64 --rm -it --entrypoint /bin/sh pactfoundation/pact-broker:latest -c 'uname -sm'

returns

Linux x86_64

We need some binfmt emulators, to run multi-arch. - Thanks to tonistiigi for his project.

Note: You only need the binfmt emulators, if you plan on running a non-native image. Unless you are testing, you wouldn't normally want to do this :)

docker run --privileged --rm tonistiigi/binfmt --install all

We can now run multi-arch images

docker run --platform=linux/arm64 --rm -it --entrypoint /bin/sh pactfoundation/pact-broker:latest-multi -c 'uname -sm'
docker run --platform=linux/amd64 --rm -it --entrypoint /bin/sh pactfoundation/pact-broker:latest-multi -c 'uname -sm'
docker run --platform=linux/arm/v7 --rm -it --entrypoint /bin/sh pactfoundation/pact-broker:latest-multi -c 'uname -sm'

returns

Linux aarch64
Linux x86_64
Linux armv7l

Armageddon - Go Forth and multi-manifest​

info

Why not drop into your favourite repo, and see if you can help them build multi-platform images, it's simpler than you might think.

Prepare your docker builder

docker buildx create --platform linux/arm64,linux/arm/v8,linux/amd64 --name multi_arch_builder
docker buildx use multi_arch_builder

Building your own multi-arch images

Note: (this will push the multi-manifest image to Dockerhub), remove push=true if you don't want to.

  • Replace DOCKER_IMAGE_ORG_AND_NAME & TAG with your required values
docker buildx build --platform=linux/amd64,linux/arm64,linux/arm \
--output=type=image,push=true \
-t ${DOCKER_IMAGE_ORG_AND_NAME}:${TAG} .

Pact-Ruby-Cli​

pulls stars

Not to be outshone, by the Pact Broker Docker, Pact Ruby Cli now comes in the following flavours

size: amd64 size: arm64 size: arm

New Tagging Format​

On 23rd May 2023, introduced in this PR , the format of the docker tag changed from ending with the Pact Cli Gem version (0.51.0.4), where .4 noted a change to the one of the packaged gems, to ending with the Pact Cli gem version (0.52.0-pactcli0.52.0). Read about the new versioning scheme here.

Alpine 3.18 & Ruby 3.2.2​

Alpine 3.18 is out, and Pact-Ruby-Cli is now up to date

Pact-Ruby-Standalone​

pact-ruby-standalone 2.0.1 is out!

but most importantly, the latest Ruby runtime, and native arm64 architecture.

Supported Platforms​

Ruby is not required on the host platform, Ruby 3.2.2 is provided in the distributable.

OSRubyArchitectureSupported
MacOS3.2.2x86_64βœ…
MacOS3.2.2aarch64 (arm64)βœ…
Linux3.2.2x86_64βœ…
Linux3.2.2aarch64 (arm64)βœ…
Windows3.2.2x86_64βœ…
Windows3.2.2x86βœ…
Windows3.2.2aarch64 (arm64)🚧

🚧 - Tested under emulation mode x86 / x86_64 in Windows on ARM

You'll see the roll out of improved CLI documentation on our main site, more distribution methods and a slicker experience overall soon.

Pact FFI​

Pact Plugins​

Pact Erlang​

Oh yeah, you heard that right!

With thanks to community contributor Priyaranjan Mudliar, Pact-Erlang is alive.

It describes itself as

An OTP library for contract testing using pact and generating consumer pacts

and is proudly using the new Pact Rust core, via the FFI. We've been pleased to help guide Priyaranjan along the journey, its a first pass and doesn't contain a full feature-set. Be sure to drop him a ⭐ on his repo to show your support, and even better, if your an Erlang user, why not give it a go.

Check out the repo here https://github.com/silverblaze404/pact-erlang

Pact Broker Client​

Cucumber community contributor David Goss paid us a visit and dropped a fix in whilst he was there.

If you are like Homer and often leave a trailing slash on your PACT_BROKER_BASE_URL or --broker-base-url values, consider yourself sorted.

You may notice some improved next steps when publishing provider contracts, and highlighted URL's, hopefully indicating to the user, useful next steps.

We hope this helps, please try it out and let us know!

Pact Ecosystems​

I've been introducing a fellow Dev Rel colleague to the history of Pact and vastness of the estate. We've been working through a few things, so we thought it would be awesome to share some of the outcomes so far.

Aim​

  • Identify all Ruby codebases which need updating to Ruby 3.1 or higher
  • Identify all consumers of ruby codebases
  • Document "Rube Goldberg" machine for
    • Pact Ruby Reference Core as referenced here in the dependency graph of doom
    • Pact Rust Reference Core
  • Update to at least, Ruby 3.1, preferably Ruby 3.2 across all affected repos
  • Update all affected repos
  • Test all affected repos

Why?​

  • Users of our pact-ruby-standalone project, have been stuck on a packaged Ruby 2.4 run-time due to the build system traveling-ruby, being out-of-maintainence. It has been revived by your very own Devo Avo, into the 21st century with
    • Update to Ruby 3.1.2 & 3.2.2
    • Support for Arm64 Darwin
    • Support for Aarch64 Linux
    • Support for x86 and x64 windows

Rube Goldberg​

Beth often refers to the Ruby Goldberg machine, in a nod to Rube Goldberg.

image

Wondered what it looks like?

You can see our newly published Pact Ecosystem page here

Pacticipate in our Ecosystem​

Sorry Beth!

Did you know, we've used many CI systems here at Pact, now using GitHub Actions extensively, after migrating from Travis CI when they stopped being so friendly towards open-sourcerers. That has been great for x86_64 / Intel Architectures, but we've had a missing link, namely Arm64/Aarch64 architecture, for those of use with shiny new Macs, or perhaps using some cheaper cloud hardware like AWS Graviton's or Oracle clouds free tier offering.

We've documented some details about our CI systems in a new contributing page, on our docs site, you can check them out here

did you know?

You can drop into any repository with a .github/workflows/*.yml or .cirrus.yml file and run the CI systems workflows ephemerally on your own machine.

πŸ±β€πŸ’» Local Machine - GitHub Actions​

  1. Download Act
  2. Download Docker (or Podman)

Linux workflows​

act --container-architecture linux/amd64

πŸ±β€πŸ’» Local Machine - Cirrus CLI​

  1. Download Cirrus CLI
  2. Download Docker (or Podman)
  3. If on an arm64 mac, download tart.run

Linux or MacOS workflows​

cirrus run --output github-actions

Community Corner - Adam Cox​

Adam Cox

If you've been around our GitHub repos or Slack, over the last couple of months, you can be sure to have seen Adam Cox's name pop up.

Well this month, we have an absolute treat. We have the pleasure of opening a new community corner section on our site, dedicated to your voice.

We are equally as honoured to help the community put a name to the face, as we speak to Adam Cox about his journey at Sky, from introducing Pact to the team, to adventures with embedded devices, websockets, and how the Pact Plugin framework is helping them push the envelope.

Be sure to check it our here

Thats a wrap​

That’s it for this month. Stay safe and carry on coding!

  • Yousaf Nabi β€” Developer Advocate at PactFlow and Community Shepherd at Pact.