Six Edits One Wire

A team edits a .proto that is already deployed. Old binaries will keep parsing messages written by new binaries for weeks.

message Order {
  string id       = 1;
  int32  quantity = 2;   // A: becomes  int64 quantity = 2;
  string coupon   = 3;   // B: renamed to  string promo_code = 3;
  string tag      = 7;   // C: becomes  repeated string tags = 7;
  bytes  payload  = 6;   // D: becomes  string payload = 6;
  int32  status   = 5;   // E: moved into an existing oneof
  string region   = 4;   // F: swapped with id, so region = 1 and id = 4
}

Select every edit that is safe on the wire. More than one is.

A

F, swapping the field numbers of two string fields

B

D, bytes to string, given the bytes were always valid UTF-8

C

C, singular string to repeated string on the same field number

D

A, int32 to int64 on the same field number

E

B, renaming coupon to promo_code while keeping field number 3

F

E, moving an existing field into an existing oneof