Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Use auto-installing plugins feature #330

Merged

Conversation

tienvx
Copy link
Contributor

@tienvx tienvx commented Jul 29, 2023

No need to set PACT_PLUGIN_DIR to custom plugins directory for verifier. Plugins are auto installed to ~/.pact/plugins

@YOU54F
Copy link
Member

YOU54F commented Aug 1, 2023

hmmm, i wonder if we should have the ability to set the pact plug-in dir and for the user to disable auto downloading of plugins in case they feel it's a security concern.

i know there was issues before with the ruby standalone where it would attempt to download for each test but was resolved by your download at install time changes

@mefellows
Copy link
Member

hmmm, i wonder if we should have the ability to set the pact plug-in dir and for the user to disable auto downloading of plugins in case they feel it's a security concern.

If you use the pact plugin CLI to install the plugins (either during the build or baked into the runtime image), you can control where the plugin comes from in a safe manner (or even bypass the CLI altogether). I don't think it supports a custom directory though.

i know there was issues before with the ruby standalone where it would attempt to download for each test but was resolved by your download at install time changes

If the plugin is already present on the machine, then the runtime won't try and install dynamically. Exposing that to client languages makes sense though.

@YOU54F
Copy link
Member

YOU54F commented Aug 1, 2023

Danke,I think some of thought pattern for why this might be an issue, for pact-php users is due to this issue

Install the pact binaries from composer instead of within the code #276

If the plugin is already present on the machine, then the runtime won't try and install dynamically. Exposing that to client languages makes sense though.

I need to check that out in pact-php, I believe that will be the case.

If you use the pact plugin CLI to install the plugins (either during the build or baked into the runtime image), you can control where the plugin comes from in a safe manner (or even bypass the CLI altogether). I don't think it supports a custom directory though.

Ahhh as in the pact-plugin-cli doesn't support an option to unpack to a different dir.

Just as an aside, we did get asked a q on how to get plugins in CI (for pact-js) via Slack

Appreciate all the help in getting started. I've got a flow working with our solution!
It's manual at the moment though and I'd like to hook it up to the CI and the broker. I mostly know what I'm doing here as I've done it before but one part I'm unsure on is the plugin itself. For local dev I installed through the cli, but what's the best to do this for a CI solution using github actions?

You can use a bash script for now.

The pact-ruby-standalone also comes with the pact-plugin-cli now installed. (note to myself:- I need to update the docs to reflect this)

@YOU54F YOU54F self-requested a review August 1, 2023 14:12
@YOU54F YOU54F merged commit 3b559ed into pact-foundation:ffi Aug 1, 2023
26 checks passed
@tienvx tienvx deleted the use-auto-installing-plugins-feature branch August 1, 2023 15:05
@tienvx
Copy link
Contributor Author

tienvx commented Aug 2, 2023

  • If I install plugins outside of ~/.pact/plugins and run PACT_PLUGIN_DIR=/path/to/plugins composer test, test cases pass and ~/.pact/plugins are still empty
  • Then I run composer test only, test cases still pass, and ~/.pact/plugins contains downloaded plugins

So I confirm it has ability to disable auto downloading plugins feature.

Tested on:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants