fix: correct no-op sort comparator in rewriteConfiguration#7599
Closed
AaronStackBarnes wants to merge 1 commit into
Closed
fix: correct no-op sort comparator in rewriteConfiguration#7599AaronStackBarnes wants to merge 1 commit into
AaronStackBarnes wants to merge 1 commit into
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Fixes deterministic ordering when rewriting the app configuration by correcting the sort comparator used for configuration keys.
Changes:
- Corrected the
Array.prototype.sortcomparator to compare two different keys instead of comparing a key against itself.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
24d71d6 to
7f1b629
Compare
Author
|
I have signed the CLA! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Found this while debugging some deploy diffs - the sort comparator on line 84 compares
keywith itself (key.localeCompare(key)) so it basically does nothing. The output order ends up depending on whatever the engine feels like doing, which can cause unpredicatable diffs in the generated toml.Fixed by actually comparing two different keys so entries sort alphabetically like they should.