Skip to content

Conversation

@emcfarlane
Copy link
Contributor

@emcfarlane emcfarlane commented Jul 23, 2025

This PR adds support to bufcheck.Clients to invoke remote Policies with remote Plugins. Remote Policies are pulled from a registry and stored locally in the buf cache. Remote plugins are supported for both Local and Remote Policies. These are resolved through the policy's plugin providers (see the buf.lock file changes).

Invoking a remote policy will show the PolicyRef, and the PluginRef if a custom plugin, per each lint annotation. For example with a remote policy that enforces a custom plugin:

$ buf lint
local.proto:9:1:Service name "acme.v1.example.LibraryServiceTest" has banned suffix "Test". (buf.build/acme/buf-plugin-suffix, buf.build/acme/buf-policy-suffix:v1)

Policies that invoke just a built-in rule do not have a plugin reference (buf.build/acme/buf-policy-suffix:v1)

@emcfarlane emcfarlane requested a review from doriable July 23, 2025 14:21
@github-actions
Copy link
Contributor

github-actions bot commented Jul 23, 2025

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

BuildFormatLintBreakingUpdated (UTC)
✅ passed✅ passed✅ passed✅ passedJul 23, 2025, 2:41 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 looks good, a quick follow-up comment (can be done here or in a subsequent PR): would be nice to have a couple of integration tests in buf_test.go that runs against a policy, and we can check things like the input being a subdir of a workspace, etc. But I think that the lint and breaking tests on the file annotations are good for this PR.

@emcfarlane emcfarlane merged commit fff3712 into main Jul 29, 2025
10 checks passed
@emcfarlane emcfarlane deleted the ed/bufPolicyRemote branch July 29, 2025 15:15
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