thriftrw / thriftrw-go

A Thrift encoding code generator and library for Go
MIT License
100 stars 53 forks source link

Add support for changed types in thriftbreak #559

Closed moisesvega closed 1 year ago

moisesvega commented 1 year ago

Changing field types is a breaking change, this could be prevented by raising an error in thriftbreak.

Example:

// some.thrift
struct MyStruct {
    1: optional bool status
}

changed to

// some.thrift
struct MyStruct {
    1: optional string status
}

is a breaking change because status went from being a bool to a string.

CLAassistant commented 1 year ago

CLA assistant check
All committers have signed the CLA.

manjari25 commented 1 year ago

Changing filed types is a breaking change, this could be prevented by raising an error in thriftbreak.

Example:

// original.thrift
struct MyStruct {
    1: optional bool status
}

// updated.thrift
struct MyStruct {
    1: optional string status
    2: optional bool retry
}

This diff add support for changed types in thriftbreak

Suggest including the following example in the description -
Example:

// some.thrift
struct MyStruct {
    1: optional bool status
}

changed to

// some.thrift
struct MyStruct {
    1: optional string status
}

is a breaking change because status went from being a bool to a string.

codecov[bot] commented 1 year ago

Codecov Report

Merging #559 (ee24858) into dev (183888f) will increase coverage by 0.01%. The diff coverage is 100.00%.

@@            Coverage Diff             @@
##              dev     #559      +/-   ##
==========================================
+ Coverage   68.01%   68.03%   +0.01%     
==========================================
  Files         139      139              
  Lines       23735    23746      +11     
==========================================
+ Hits        16144    16155      +11     
  Misses       4536     4536              
  Partials     3055     3055              
Impacted Files Coverage Δ
internal/compare/compare.go 96.66% <100.00%> (+0.74%) :arrow_up:

:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more