KEMBAR78
Respect the distribution manifest ordering when listing distributions by OneBlue · Pull Request #13561 · microsoft/WSL · GitHub
Skip to content

Conversation

@OneBlue
Copy link
Collaborator

@OneBlue OneBlue commented Oct 3, 2025

Summary of the Pull Request

PR Checklist

  • Closes: Link to issue #xxx
  • Communication: I've discussed this with core contributors already. If work hasn't been agreed, this work might be rejected
  • Tests: Added/updated if needed and all pass
  • Localization: All end user facing strings can be localized
  • Dev docs: Added/updated if needed
  • Documentation updated: If checked, please file a pull request on our docs repo and link it here: #xxx

Detailed Description of the Pull Request / Additional comments

Validation Steps Performed

Copy link
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

Adds preservation of manifest-defined distribution ordering by switching to nlohmann::ordered_json / ordered_map and introducing tests to validate ordering.

  • Replaces std::map with nlohmann::ordered_map and custom from_json to retain insertion order.
  • Updates JSON parsing utilities to allow using ordered_json.
  • Adds tests asserting distribution listing respects manifest order.

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
test/windows/UnitTests.cpp Adds test cases to verify manifest ordering of distributions.
src/windows/common/Distribution.h Changes ModernDistributions to ordered_map and implements custom from_json to preserve order.
src/windows/common/Distribution.cpp Uses ordered_json in manifest parsing.
src/shared/inc/JsonUtils.h Generalizes FromJson to accept a JSON type parameter.
CMakeLists.txt Updates nlohmann/json dependency version.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@OneBlue OneBlue merged commit 9b5659d into master Oct 6, 2025
6 checks passed
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