-
Notifications
You must be signed in to change notification settings - Fork 10
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
Support yaml scenarios #275
Conversation
I don't think it's a question about JSON or YAML, but more a question of prioritisation of time. Spending a few hours is of course no problem, but you still need to fix the cse-server-go to not break the demo application. |
How is cse-server-go related to this (have not looked)? Replacing the current JSON scenarios can be done in seconds. But I'm not saying this should be merged prior to the next release, although it would be beneficial to users. |
That last commit should probably be "fixed" upstream first. But at least this PR shows how easy it is to switch to YAML. What I really want is a discussion on if this is something we want or not. IMO JSON is not suited for this kind of use. |
I guess the issue is mainly parsing. Both cse-server-go and cse-client currently assumes JSON as the format, so there's a good chunk of code to rehash if we now change it to YAML. The easiest approach is probably to parse the YAML back into JSON on the server, but that's not very fit for purpose either. That would assume such a parser already exists. |
I have a hard time understanding why cse-client and cse-server would have to know anything about the scenario language except for the the file ending. But I will have a quick look myself. |
The view code for example goes straight off the incoming JSON data and turns that into a live table of ongoing scenario events. There are some implementation details there that would not be immediately compatible with a different format and therefore have to be rewritten. It's not particularly difficult to do, it would just take time that could be spent elsewhere right now. |
Since YAML is a superset of JSON, you can actually feed the original JSON into this parser and it will still work. So users can actually decide if they want to write JSON or YAML. This PR supports both. But as @restenb points out, it boils down to spending time on the server/client. But we are in no hurry. Edit 1: Edit 2: |
69ac80d
to
3559b05
Compare
…' into feature/271-yaml-scenario-parser
# Conflicts: # src/cpp/scenario_parser.cpp # test/data/scenarios/scenario1.json
This PR has to receive a YAY or NAY tomorrow or it can just be closed. |
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.
This looks good!
The only comment I have is that it should be tested with JSON as well as YAML input. If I remember last Friday's meeting correctly, we decided that we'd keep JSON support and continue to use JSON in the client for the time being. Hence, we should also test that it works.
That can be fixed! |
Since I converted Edit: Well, hard and hard.. managable |
@hplatou Can you confirm that it is a Jenkins/conan issue for the build failing on Windows w/o FMU-proxy and not something related to the changes in this PR? |
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 good to me! Now all we need to do is figure out why the Jenkins build fails.
Wild stab: Could it be because |
What I think is strange is that the build output for the single failed build is full of fmuproxy references, while the build should not include fmuproxy. |
But it is not clear to me if we should include |
I tried installing the |
I've also tried checking out this branch, deleting Looking at the generated |
Co-Authored-By: Kristoffer Eide <[email protected]>
After googling a little bit, it seems the current issues are related to multiple innstallations of yaml-cpp on the Jenskins server. yaml-cpp 0.6.2 from bincrafters and 0.6.3 from conan-center. |
I fixed it! 💪 |
Nice! |
🎂 🍾 🎈 |
This will be a controversial PR I guess. Uses YAML as the language for defining scenarios.
As you may see, the YAML parser API is almost identical to the JSON API. Furthermore it is backwards compatible.
closes #271