Summary
disable_builtin in buf.policy.yaml lint/breaking configs is consumed on the proto read side but never set on the write side, so policy upload / proto conversion silently drops it. Disabling built-in rules to standardize on custom plugin rules is one of the main reasons to use policies, so the loss is user-visible: after upload, built-in rules come back.
Reproduction
# buf.policy.yaml
version: v2
lint:
use: [STANDARD]
disable_builtin: true
Upload the policy; the stored PolicyConfig_LintConfig.disable_builtin is unset.
Root cause
Write sides never populate the field:
private/bufpkg/bufpolicy/bufpolicyapi/uploader.go:176-189 — upload content builder sets Use/Except/EnumZeroValueSuffix/... but not DisableBuiltin
PolicyConfigToV1Beta1Proto (convert.go:105-118) — same omission
Read side proves the field is live: convert.go:155 and :166 call GetDisableBuiltin() when converting proto back to config.
Expected
disable_builtin round-trips through upload and proto conversion.
(Verified by source inspection.)
Found via a full mutest (mutation-testing) run over this repo; verified manually.
Summary
disable_builtininbuf.policy.yamllint/breaking configs is consumed on the proto read side but never set on the write side, so policy upload / proto conversion silently drops it. Disabling built-in rules to standardize on custom plugin rules is one of the main reasons to use policies, so the loss is user-visible: after upload, built-in rules come back.Reproduction
Upload the policy; the stored
PolicyConfig_LintConfig.disable_builtinis unset.Root cause
Write sides never populate the field:
private/bufpkg/bufpolicy/bufpolicyapi/uploader.go:176-189— upload content builder sets Use/Except/EnumZeroValueSuffix/... but notDisableBuiltinPolicyConfigToV1Beta1Proto(convert.go:105-118) — same omissionRead side proves the field is live:
convert.go:155and:166callGetDisableBuiltin()when converting proto back to config.Expected
disable_builtinround-trips through upload and proto conversion.(Verified by source inspection.)
Found via a full mutest (mutation-testing) run over this repo; verified manually.