-
Notifications
You must be signed in to change notification settings - Fork 309
Add buf policy YAML file config #3769
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
Conversation
The latest Buf updates on your PR. Results from workflow Buf CI / buf (pull_request).
|
testReadWriteBufPolicyYAMLFileRoundTrip( | ||
t, | ||
// input | ||
`version: v2 |
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.
Curious, this is the first policy file version, why we're starting at v2?
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.
The file will consume v2 lint/breaking config options, so we went with v2 to clarify its related to the v2 spec.
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.
I don't think buf_policy_yaml_file.go
should live under bufpkg/bufconfig
, because it is not a a configuration file for buf
. It is much closer in nature to bufremotepluginconfig
(https://github.com/bufbuild/buf/tree/main/private/bufpkg/bufremoteplugin/bufremotepluginconfig) where it is the configuration of an specific entity. In this case, it is also the content of said entity. So I would move the policy YAML under bufpolicy
as a sub-package, bufpolicyconfig
, and go from there (policy_config.go
and the changes to buf.yaml
would stay in bufconfig
).
} | ||
) | ||
|
||
// BufPolicyYAMLFile represents a buf.policy.yaml file. |
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.
Instead of buf.policy.yaml
, could we say something like:
BufPolicyYAMLFile represents a policy configuration YAML file.
Just because this is meant to be generic.
This adds support for buf policy configuration. A new field in
buf.yaml
files (policies
) takes an array ofPolicyConfig
and a new external file typeBufPolicyYAMLFile
for defining a policy.