-
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
Profile version #3487
Profile version #3487
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.
Should the version be checked against somewhere? And logged / aborted on mismatch?
@@ -194,6 +194,7 @@ properties.max_speed_for_map_matching = 180/3.6 -- 180kmph -> m/s | |||
properties.use_turn_restrictions = true | |||
properties.continue_straight_at_waypoint = true | |||
properties.left_hand_driving = false | |||
properties.version = 0 |
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.
Hrm should we call it profile_api_version
or something like that? Not sure if version alone is telling for users.
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.
Actually now that you mention it, maybe we should not even put it in ProfileProperties
.
Do you think a global variable like profile_api_version = 0
would be too obscure?
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.
My thinking here is that we actually don't need the profile version information outside of the scripting context.
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.
Hm maybe at the top of the profile, like CMake does it 👍
@TheMarex maybe not related to the PR, how to do testing in future? Should tests be replicated for every profile version (actually bad idea), just maintain the actual profile version (no tests for deprecated profile versions) or some tests added to check only profile functions? |
@oxidase that is a good question. I the most feasible solution would be to only have full tests for the current version, but specific tests for functionality changes between versions. For example in the context of the #2399 PR we should have all our tests run on |
20c60b1
to
81b90f7
Compare
Moved it to a global variable and enforced correct version over a check. |
Currently only `0` is supported (the default).
81b90f7
to
fa43caa
Compare
@TheMarex just a simple test to make codecov green |
@oxidase the test looks good. 👍 you can just push to the branch, that's fine. |
e4c5343
to
7486d9d
Compare
@TheMarex pushed. |
7486d9d
to
5fb93d6
Compare
should version be in the format 1.0.0? |
@emiltin I was think using the same scheme as in the HTTP API, which also uses simple increments. Minor/patch versions are not that useful for single components because you typically only care about breaking changes. |
@@ -306,6 +306,20 @@ void Sol2ScriptingEnvironment::InitContext(LuaScriptingContext &context) | |||
context.has_node_function = node_function.valid(); | |||
context.has_way_function = way_function.valid(); | |||
context.has_segment_function = segment_function.valid(); | |||
auto maybe_version = context.state.get<sol::optional<int>>("api_version"); | |||
if (maybe_version) | |||
{ |
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.
Looks like the formatting is off here ..
Issue
Add explicit versioning to the profiles. Addresses #3384
This is currently unused but could be utilized to activate other API features only when explicitly bumping the version. This will be used to make #2399 backwards compatible.
Tasklist
Requirements / Relations
Requirement for #2399