Yousaf Nabi (pactflow.io)
PACT_PLUGIN_DIR
should be.
2. We allow the user to disable auto installation
a. We allow the user to specify their own path to PACT_PLUGIN_DIR
Thoughts come from
https://github.com/pact-foundation/pact-php/pull/330
I believe the following libraries with self load plugins
• pact-rust
• pact-jvm
• pact-php v10 alpha
Happy to be corrected on the aboveuglyog
Timothy Jones
08/02/2023, 6:12 AMpact.loadPlugin("somePluginPackage")
and the Pact client lib (eg pact-js) would read that package, unbox the plugin, and load it.Timothy Jones
08/02/2023, 6:15 AMMatt (pactflow.io / pact-js / pact-go)
Pact makes a “publish plugin” tool. It makes packages for all of the main pact ecosystems, which just wrap up the plugin into the package (possibly with some wrapper code if the Pact client lib needs it).you could raise this request it at pact.canny.io Tim 😉 It’s a good idea, possibly, but not an easy one to achieve.
Matt (pactflow.io / pact-js / pact-go)
Matt (pactflow.io / pact-js / pact-go)
Timothy Jones
08/07/2023, 7:09 AMMatt (pactflow.io / pact-js / pact-go)
Timothy Jones
08/07/2023, 7:23 AMMatt (pactflow.io / pact-js / pact-go)
Pact makes a “publish plugin” tool. It makes packages for all of the main pact ecosystems, which just wrap up the plugin into the package (possibly with some wrapper code if the Pact client lib needs it).This? If so, I agree that’s a nice experience, I’m just making the point that that’s a non-trivial amount of work, and definitely more than what the CLI has to do. I think your point though is that we may end up going a registry path, which would introduce a different line of complexity?
Matt (pactflow.io / pact-js / pact-go)
Timothy Jones
08/07/2023, 7:30 AMMatt (pactflow.io / pact-js / pact-go)
Timothy Jones
08/07/2023, 7:55 AMTimothy Jones
08/07/2023, 7:55 AMYousaf Nabi (pactflow.io)
$HOME
location ($HOME/.pact/plugins
)
◦ Pact-plugins support reading a non default location by setting PACT_PLUGIN_DIR
• What about libraries which store required things within its own folder
◦ PHP uses a bin folder
On the plugin side, currently I've been interacting with the pact ffi lib through client library wrappers and download the required plugins with a cross platform pact-plugin-cli
tool
I was kinda thinking it would be nice if the pact_ffi could just go and make a request to get the required plugin, so the user doesn't have to know about it, and as a library author, I don't need to package seperate packages, I just the ffi and it takes care of it.
That comes back to the problem of
• plugins being downloaded after the pact library is installed
• plugins being downloaded during a test (how do you know which plugins you need up front)
Maybe that is okay for most users, they would download once and be stored. If you needed to download them prior you could use the pact ffi which functions into the pact-plugin-cli to allow a user to easily allow downloading of required plugins prior to a test, and can store them somewhere accessible to their code.
I had a fleeting thought at the weekend about could the pact rust could be made extensible, so a user could easily build a new matcher or some kinda functionality, and bolt that into the pact core, rather than communicating via the plugin framework over grpc.
Not sure of the best experience here, and its tricky as some places are locked down, most people don't want the element of surprise, some people just want to write a test run it and everything be automagicYousaf Nabi (pactflow.io)
I like the general test that plugins should make Pact simplerI like that test for anything in the Pact world,
Timothy Jones
08/07/2023, 11:18 AMbuild a new matcherYes, this is the design I preferred
Yousaf Nabi (pactflow.io)
Matt (pactflow.io / pact-js / pact-go)
I had a fleeting thought at the weekend about could the pact rust could be made extensible, so a user could easily build a new matcher or some kinda functionality, and bolt that into the pact core, rather than communicating via the plugin framework over grpc.they could do that now, to be fair. The thinking - and really, evidence - is that getting contributions into the core (both Ruby and Rust) has been too much of an ask for people in the past. I have no doubt that if we spent some time thinking about it and making it as easy as possible, that we could increase the number of contributions. Matchers are a good example I think, because they are much narrower in scope. gRPC for example and Avro involve a lot more complexity, and asking someone to write it in rust instead of their preferred language, is a tall order. It also bloats the core a lot - plugins mitigate both of those problems.