-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
Require a radius parameter when using bearings #6572
base: master
Are you sure you want to change the base?
Require a radius parameter when using bearings #6572
Conversation
Is this for GSoC by any chance? |
Yes, this was intended for GSoC - I apologize if I was to explicitly state that beforehand! |
It’s just easier to keep track of things that way. Anyways, thanks for the contribution. I’m not familiar with the codebase to give it a review, but I’m sure others will soonish. Should we flag this as pre-gsoc so it’s easier to find when the time comes? |
I think that would be a good idea! |
I should note that I did fix the formatting by rerunning the format script - though it did seem to come with some strange looking results due to the increased length. |
As this is for GSoC, would you have time to have a look @SiarheiFedartsou ? |
@nilsnolde sure, it was already in my todo-list, but just was a bit busy last days - will try to do that in the nearest days 👍 |
Hey @whytro
This assert comes from here: osrm-backend/src/nodejs/node_osrm.cpp Line 117 in 82b73ed
So I think we need to at least fix NodeJs tests to respect this new requirement. In perfect scenario I would even add some user-friendly exception in NodeJs bindings for the case of this error(but we can do it in separate PR later). It can be done somewhere here:
Let me please know if something is not clear or you will need a help with it :) |
Ah, that was sloppy of me! I've gone ahead and adjusted the bindings and the tests accordingly. Thank you for the pointers! |
I originally thought that the unit tests were for release builds (hence not asserting on parameter checks - which, in hindsight, is a nonsensical assumption), but now I'm realizing that parameter checking tests are maybe not applicable for unit testing, and are mainly to be covered in the cucumber tests. I'll take a closer look at implementing those tests in the appropriate (cucumber) feature sections, and revert the unit tests change as soon as possible! |
But can we change unit tests in such a way to not cause those asserts? |
I also want to note that this is an API-breaking change - clients that were making requests using just |
Hm, indeed 🤔 For new major version it would be great to also do other "cleanup" tasks like #2879 I will think how can we merge it without breaking changes though, may be go with 2nd option we had in original issue |
Even defaulting I think it's OK to merge this feature as a breaking change, but I do think it's worth considering the implications - it does require a major version bump, and if this is the only feature to trigger that, then it seems a bit silly. Perhaps merging this unblocks a period of other major breaking changes and starts the train rolling towards a reasonably significant major release. |
It is what I am also thinking about 🤔 But the problem is that there are actually almost no people actively working on this project, so not sure we really want it... |
Hmm, I'm not sure if the assertion is avoidable in this case without significant alteration to the library. It also doesn't seem like similar tests (ie. for param validation checking) exist, and instead seem to focus on the calculation results (please let me know if I'm wrong here). I did also consider that this change would probably be breaking given that it changes behavior significantly for bearings. Should I look to either implement a flag or add in default radius values when bearings are used, so that it can be easily changed should a major release happens - or rather what would be the best approach here? |
I would probably start from flag, I totally agree with Daniel's points above. Sorry, that I didn't notice it in the beginning - it seems to be quite big rework of this PR... Also I still not sure if we want to go ahead with major version update - probably it can be a good idea to start new PR and to leave this PR "as is" as it seems what you did here is better default behaviour than it used to be (the only problem is backward compatibility). |
Okay, I'll look into adding the configurable default |
03fd020
to
09ff160
Compare
Sorry for the force-push, I messed up a rebase and polluted the commit history on the branch, and rolled it back. |
This PR seems to be stale. Is it still relevant? |
Issue
What issue is this PR targeting? If there is no issue that addresses the problem, please open a corresponding issue and link it here.
Tasklist
Requirements / Relations
Link any requirements here. Other pull requests this PR is based on?