pact-foundation / pact-js-core

Core binaries for pact-js, a Contract Testing Framework. NOTE: If you are looking to do Pact contract testing in node, you almost certainly want pact-js, not pact-node.
https://docs.pact.io
MIT License
150 stars 80 forks source link

RFC: Update pact-node branch with latest ruby standalone binaries and support multiple architectures #489

Closed YOU54F closed 6 months ago

YOU54F commented 6 months ago

Previous issues

Problem

Some users are unable to migrate to the latest version of pact-js/pact-js-core which leverages the Rust runtime, due to various reasons.

They are beginning to encounter errors with the standalone package as it is outdated, and predates our work on the traveling-ruby fork to support the latest ruby runtimes and multiple archs.

Steps

Breaking Changes

None

User Actions

None

Potential Downsides/Caveats

Supporting the pact-node branch and pact-js v9.x.x even for an interim release, would probably warrant a dependency update.

We would probably not want to provide tier 1 support for this, but it may help unblock users as an interim measure

Has it previously been tested

Yes, when I created the new traveling-ruby releases, I tested against the pact-node branch in my fork.

https://github.com/YOU54F/pact-js-core/commits/pact-node-arm64/

Released to npm

https://www.npmjs.com/package/@you54f/pact-node?activeTab=code

and consumed in a pact-js-core fork

https://www.npmjs.com/package/@you54f/pact/v/9.20.0?activeTab=code

Other options

Users can provide their own binary docs ref and rename the latest release to match whatever is in pact-node's latest release.

However it is checksum validated. Another potential could be to remove the checks here, such that users can provide their own binaries, and we wouldn't have to do updates of pact-node / pact-js-core v9, if the standalone is updated.

For the example given above, Pact will look for the binary at /home/some-user/Downloads/pact-1.44.0-win32.zip for a Windows system. However, by using this method, you must use the correct Pact version binary associated with this version of Pact-Node. For extra security measurements, checksum validation has been added to prevent tampering with the binaries.

YOU54F commented 6 months ago

@pact-foundation/pact-node was updated to v10.18.0 contain

https://www.npmjs.com/package/@pact-foundation/pact-node/v/10.18.0

It contains the following pull request

https://github.com/pact-foundation/pact-js-core/pull/491

This results in v9.x users of pact-js picking up the changes via a caret filter in the package.json deps for @pact-foundation/pact-node

The benefits include

This is to serve as a stopgap for users for migrating onto pact-js v10 (migration to rust core) and onwards (currently v12.x)

Tested locally with 9.18.1