Closed shana closed 4 years ago
@saul can you please investigate?
You’re missing a comma after the 13th (0 indexed) element of that array in your JSON file from what I can see.
I’m not sure how to proceed here @AArnott - I remember mentioning how we would handle broken JSON files in my PR but can’t remember what your suggestion was. I’m not on desktop at the moment but will check when I am.
Indeed, this is an unparsable file. But how would a nb.gv update have introduced the build break? It seems any version would have coughed on this.
Yeah I don't know how to proceed, the version.json file that's currently there doesn't have a comma on the array entry and it doesn't complain, the build is running fine.
I fixed the file, there weren't that many commits with it so it didn't screw up the history too much. I'm still confused how it parses fine with the previous version... 😕
Did it actually parse? Or did nb.gv perhaps just discard the file?
I can repro it in a trivially created repo. I'll take a look.
Apparently this is a very bizarre Newtonsoft.Json behavior. We were on v9 both before and after this upgrade. This change is the crux of it. When Newtonsoft.Json deserializes a string[]
it permits the missing comma. But when it deserializes PathFilter[]
it requires a higher level of syntax correctness. I have no idea why. I had no idea that newtonsoft.json was allowing bad syntax before.
We could conceivably 'fix' this, but I'd like to first try enforcing correct syntax.
For folks who hit this and can't rewrite history to fix it, here's the prescriptive solution:
@AArnott Wow ok yeah, I felt like the change from string to PathFilter was triggering this in some way, but that's just crazy. Learning new things about newtonsoft every day... :P
I just updated my repo https://github.com/spoiledcat/UnityTools to 3.1.89 and the build breaks while parsing previous commits to the version.json file:
The version.json file in question is https://github.com/spoiledcat/UnityTools/blob/ba88c9c240bc52c2b425677f8a4a3fea51f01c74/src/version.json
I suspect that the changes in https://github.com/dotnet/Nerdbank.GitVersioning/pull/465 is the culprit, which is a shame, I could really use it :P