Skip to content

fix: correct no-op sort comparator in rewriteConfiguration#7599

Closed
AaronStackBarnes wants to merge 1 commit into
Shopify:mainfrom
AaronStackBarnes:fix/sort-comparator
Closed

fix: correct no-op sort comparator in rewriteConfiguration#7599
AaronStackBarnes wants to merge 1 commit into
Shopify:mainfrom
AaronStackBarnes:fix/sort-comparator

Conversation

@AaronStackBarnes
Copy link
Copy Markdown

Found this while debugging some deploy diffs - the sort comparator on line 84 compares key with 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.

@AaronStackBarnes AaronStackBarnes requested a review from a team as a code owner May 21, 2026 18:35
Copilot AI review requested due to automatic review settings May 21, 2026 18:35
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.sort comparator 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.

@AaronStackBarnes
Copy link
Copy Markdown
Author

I have signed the CLA!

@AaronStackBarnes AaronStackBarnes deleted the fix/sort-comparator branch May 21, 2026 18:48
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