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 support for running remote check plugins #3524

Merged
merged 19 commits into from
Dec 19, 2024
Merged

Conversation

emcfarlane
Copy link
Contributor

@emcfarlane emcfarlane commented Dec 10, 2024

This PR adds support for running remote check plugins in buf lint and buf breaking commands. These plugins are specified as references (<remote/owner/plugin>) in the buf.yaml file and must be pinned to specific versions in the buf.lock file.

To pin plugin versions, users can run buf plugin update command, which updates the buf.lock file with the necessary metadata to resolve the plugin version when run. If a plugin reference in buf.yaml is not pinned in the buf.lock an error is returned prompting the user to pin the plugin version by running buf plugin update. This allows for running checks offline and avoids network access when all plugin data is cached.

Arguments can be provided to both local and remote plugins by specifying any space separated commands after the path or reference (e.g. buf.build/myorg/myplugin --debug). These args are passed as command line arguments on every run.

This PR adds support for invoking of remote Wasm plugins locally. Remote
plugins Refs are resolved using the buf.lock file in the input's v2
workspace.
Copy link
Contributor

github-actions bot commented Dec 10, 2024

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

BuildFormatLintBreakingUpdated (UTC)
✅ passed✅ passed✅ passed✅ passedDec 18, 2024, 7:54 PM

private/buf/bufctl/controller.go Outdated Show resolved Hide resolved
private/buf/bufworkspace/workspace.go Outdated Show resolved Hide resolved
private/buf/bufworkspace/workspace_provider.go Outdated Show resolved Hide resolved
@@ -321,6 +322,7 @@ func testNewWorkspaceProvider(t *testing.T, testModuleDatas ...bufmoduletesting.
bsrProvider,
bsrProvider,
bsrProvider,
bufplugin.NopPluginKeyProvider,
Copy link
Member

Choose a reason for hiding this comment

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

I think we could address this in a follow-up PR, or it might give us a little more confidence here, but we may want to implement something similar to the bufmoduletesting.OmniProvider stubs.

private/bufpkg/bufplugin/plugin_key_provider.go Outdated Show resolved Hide resolved
@emcfarlane emcfarlane marked this pull request as ready for review December 18, 2024 19:56
@emcfarlane emcfarlane merged commit 463dc8e into main Dec 19, 2024
10 checks passed
@emcfarlane emcfarlane deleted the ed/pluginInokeRemote branch December 19, 2024 18:26
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.

3 participants