Add create-solution-filters command for converting multiple solutions#171
Open
psmulovics wants to merge 6 commits intomainfrom
Open
Add create-solution-filters command for converting multiple solutions#171psmulovics wants to merge 6 commits intomainfrom
psmulovics wants to merge 6 commits intomainfrom
Conversation
564b0b9 to
9f456f6
Compare
… to monorepo with filters Implements issue #49 to add a new command that converts multiple .sln files into a single consolidated solution with individual .slnf solution filter files. Command syntax: please create-solution-filters --from <glob-pattern> --target <target-solution> Behavior: - Creates or uses existing target solution - Adds all projects from source solutions under solution folders - Generates .slnf files for each original solution as filters - Deletes source solution files after consolidation - Supports --dry-run flag Includes comprehensive unit tests covering: - Two solution consolidation - Multiple projects per solution - Single solution handling - Existing target solution reuse Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
9f456f6 to
96d1998
Compare
…ng-multiple-solu-6dd346
There was a problem hiding this comment.
Pull request overview
Adds a new please create-solution-filters command to help migrate multi-solution repositories into a single consolidated solution while generating per-solution .slnf filter files.
Changes:
- Introduces
create-solution-filterscommand to discover source solutions, consolidate projects into a target solution, generate.slnffiles, and delete original.slnfiles. - Adds unit tests covering consolidation scenarios (2 solutions, existing target, multiple projects, single solution) with dry-run permutations.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 7 comments.
| File | Description |
|---|---|
| DotNetPlease/Commands/CreateSolutionFilters.cs | Implements the new CLI command for consolidating solutions and producing solution filter files. |
| DotNetPlease.Tests/Commands/CreateSolutionFiltersTests.cs | Adds test coverage for the new command, including dry-run behavior. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
ZKRobi
requested changes
Apr 7, 2026
Member
ZKRobi
left a comment
There was a problem hiding this comment.
All in all the copilot review seems to be pretty on point with this PR.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Fixes for unresolved review comments: - Validate target is a .sln file early with clear error message (line 63) - Prevent accidental deletion of target solution during cleanup (line 230) - Add project deduplication to handle shared projects across solutions (line 165) - Fix .slnf JSON schema to use correct 'solution' object with 'path' and 'projects' properties (line 202) - Compute relative paths from .slnf file location instead of target solution directory Merged suggestions already applied: - DiscoverSourceSolutions uses direct file globbing instead of project enumeration - ExtractProjectsFromSources throws immediately on parsing failure for all-or-nothing behavior Test updates: - VerifyFilterFile validates correct .slnf schema with path and projects arrays - All 8 unit tests passing (with dry-run variations) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.
Overview
Implements Issue #49 to add a new command that converts multiple
.slnfiles in a multi-solution repository into a single consolidated solution with individual.slnf(solution filter) files for each original solution.This enables teams to migrate from a multi-solution structure to a monorepo while maintaining separate filtering options for different solution contexts.
Command Syntax
Behavior
The command performs the following steps:
.slnfiles matching the glob pattern.slnfJSON files for each original solution that filter the target solution to show only its original projects.slnfiles after successful conversionExample
Before:
After running:
please create-solution-filters --from "Solution*.sln" --target "Consolidated.sln"Result:
Implementation Details
MSBuildHelper.GetProjectInfosFromGlob()for flexible pattern matchingDotNetCliHelper.AddProjectToSolution()for reliable project addition viadotnet slnCLI.slnffiles with proper camelCase property names--dry-runflagTesting
Added comprehensive unit tests covering:
[Theory, CombinatorialData]for dry-run variationsResult: ✅ All 8 tests pass
Files Changed
DotNetPlease/Commands/CreateSolutionFilters.cs(255 lines): Command implementationDotNetPlease.Tests/Commands/CreateSolutionFiltersTests.cs(240 lines): Unit testsNotes
please --help