Summary
The policy upload path populates rpc_allow_google_protobuf_empty_responses from the requests getter, so the uploaded policy silently differs from the local buf.policy.yaml whenever the two values differ. Allowing google.protobuf.Empty responses (but not requests) is a common lint exception for Delete-style RPCs, so the mismatched case is realistic.
Reproduction
# buf.policy.yaml
version: v2
lint:
use: [STANDARD]
rpc_allow_google_protobuf_empty_responses: true # requests left unset (false)
Uploading this policy sends RpcAllowGoogleProtobufEmptyResponses: false (the value of requests). Conversely, setting only ..._requests: true silently enables responses server-side. Lint results then differ between local runs and the BSR-stored policy.
Root cause
private/bufpkg/bufpolicy/bufpolicyapi/uploader.go:181-182:
RpcAllowGoogleProtobufEmptyRequests: lintConfig.RPCAllowGoogleProtobufEmptyRequests(),
RpcAllowGoogleProtobufEmptyResponses: lintConfig.RPCAllowGoogleProtobufEmptyRequests(), // <- should be ...Responses()
PolicyConfigToV1Beta1Proto (convert.go:111) populates the same proto field correctly, so upload and conversion disagree with each other.
Expected
The uploaded config equals the parsed local config.
(Verified by source inspection; the upload itself requires a BSR and was not run end-to-end.)
Found via a full mutest (mutation-testing) run over this repo; verified manually.
Summary
The policy upload path populates
rpc_allow_google_protobuf_empty_responsesfrom the requests getter, so the uploaded policy silently differs from the localbuf.policy.yamlwhenever the two values differ. Allowinggoogle.protobuf.Emptyresponses (but not requests) is a common lint exception for Delete-style RPCs, so the mismatched case is realistic.Reproduction
Uploading this policy sends
RpcAllowGoogleProtobufEmptyResponses: false(the value of requests). Conversely, setting only..._requests: truesilently enables responses server-side. Lint results then differ between local runs and the BSR-stored policy.Root cause
private/bufpkg/bufpolicy/bufpolicyapi/uploader.go:181-182:PolicyConfigToV1Beta1Proto(convert.go:111) populates the same proto field correctly, so upload and conversion disagree with each other.Expected
The uploaded config equals the parsed local config.
(Verified by source inspection; the upload itself requires a BSR and was not run end-to-end.)
Found via a full mutest (mutation-testing) run over this repo; verified manually.