Skip to content

Policy upload / proto conversion silently drops disable_builtin #3

Description

@fchimpan

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions