-
Notifications
You must be signed in to change notification settings - Fork 697
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Replace avoid_* with exclude_* #3093
Replace avoid_* with exclude_* #3093
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The problem with this PR is that it's a breaking API change - folks who are using the existing avoid_
feature will need to change their code in order to update to any build of Valhalla that includes this PR.
What I think this PR should do is add exclude_
that triggers the existing code. Ideally, the avoid_
parameter would trigger proper weighted avoid behaviour, but think we could live with avoid and exclude doing the same thing for the interim until somebody gets around to implementing proper avoid behaviour. After all, avoid is currently actually excluding, and has been for some time.
I do not think this PR can be merged as-is.
Nice you want to take this on @RhnSharma ! I should've left some more notes on the issue, @danpat is right: the important point of the issue was actually to alias It's usually ok to rename things in the config JSON, of course it's also ok to rename the variables. Where it gets tricky:
|
@RhnSharma @nilsnolde yes it is ok to rename the proto objects the protobuffers dont care about the names they just change the name in the generated code, the binary format stays the same so its not a breakign change in protobuf. As @danpat and @nilsnolde pointed out you need to allow the code in src/worker.cc to parse either |
@kevinkreiser Thanks for suggesting the changes. I made the changes, please take a look at it and let me know if you need any changes. |
@kevinkreiser that's sorta what I mean though: if someone wrote code using valhalla's public PBF interface to create avoid locations/polygons, changing the names would break their code right? Not a huge deal but a bigger deal than breaking the config JSON IMHO |
@nilsnolde changing field names in protobuf is considered "binary compatible" - as long as the IDs remained the same and the meaning of the fields is unchanged, then client code generated with old protobuf interfaces will still be able to generate/parse protobuf binary objects successfully without anything breaking. However these changes are not source compatible - clients calling old generated interface functions will not compile against interfaces generated with these new protobuf changes. It is not well defined what Valhalla considers its compatibility interface to be, but it is not unusual to exclude source-level compatibility for these kinds of reasons. |
@danpat ah didn't know that about protobuf, thanks! that's super considerate behaivor :) |
im not sure if we've documented this but this is the general conventions we follow are: major version change: data incompatibilty, changes to the tiles that makes them not work with previous version soft the software We've never maintained source compatibility between any versions of the software as its just impractical and would require way way way too much planning and foresight to be feasible. |
@RhnSharma there hsould be some docs changes, specifically you should rename |
also i was thinking about this a bit more and beginning to wonder if maybe it should stay |
There are use-cases for both strict "exclude" (e.g. hazmat, and you want a Noroute response if constraints can't be met) and soft "avoid" (avoid tolls if possible, but take them if costing says it's the best), so ultimately, I think we want both (and this applies to all features of this nature, including My vote here would be to do what @nilsnolde originally suggested - add |
@danpat i favored the alias too (it was my suggestion) but i just wanted to throw out the question here and talk myself in a circle one more time ;) anyway this pr is looking close, whats missing i believe is the other change to the costing options proto didnt get reflected in costing where the avoid edges are used. @RhnSharma you probably need to make some renames in the DynamicCost.h/cc |
Makes me think: what do you think about a |
@nilsnolde yeah ive thought about it too. its nice also for those errors in the request that we smooth over without aborting the request too. eg if you set radius on a location above the max allowed we clip it and continue with the request. it would be good to tell the user we arent perfectly adhering to their request |
@kevinkreiser @nilsnolde I made the changes you suggested. Please take a look at it and let me know if you need any changes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@RhnSharma you're missing a few spots here where you didn't change the name to exclude_*
, e.g. look at the CI logs. Before you push next time, can you pls make sure:
- you can build the project successfully with default cmake options
- you can build
run-gurka_avoids
, e.g.make -C build run-gurka_avoids
When CI is happier (i.e. at least the build step runs through) we can review further.
@RhnSharma are you still planning to finish or should I carry this over the review line? In any case, thanks for the effort already put in! |
I quickly finished this. thanks a lot @RhnSharma , was just tiny stuff left |
btw @danduk82 &@ismailsunni, this should be relevant for you too. |
Thanks @nilsnolde |
Fixes #3092
Hi @nilsnolde, how does this look?
Let me know if this needs any changes.
Thanks