Skip to content

buf breaking: FIELD_SAME_ONEOF message contains %sq format typo #6

Description

@fchimpan

Summary

The FIELD_SAME_ONEOF message for a field moved between oneofs contains a %sq format-verb typo, producing malformed output like Field "1" with name "x" on message "M"q moved from oneof "a" to oneof "b". every time the rule fires. Moving a field between oneofs is an ordinary refactor, so this is the most frequently user-visible defect of the batch (cosmetic only — the verdict itself is correct).

Reproduction

// before/m.proto
syntax = "proto3";
package x;
message M {
  oneof a { int32 v = 1; }
  oneof b { int32 w = 2; }
}
// after: move v into oneof b, then:
//   buf breaking after/ --against before/

The annotation text contains "M"q moved from oneof "a" to oneof "b".

Root cause

private/bufpkg/bufcheck/bufcheckserver/internal/bufcheckserverhandle/breaking.go:1739:

`%sq moved from oneof %q to oneof %q.`,

%sq should be %s.


Found via a full mutest (mutation-testing) run over this repo; verified by source inspection.

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