Skip to main content

Pact Open Source Update โ€” July 2024

ยท 8 min read

๐Ÿ‘‹ Hey all, 2024 is racing ahead โณ, we are now 212 days into the year ๐Ÿ˜ฒ, as I write this July Pact Post. As usual, I'll be keeping you up to date with all the latest happenings across the Pact Ecosystem.

Pact OSS Updatesโ€‹

General Updatesโ€‹

Pact RFC Processโ€‹

As you may be aware, there are multiple places where one can get help or request changes to the Pact ecosystem, either across the whole ecosystem, or for an individual repositories. Canny, our public roadmap, GitHub project boards on individual repositories, Slack to name a few.

Some of Pact's maintainers also work together, and as such conversations, discussions and agreements can be made but not consistently communicated, leaving users, for example who don't frequent Slack, or one of our maintainer sessions, to feel excluded from conversations.

As such we've decided to deprecate our Canny roadmap and have migrated 95% of the issues to GitHub, in our new Roadmap repo, to keep issues close to where the code is.

To try and counter some of the concerns around the decision-making process, we felt a RFC (Request for comments) process would be beneficial to allow for a record of proposed changes and decisions, and provide a central place to users, contributors and maintainers to go.

You can view the first pass at what the RFC process may look like in this proposed PR.

We would love users to participate and help shape the future of Pact you want to see.

Specific language updatesโ€‹

Pact-Referenceโ€‹

Pact FFIโ€‹

Another month, another release for libpact_ffi, this time 0.4.22

It includes some QoL fixes, including correcting pact-plugin shutdown behaviour on Windows, and users being unable to find pacts #67, when using a Pact Broker URL which is hosted on a sub path #420

For a full list, check out the release notes.

info

Pact FFI consists of multiple individual Pact rust crates.

Click on the Upgrade pact_* to x.y.z link in the release notes, to take you to the associated changelog.

Click here a diagrammatic view of the Pact Rust ecosystem, over on our docs site.

Pact Mock Server v2.0 is here \o/โ€‹

We mentioned in April, that Ron was redesigning Pact Mock Server, as the existing mock server implementation was written in 2017-2019, and contained some esoteric TLS code that was more complex to upgrade to Hyper 1.0 than to rewrite it using newer Hyper 1.0 constructs.

Upgrading to Hyper 1.0 also brought us the following benefits:

  • Supports both HTTP 1 and 2 with the same server implementation
  • Supports protocol upgrades (leading to supporting things like Web Sockets)
  • Middleware support
  • No more need for the custom TLS code

Check out the release log to find out what went into the rewrite, and watch out for the updated mock server making it's way through the Pact ecosystem shortly.

Pact-Reference - Slackโ€‹

Chat with us in: #pact-rust.

Pact-Pluginsโ€‹

It's been nearly 2 years since we introduce the Pact Plugin framework to the world.

We've seen 2 plugins created by Pact maintainers (pact-protobuf-plugin, pact-csv-plugin), 2 created by non-maintainers (pact-avro-plugin, in-house json-rpc plugin) and provided a course to guide you on how to build your own plugin (pact-matt-plugin).

We know there are some rough edges, and we have been mulling over what the future of Pact-Plugins could look like. We want to start gathering feedback from users, maintainers and plugin authors, even if you tried it out and got stuck. We will see an RFC (request for comments) ticket being raised in the Roadmap soon and we would like to hold some group sessions to discuss, where participants will get to earn some swag for their time, as well as the satisfaction of being able to shape Pact Plugins destiny, whatever that may be!

Pact-Plugins - Slackโ€‹

Have you tried out Pact Plugins yet? What's stopping you?

Chat with us in: #pact-plugins.

Pact-Goโ€‹

Pact-Go v2.0.6 has been released which updates libpact_ffi to 0.4.21, go deps, and you'll find an updated Dockerfile which is tested in CI, along with newly added MacOS CI runners (both x86_64 & arm64). Windows CI will be added soon, the pact-plugin shutdown fix came out of issues in executing plugins in this PR. Oh and you might have found that if you are using plugins in pact-go, that they aren't shutting down cleanly, fixed that for you.

I've also been trying to track down a pesky intermittent bug on MacOS/Linux systems whilst using plugins. Some workarounds were applied directly to pact-go in the above release, however I believe the proper solution is in the pact-plugin driver. I've added a pull request which I hope to get merged soon, and pulled in pact-go.

Pact-Go - Slackโ€‹

Chat with us in: #pact-go.

Pact-JSโ€‹

Pact-JS-Core v15.1.1 has been released which updates libpact_ffi to 0.4.21.

Pact-JS v13.1.1 has been released which fixes #1229 - MatchersV3.reify doesn't extract payload from MatchersV3.nullValue()

Pact-JS-CLI is doing well, we are seeing lots of users switching over going by the ~23.5k downloads since we released it last month. I've put in a PR for review, which aims to leverage npm's optional dependencies, to support packaging and releasing of os/arch specific npm packages, which are consumed in the main project. This has the benefits of ensuring that only the required binaries for the platform you are running on, are downloaded.

Pact-JS - Slackโ€‹

Chat with us in: #pact-js.

Pact-Pythonโ€‹

Val Kolovos has continued adding features for pact-python.

Check out the PR here: Feat/async message provider and keep a lookout on the pact-python blog for a dedicated post soon

Thanks Val ๐Ÿ’›!

If you want to get involved, don't forget, we have a Pact Compatibility suite which is a set of BDD style tests to check compatibility between Pact implementations. There are full implementations in JVM, and Rust, with Tien over in Pact-PHP using it to guide and validate his Pact Rust core based implementation of Pact-PHP.

Pact-Python - Slackโ€‹

Chat to us in: #pact-python.

Pact-PHPโ€‹

Tien has been enjoying the summer, and a well deserved break after the epic work bringing the pact rust core to pact-php, so put down that ๐Ÿธ and give it a try!

Anyone can start testing pact-php with pact_ffi code by updating their composer.json

"pact-foundation/pact-php": "10.0.0-beta2"

This brings a raft of features to the Pact-PHP ecosystem including V4 Pact Specification support, access to the Pact Plugin ecosystem and huge speed benefits over the 9.x Ruby based release.

You can see a full range of examples here

Pact-PHP - Slackโ€‹

Chat to us in: #pact-php.

Pact-Netโ€‹

Want to see Pact Plugin support in .NET?

There is an open RFC where you can add your input, and possibly contribute to bringing the capabilities to pact-net.

To help nudge this along, I've created a suite of .NET examples exercising many of the known pact plugins in the ecosystem, along with the raw pact_ffi calls required to utilise them.

You can check it out here - https://github.com/YOU54F/pact-dotnet-ffi-plugins

In order to get this into Pact-Net, one would need to propose some API designs in the RFC, and then can leverage the examples I've created (probably adding your own .NET developer flair to them), to leverage Pact-Nets idiomatic API design, and use plugins in their current V1 form.

We appreciate there are some rough edges, and will be opening the floor to a discussions around the existing framework to ascertain where improvements need to be made or if a V2 design is warranted and what that may look like.

However we shouldn't let the future dictate what we can achieve now, so forth and plug pact-net into the pact-plugin ecosystem!

Pact-Net - Slackโ€‹

Chat with us in: #pact-net.

Community Eventsโ€‹

Are you talking about Pact or contract-testing this year at an event? Why not let us know and get yourself featured!

Holistic Testing with Microservices - Lewis Prescottโ€‹

Agile testing evangelists Lisa Crispin & Janet Gregory had Lewis Prescott on talk about how to use holistic testing with microservices and contract testing. Don't miss it over on YouTube here

Thats a wrapโ€‹

Want to carry on the conversation? Sign up here to join our Slack community, where you will be amongst over 5.7K other users. It's a safe place to ask questions, and a great place to share the awesome work you are doing in the Pact ecosystem.

Whatever you are up to, let us know, and we can look to get you featured in the Pact post.

See you next month folks!

Cheers, Saf