-
Notifications
You must be signed in to change notification settings - Fork 311
Run buf Policies locally #3785
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
Run buf Policies locally #3785
Conversation
The latest Buf updates on your PR. Results from workflow Buf CI / buf (pull_request).
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This mostly makes sense to me, left some comments around the plugin/policy config paths and avoiding passing the read bucket.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is looking good, just left a couple of very basic comments. I think this behaviour is probably the most straightforward based on our discussions.
This PR adds support for running local buf Policies. Lint and breaking checks now invoke the set of policy rules alongside the set of configured rules. Only local policies are currently supported, remote will be added with lock file support. The annotations emitted now include the policy name alongside the plugin (e.g.
<annotation> (buf-plugin-name, buf-policy-name)
). An inbuilt plugin for a policy will include only the policy name.As an example a policy can be expressed for the
buf-plugin-suffix.wasm
plugin in apolicy.yaml
file:Which can then be used in a
buf.yaml
file:And run with
buf lint
showing the output annotations for a simple test proto: