Closed KatieWoe closed 3 years ago
The only content difference between the states is expected: "simVersion": "1.5.0-dev.4",
actual "simVersion": "1.5.0-dev.6",
. I don't recall why we put the simVersion
in the API file, but we wouldn't want to have to update that part every time we bump dev versions. I'll see if we can remove it.
Removed in the commits, and I regenerated the API files. Reassigning to @zepumph for a spot check review when convenient.
Well, https://github.com/phetsims/studio/blob/1c4ebb8386ad66bd8f78d24eed499bca6a4aa62b/js/customizeWrapperTemplateForAction.js#L272-L276 uses the version from simInfo, so I've added it back in. Not sure the best way to proceed, some options:
@zepumph what do you recommend?
In https://github.com/phetsims/gravity-and-orbits/issues/390#issuecomment-867082919 @pixelzoom raised some questions which are pertinent to this issue. @pixelzoom said:
Reopening.
@samreid said:
The reason the version appears in the API file is discussed in #386.
That issue doesn't tell me much. Is "version" the API version or the sim version? It was originally named
simVersion
. But in phet-io/api/natural-selection.json, I see:"version": { "major": 1, "minor": 0 }
... which does not match the sim version at all, so leads me to believe that it's an API version. But GAO had to be updated to match the sim version.
So to help me understand "version" and this problem, I have many questions:
- What are the semantics of "version" in the API file?
- When does "version" need to be updated in the API file?
- How is "version" updated in the API? Manually? Build tools?...
- Why did this problem occur for GAO?
- Why did it occur around the time of publishing the RC?
- Why did you need to manually update version to 1.6.0-dev.0? Should that have been done by build tools?
- If version matches package.json for GAO, why is that not the case for Natural Selection?
Is "version" the API version or the sim version?
The version under discussion in this issue is the sim version. For instance, master has this line for natural selection: "simVersion": "1.4.0-dev.1",
But in phet-io/api/natural-selection.json, I see:
"version": { "major": 1, "minor": 0 }
That refers to the version of the entire API file, and is not under discussion in this issue except for clarification.
What are the semantics of "version" in the API file?
It is the sim version at the time of the API file generation, and is determined by SimInfo.js
When does "version" need to be updated in the API file?
As described in https://github.com/phetsims/gravity-and-orbits/issues/386#issuecomment-859772651, we are trying to see if we can omit this from the API file. For now, I believe we should update it eagerly when the sim version changes in package.json.
How is "version" updated in the API? Manually? Build tools?...
For now it is manual. Let's determine whether we can eliminate it before we add tooling around it.
Why did this problem occur for GAO? Why did it occur around the time of publishing the RC?
Creating the release branch bumped the version number in master from 1.5.0-dev.8 to 1.6.0-dev.0. Since this is in the initial state, which is tracked, CT identified it as a state change that wasn't in the API file.
Why did you need to manually update version to 1.6.0-dev.0? Should that have been done by build tools?
We don't have tooling support for this at the moment, let's confer with @zepumph to see if we actually want this data in the state object or if it should be done another way before adding tooling.
If version matches package.json for GAO, why is that not the case for Natural Selection?
Gravity and Orbits specifies phetioDesigned: true
for the entire simulation (in main), but Natural Selection does not. Perhaps this would be a good time to enable phetioDesigned
tracking for natural selection?
Over in https://github.com/phetsims/gravity-and-orbits/issues/387 it seemed like we suppressed a bunch of information, returning null
when Tandem.API_GENERATION
was true. Can we do that here for simVersion as well?
Great idea, I applied the same strategy and tested that it worked well in studio. @zepumph can you please review? Close this issue is all is well.
It is considered "API_GENERATION" when during build we create the API json file. Is that important to have? Does studio need this? Or is it only important in the state of the living sim?
It is considered "API_GENERATION" when during build we create the API json file. Is that important to have?
The simVersion
should not appear in the built API JSON file--the version should be obtained elsewhere.
Does studio need this? Or is it only important in the state of the living sim?
This seems useful in data streams and https://github.com/phetsims/gravity-and-orbits/issues/386#issuecomment-859772651
I'm happy you feel that way. It sure is easier. Since you are the studio-customization-state expert, I'm glad to have gotten your opinion.
I mentioned it because this looked weird to me at first, and no longer does
Ready to close for me, please reopen if you disagree.