temporalio/cli

[Bug] Ensure stability of JSON output across builds

dandavison opened this issue · 1 comments

After some head-scratching regarding inconsistent whitespace in JSON output, @cretz determined that the problem was the deliberate injection of random whitespace here: protocolbuffers/protobuf-go@582ab3d

(The random bool they use is constant within a build but random across builds)

We should ensure our JSON output is stable across builds.

The problem can be repro'd with temporal workflow show -w <wid> --event-details

Note that this is deterministic from build to build, so you have to recompile in differing ways to see the issue. The solution is likely to run any proto JSON result through json.Indent or json.Compact depending on which JSON formatting is desired.