Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure consistent sorting of WarpCore config #5547

Open
ltyu opened this issue Feb 21, 2025 · 1 comment
Open

Ensure consistent sorting of WarpCore config #5547

ltyu opened this issue Feb 21, 2025 · 1 comment
Assignees

Comments

@ltyu
Copy link
Contributor

ltyu commented Feb 21, 2025

Problem

Currently, when we write the WarpCoreConfig to the Registry after warp deploy or warp apply, we are using sortMapEntries: true, which is called via writeDeploymentArtifacts().

This flag will "sort by comparing key values using the native less-than < operator." However, this flag is not predictable and creates inconsistent sorting, which creates large git diffs when we update the WarpCoreConfig (and other configs).

For example, consider this PR that adds Uni and Bera chain to PZETH. In this case, berachain-ethereum-swell-unichain-zircuit-config.yaml is a completely new file instead of a renamed file with additions.

Note

It is understood that github shows diffs in a heuristic and unpredictable manner, especially when there is a rename + large diff. The point of this PR is not to spend too much figuring out how Github show diffs, but to solve the sorting problem such that if we did not rename the file, we'd see the correct diffs.

Solution

  • Configure toYamlString() in the Registry to sort correctly.

Nice to Have

  • Consider all the places where we use sortMapEntries: true and use the same configuration
@nambrot
Copy link
Contributor

nambrot commented Feb 21, 2025

I would also say that we should have prettier/CI checks in the registry that ensures the sorting

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Sprint
Development

No branches or pull requests

3 participants