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
[SofaGraphComponent] Fix a typo in the warning emited by the APIVersion component and add missing allowed versions. #2103
[SofaGraphComponent] Fix a typo in the warning emited by the APIVersion component and add missing allowed versions. #2103
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.
I am just concerned about what happens if the provided level is invalid. The rest of my comments are just ultra-minor suggestions.
modules/SofaGraphComponent/src/SofaGraphComponent/APIVersion.cpp
Outdated
Show resolved
Hide resolved
auto allowedVersionStr = std::accumulate(std::next(allowedVersion.begin()), allowedVersion.end(), *(allowedVersion.begin()), [](const std::string & s, const std::string & v) { | ||
return s + ", " + v; | ||
}); | ||
msg_warning() << "The provided level '"<< d_level.getValue() <<"' is not valid. Allowed versions are [" << allowedVersionStr << "]." ; |
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.
What happens next if the version is invalid? Wouldn't it be better to set a default value (e.g. SOFA_VERSION_STR
)?
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.
Nothing will happen. The purpose of this component is not super clear, but if I understood correctly (maybe @hugtalbot or @guparan could correct me if I'm wrong):
- Adding
<APIVersion level="21.06" />
in your scene is simply used to specify to the user that this scene was written using SOFA v21.06.
Hence, the message emitted here warns the user author of the scene that he probably didn't meant v21.06 since this version does not exists yet (the largest API version is 20.12.99).
Now, we could probably talk about this version number thing at the next dev meeting (cc @hugtalbot for the agenda!) . I often see in other projects the master branch having the version number of the next upcoming release. For example, for the next release, it could look like this:
master
branch has version 21.06- Close to the release, a
v21.06
branch is created and an alpha or beta binary release is created from this branch master
branch version is updated to 21.12 (even if 21.06 is not released yet)
Using this, setting <APIVersion level="21.06" />
in scene files of the master branch would make sense.
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.
Now, we could probably talk about this version number thing at the next dev meeting (cc @hugtalbot for the agenda!) . I often see in other projects the master branch having the version number of the next upcoming release. For example, for the next release, it could look like this:
1. `master` branch has version 21.06 2. Close to the release, a `v21.06` branch is created and an alpha or beta binary release is created from this branch 3. `master` branch version is updated to 21.12 (even if 21.06 is not released yet)
Using this, setting
<APIVersion level="21.06" />
in scene files of the master branch would make sense.
You are right, the project version was wrong. I used this opportunity to fix it 👍
modules/SofaGraphComponent/src/SofaGraphComponent/APIVersion.cpp
Outdated
Show resolved
Hide resolved
…ion component and add missing allowed versions.
6a58e9c
to
466d9e7
Compare
Let's get this merged, but I still do not understand the big picture of this component. It is not spread over SOFA and there is no policy about it. |
Using this in your scene:
gave (before this PR):
and now gives (with this PR);
By submitting this pull request, I acknowledge that
I have read, understand, and agree SOFA Developer Certificate of Origin (DCO).
Reviewers will merge this pull-request only if