Skip to content
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

Version flag for profiles #3384

Closed
TheMarex opened this issue Dec 1, 2016 · 4 comments
Closed

Version flag for profiles #3384

TheMarex opened this issue Dec 1, 2016 · 4 comments

Comments

@TheMarex
Copy link
Member

TheMarex commented Dec 1, 2016

Currently when we want to make changes to the profiles that are not backward compatible we would do a major version bump of osrm-backend.

However that also means that profiles that were not ported properly will fail (maybe even silently) if they are not adjusted to API changes.

To make this explicit and open up the possibility for supporting multiple profile API version we should add a version flag to ProfileProperties so we could load the appropriate version of the scripting context.

@daniel-j-h
Copy link
Member

daniel-j-h commented Dec 1, 2016

Interesting.

For a start can't we simply expose the OSRM version we set in CMake to Lua and also set a required version in the Lua profiles? Then the profiles could check their version against the OSRM version currently running.

This would catch profile mismatches and would even allow the profiles to specify required version bounds. Think of profiles specifying > 5.4 && < 5.5 and the OSRM version bound via Luabind then reporting 5.4.3.

@TheMarex
Copy link
Member Author

TheMarex commented Dec 1, 2016

Hrm you think that will be less error prone then doing another sequential version like we do for the HTTP API? I was thinking about something like:

properties.version = 1 -- (default value for everything below 5.5)

When we load the scripting context we use that version number to load the appropriate bindings. The default value makes sure that at least every current profile in existence will be backward compatible and needs to be upgrade explicitly once we change the profile API.

We could throw a deprecation warning if your profile does not expose the current version, but still support older versions.

@TheMarex TheMarex mentioned this issue Dec 22, 2016
2 tasks
@TheMarex
Copy link
Member Author

For the record we settled on a global api_version = 1 in every profile file.

@daniel-j-h
Copy link
Member

This landed with #3487.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants