-
Notifications
You must be signed in to change notification settings - Fork 665
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
Remove All PBF Defaults from Interface #3454
Conversation
…ts are removable in proto3
… enums start at 0
http_request_t( | ||
POST, | ||
"/trace_attributes", | ||
R"({"shape":[{"lat":37.8077440,"lon":-122.4197010},{"lat":37.8077440,"lon":-122.4197560},{"lat":37.8077450,"lon":-122.4198180}],"shape_match":"map_snap","best_paths":0,"costing":"pedestrian","directions_options":{"units":"miles"}})"), | ||
http_request_t( | ||
POST, | ||
"/trace_attributes", | ||
R"({"shape":[{"lat":37.8077440,"lon":-122.4197010},{"lat":37.8077440,"lon":-122.4197560},{"lat":37.8077450,"lon":-122.4198180}],"shape_match":"map_snap","best_paths":5,"costing":"pedestrian","directions_options":{"units":"miles"}})"), |
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.
instead of sending an error about asking for too many alternates in map matching i changed it to do what we do for regular routing which is to cap it. in the end this isnt a breaking change as the user wasnt getting back a usable response in the first place when asking for too few or too many routes.
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.
good as it's more inline with the general philosophy. I still think these implicit request parameter changes should be communicated in the response, e.g. #3099 . some day.. :)
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.
👍
* store drive_on_left instead of right in trip edge so it can default to false * start ipa at 0 so that when we remove the default its stil the default * rename candidate ranking so its default can be false * default the map matching time in code rather than in pbf * handle search filter defaults in code * reorganize the low hanging fruit in options.proto so that some defaults are removable in proto3 * set roundabout_exits in code rather than in proto defaults * remove best_paths in favor of alternates * denoise is defaulted in code * default language in code * filter closures defaults in code * remove all of the trivial defaults. remove tracking boolean. make all enums start at 0 * changelog * forgot a trivial default * missed a config * have python test print out failure log when it fails. fix bad merge of static config
This is another step closer to proto3 for our protos. The main change here is to remove the use of
default
which is not supported in proto3. There were two ways to do this.The first way is to simply remove the default value from the definition. This works if the default is what proto2/3 already default a scalar value to, from the manual:
For some of the values they defaulted to a certain enum value which was not the first enum value so i re-ordered those enums so that the default would be the first one. For some of the values that didnt default to
false
i simply change the name of the field to have the semantically opposite meaning so that a default offalse
would make sense.The second way is to move the defaulting inside of the code. This was required for those defaults which were not trivial like those above.
In addition to these things I did a couple more clean ups. The first one was I got rid of the
do_no_track
option as no one ever used it and we didnt really adhere to it. The second is that i deprecated thebest_paths
option in favor of the more descriptive and already existingalternates
option. this parameter is still supported of course but it is translated intoalternates
at request time. I also made sure that all enums started with the first value at0
which is required by proto3.NOTE: since deprecating
best_paths
i've also updated the config elements that configure the maximum values for that parameter. if you use an existing config the service will fail to start. the good news is you can just rename the config option (and subtract 1) and move on with your life. if you generate your configs before running the service you wont notice an issue.