kiota-lock.json changes depending on OS
Depending on the operating system on which Kiota is run, the direction of slashes changes in kiota-lock.json. In mixed teams, this results in constant pending changes to this file.
On Windows:
"descriptionLocation": "..\\..\\JsonApiDotNetCoreExample\\GeneratedSwagger\\JsonApiDotNetCoreExample.json",
On Ubuntu:
"descriptionLocation": "../../JsonApiDotNetCoreExample/GeneratedSwagger/JsonApiDotNetCoreExample.json",
Our case is worse, because it breaks the build. We run a tool in cibuild that verifies code style on different platforms, and it never succeeds because of this. Where success is defined as: build the code, run an automated reformat, then fail the build if this resulted in uncommitted git changes.
Hi @bkoelman, Thanks for reporting this. The normalization of the path before it gets written down happens here. https://github.com/microsoft/kiota/blob/0495a000e60e69ba45c69ae7d72c75e14a86285c/src/Kiota.Builder/Lock/LockManagementService.cs#L78
And you can add unit tests in this class.
https://github.com/microsoft/kiota/blob/0495a000e60e69ba45c69ae7d72c75e14a86285c/tests/Kiota.Builder.Tests/Lock/LockManagementServiceTests.cs#L39
Do you think you'd be able to send a pull request to correct this issue?
Not anytime soon, I'm pretty occupied with other work at the moment.