pact-foundation / roadmap

Developer Relations @ Pact - Your map to the Pact landscape for all-comers (maintainers, contributors, users, newbies)
https://pact.io/
MIT License
41 stars 7 forks source link

rfc: configuration and shared files #98

Open JP-Ellis opened 2 months ago

JP-Ellis commented 2 months ago

RFC proposal to try and standardise the way we configure and share files across the Pact ecosystem.

Rendered view can be found here.

Excerpt from the RFC:

Summary

This RFC proposes to establish a standard way to configure and share common files across the Pact ecosystem, including the Pact Broker, PactFlow, and the various Pact implementations.

Motivation

The Pact ecosystem is quite diverse and we would like to ensure that transitioning between different tools is as seamless as possible. Several de-facto standards have emerged, but these have not been formalised. Furthermore, there is no clear way to extend these de-facto standards to new tools or use cases.

This RFC aims to formalise some existing de-facto standards. Furthermore, this RFC proposes new standards with the hope of ensuring a more consistent experience across the Pact ecosystem and into the future.

This RFC is split into three main categories:

  • Environment Variables: Define a standard way to configure Pact implementations using environment variables.
  • Configuration: Define a standard way to store runtime configuration for Pact implementations.
  • Shared Files: Define a standard way to store shared files across the Pact ecosystem.
YOU54F commented 2 months ago

Looks good to me. I assume for most implementors of client languages, this will be handled by the FFI, and other consumers would be the rust and ruby suite of CLI tools?

JP-Ellis commented 2 months ago

Updated the RFC with a few changes:

When updating these, I also identified a gap in the way the TOML configuration ought to handle paths. So I have added a subsection to the configuration section to make this clear.

JP-Ellis commented 3 weeks ago

Plan for accepting RFC

This RFC has been open for a while, and has received little additional feedback for a while, with the general consensus so far being in favour of this change.

I have a partial implementation working privately, which I will spin out into a dedicated Rust crate once this RFC is merged.

I am making some suggestions below, and therefore would like to leave this open for at least another 2-3 weeks to give everyone the opportunity to give more feedback.

Amendment for FFI header/lib path

I would like to take this opportunity to add a standard location for the Pact library (should we use dynamic linking). Some discussion was started in this conversation.

I think this RFC should be amended with the following change:


A new optional section will be added to the config containing two values:

[pact.ffi]
include_path = "..."
lib_path = "..."

These values can also be set through the environment variables

Should they be unset, they should default to:

Support for multiple paths is allowed by using a colon-separated environment variable, or using a list in TOML. If multiple paths are specified, then each path is tried in order.

Suffixes (home, dir, path, etc.)

One last thing while re-reading the RFC that I noticed is that there is little consistency between _path or _home or _dir; or using _file or not.

The only precedent we have at the moment in the Pact ecosystem is the PACT_PLUGIN_DIR environment variable.

Here are my thoughts:

This follows my experience with environment variables from using other tools on Linux/Unix. This change would change the PACT_DATA_HOME environment variable to PACT_DATA_DIR for example.

Please let me know if you think this is something worth adding to the RFC, or whether this is an unnecessary complication.