Summary
--config <file>.yaml loads the override file but computes the stored file name from the wrong variable, so the name becomes "." and decode errors read decode .: instead of naming the user's file.
Reproduction
printf 'version: v2\nbadkey: {{{' > custom.yaml
buf build --config custom.yaml
# Failure: decode .: invalid character 'v' looking for beginning of value
# ^^^^^^^^ should be "decode custom.yaml:"
(Verified against a local build — the output above is real.)
Root cause
private/bufpkg/bufconfig/buf_yaml_file.go:191-197 (GetBufYAMLFileForOverride):
var fileName string
...
case ".json", ".yaml", ".yml":
data, err = os.ReadFile(override)
...
fileName = filepath.Base(fileName) // self-assignment; fileName is still ""
Should be fileName = filepath.Base(override). filepath.Base("") returns ".", which then becomes the ObjectData name used in error messages.
Found via a full mutest (mutation-testing) run over this repo; verified manually.
Summary
--config <file>.yamlloads the override file but computes the stored file name from the wrong variable, so the name becomes"."and decode errors readdecode .:instead of naming the user's file.Reproduction
(Verified against a local build — the output above is real.)
Root cause
private/bufpkg/bufconfig/buf_yaml_file.go:191-197(GetBufYAMLFileForOverride):Should be
fileName = filepath.Base(override).filepath.Base("")returns".", which then becomes the ObjectData name used in error messages.Found via a full mutest (mutation-testing) run over this repo; verified manually.