Sort features.json by name to avoid merge conflicts - #1264
Merged
Conversation
Every feature PR appends to the end of the array, so any two concurrent feature PRs conflict on the same lines. Sorting entries by name means new features are inserted at different positions and merge cleanly. A test enforces the order.
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.
Every feature PR appends to the end of the `features.json` array, so any two concurrent feature PRs (e.g. #1260 and #1262 right now) conflict on the same lines: both turn the previous last entry's `}` into `},` and add lines after it.
This sorts both `data/pc/common/features.json` and `data/bedrock/common/features.json` alphabetically by `name` and adds a test that enforces the order. New features get inserted at their alphabetical position, so PRs only touch the same hunk when their names happen to sort next to each other.
Order is semantically irrelevant: every consumer iterates the array and looks up by name, so no downstream changes. The diff is large but it is a pure reorder — the sorted set of entries is identical to master (verified by comparing the parsed JSON, 164 pc / 16 bedrock entries).