Skip to content

Make Regenerated JSON Output Deterministic#1734

Merged
jschaul merged 5 commits intodevelopfrom
mdimjasevic/golden-diffs
Sep 6, 2021
Merged

Make Regenerated JSON Output Deterministic#1734
jschaul merged 5 commits intodevelopfrom
mdimjasevic/golden-diffs

Conversation

@mdimjasevic
Copy link
Contributor

@mdimjasevic mdimjasevic commented Sep 3, 2021

This PR ensures deterministic ordering of JSON keys in generated JSON files. No difference should occur if a JSON file is regenerated.

The only Haskell change in the PR is in the Test.Wire.API.Golden.Runner module in the function testObject.

Checklist

  • The PR Title explains the impact of the change.
  • The PR description provides context as to why the change should occur and what the code contributes to that effect. This could also be a link to a JIRA ticket or a Github issue, if there is one.
  • If end-points have been added or changed: the endpoint / config-flag checklist (see Wire-employee only backend wiki page) has been followed.
  • If a schema migration has been added, I ran make git-add-cassandra-schema to update the cassandra schema documentation.
  • Section Unreleased of CHANGELOG-draft.md contains the following bits of information:
    • A line with the title and number of the PR in one or more suitable sub-sections.
    • If /a: measures to be taken by instance operators.
    • If /a: list of cassandra migrations.
    • If public end-points have been changed or added: does nginz need upgrade?
    • If internal end-points have been added or changed: which services have to be deployed in a specific order?

@mdimjasevic mdimjasevic changed the title Avoid Differences in JSON Golden Files When Regenerating Them Make Regenerated JSON Output Deterministic Sep 3, 2021
@mdimjasevic
Copy link
Contributor Author

@pcapriotti and me worked on this together.

@jschaul jschaul merged commit 46a9b29 into develop Sep 6, 2021
@jschaul jschaul deleted the mdimjasevic/golden-diffs branch September 6, 2021 23:39
@akshaymankar akshaymankar mentioned this pull request Sep 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants