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

Add bufplugin.RunnerProvider for remote plugins #3548

Merged
merged 1 commit into from
Dec 18, 2024

Conversation

emcfarlane
Copy link
Contributor

This adds a new bufplugin.RunnerProvider to support remote wasm plugins. The constructor bufcheck.NewRunnerProvider has been renamed to NewLocalRunnerProvider to clarify the runner interacts with the local filesystem when invoking plugins. It now takes a bufplugin.PluginKeyProvider and bufplugin.PluginDataProvider to resolve and load remote plugin references.

This also changes the PluginConfig to fix arguments for different plugin types. The method Path has been split into Name and Args. This is analogous to the naming in the std libraries exec.Command function. Name must not be empty. Args may be nil, but are valid for all plugin types. The name is either the path to the binary, the path to the wasm binary, or the fullname of the plugin in the form remote/owner/name.

Subset of #3524

This adds a new bufplugin.RunnerProvider to support remote wasm plugins.
The constructor `bufcheck.NewRunnerProvider` has been renamed to
`NewLocalRunnerProvider` to clarify the runner interacts with the
local filesystem when invoking plugins. It now takes a
bufplugin.PluginKeyProvider and bufplugin.PluginDataProvider to resolve
and load remote plugin references.

This also changes the PluginConfig to fix arguments for different plugin
types. The method Path has been split into Name and Args. This is
analogous to the naming in the std libraries `exec.Command` function.
Name must not be empty. Args may be nil, but are valid for all plugin
types. The name is either the path to the binary, the path to the wasm
binary, or the fullname of the plugin in the form <remote/owner/name>.
@emcfarlane emcfarlane requested a review from doriable December 16, 2024 17:58
Copy link
Contributor

The latest Buf updates on your PR. Results from workflow Buf CI / buf (pull_request).

BuildFormatLintBreakingUpdated (UTC)
✅ passed✅ passed✅ passed✅ passedDec 16, 2024, 5:58 PM

Copy link
Member

@doriable doriable left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This makes sense to me, and splitting it out to handle the args is helpful!

@emcfarlane emcfarlane requested a review from bufdev December 16, 2024 19:52
@emcfarlane emcfarlane merged commit b4d7836 into main Dec 18, 2024
12 checks passed
@emcfarlane emcfarlane deleted the ed/pluginLocalRunnerRemote branch December 18, 2024 14:18
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.

2 participants