go.osrm icon indicating copy to clipboard operation
go.osrm copied to clipboard

Adds general options and missing options for table request

Open mkasner opened this issue 5 years ago • 6 comments

mkasner avatar Sep 16 '19 13:09 mkasner

Codecov Report

Merging #13 into master will increase coverage by 0.27%. The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #13      +/-   ##
==========================================
+ Coverage   96.55%   96.82%   +0.27%     
==========================================
  Files           8        8              
  Lines         232      252      +20     
==========================================
+ Hits          224      244      +20     
  Misses          4        4              
  Partials        4        4
Impacted Files Coverage Δ
nearest.go 100% <100%> (ø) :arrow_up:
match.go 100% <100%> (ø) :arrow_up:
types.go 96.55% <100%> (+0.25%) :arrow_up:
route.go 100% <100%> (ø) :arrow_up:
options.go 100% <100%> (ø) :arrow_up:
table.go 100% <100%> (ø) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 788b384...7fc54cc. Read the comment docs.

codecov-io avatar Sep 16 '19 13:09 codecov-io

Updated code with proposed changes

mkasner avatar Sep 17 '19 05:09 mkasner

First of all, great job to make types reusable in different requests. I have a question: how to be with backward compatibility? My code does the following:

req := osrm.MatchRequest{
   Hints: []string{"X","Y"},
}

but new change will break compilation process because I need to change the code:

req := osrm.MatchRequest{
    GeneralOptions: osrm.GeneralOptions{
         Hints: []string{"X","Y"},
    },
}

Yes, this cannot be backward compatible, unless I copy params from the embedded struct GeneralOptions to every request. I thought this was cleaner approach from the standpoint of library, but it is a breaking change in terms of clients using this library. You as a reviewer, must be the judge of that. If you don't want to introduce breaking change, then don't approve this PR, so I can create another one with repeated fields in every request.

mkasner avatar Sep 20 '19 12:09 mkasner

First of all, great job to make types reusable in different requests. I have a question: how to be with backward compatibility? My code does the following:

req := osrm.MatchRequest{
   Hints: []string{"X","Y"},
}

but new change will break compilation process because I need to change the code:

req := osrm.MatchRequest{
    GeneralOptions: osrm.GeneralOptions{
         Hints: []string{"X","Y"},
    },
}

Yes, this cannot be backward compatible, unless I copy params from the embedded struct GeneralOptions to every request. I thought this was cleaner approach from the standpoint of library, but it is a breaking change in terms of clients using this library. You as a reviewer, must be the judge of that. If you don't want to introduce breaking change, then don't approve this PR, so I can create another one with repeated fields in every request.

I like that PR. But I think maintainers must release a major version of it (for example, v0.2.0) with a notice about the backward-incompatible change.

regeda avatar Sep 20 '19 12:09 regeda

that PR. But I think maintainers must release a major version of it (for example, v0.2.0) with a notice about the backward-incompatible change.

I didn't yet added changes you requested, about constants type naming, and function for combining duration and distance

mkasner avatar Sep 20 '19 12:09 mkasner

Sure, I know that. I said, that I used it like iota by mistake. I'm going to push that change now.

mkasner avatar Sep 20 '19 12:09 mkasner