Skip to content

Resolve a Root Holding Several .NET Entries as a Unit Before Any Nested Solution - #4042

Merged
ptr727 merged 2 commits into
developfrom
burndown/4039-dotnet-workspaces-root-unit
Nov 10, 2026
Merged

ptr727 merged 2 commits into
developfrom
burndown/4039-dotnet-workspaces-root-unit

Conversation

@ptr727

@ptr727 ptr727 commented Nov 10, 2026

Copy link
Copy Markdown
Owner

Summary

Fixes the finding raised on promotion #4039 against .github/actions/dotnet-workspaces/action.yml:40-46.

Where the repository root tracked more than one .sln, .slnx or .csproj and the caller asked for solutions, the action named every nested solution and never the root's own entries. A tree holding App.csproj, AppTests.csproj, sub/Tool.sln and sub/Tool.csproj resolved to sub/Tool.sln alone. So the lint job's dotnet format style passed while skipping both root projects, a fail-open style check.

  • .github/actions/dotnet-workspaces/action.yml: a root holding more than one entry is now resolved as a unit. With solutions: 'true', it names only the root's own solutions. Where the root holds none, it falls back to the projects pathspec, as before. Nested solutions are named only where the root holds nothing. The solutions input's description states the rule.
  • The exactly-one rule Name Each Root Workspace Where the Root Holds More Than One .NET Solution or Project #3795 decided is unchanged. A root holding exactly one solution or project still takes the bare call. The test step, which passes no solutions, is unchanged too, so WORKFLOW.md D1.6, which describes only that step, still matches and is not edited.
  • tests/test_release_guards.py: the per-workspace test gains two layouts, two root projects beside a nested solution and two root solutions beside a nested solution. Both fail on develop's action and pass on this one. The existing cases are kept.

Closes on promotion: none

Verification

  • python -m unittest discover -s tests: all 3784 pass (11 skipped), run with tests/requirements.txt installed as CI does.
  • Mutation check: with develop's action.yml restored, the two new layouts fail the style step's case and every other case passes.
  • scripts/repo_gate.py: exit 0.
  • scripts/docker_lint.py: success, 7 linters.
  • Prose gate over the branch diff: no violations.
  • Two recorded local strict passes. The first raised two introduced wording findings, the input description and the test docstring each stating the rule for every root rather than one holding more than one entry. Both are fixed in 5cc9352, and the second pass raised nothing.

🤖 Generated with Claude Code

ptr727 and others added 2 commits November 10, 2026 12:53
…ed Solution

Where the repository root tracked more than one solution or project and the
style job asked for solutions, the dotnet-workspaces action named every nested
solution and never the root's projects. A root holding two projects beside a
nested solution therefore passed dotnet format style while skipping both root
projects. The action now names only the root's own solutions there, and the
projects where the root holds none, keeping nested solutions for a root that
holds nothing. The exactly-one bare-call rule is unchanged.

Adds two such layouts to the per-workspace test, both failing on the previous
action.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ring

The input description now limits the rule to a root holding more than one
entry, and the docstring names the projects fallback.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Copilot AI lite review requested due to automatic review settings November 10, 2026 21:03
@ptr727

ptr727 commented Nov 10, 2026

Copy link
Copy Markdown
Owner Author

A recorded local strict-review pass covers head 5cc93528a031810433f8214abd42c061fc60d9fe, the content this pull request carries at that commit against develop, and it recorded 0 findings.

@coderabbitai

coderabbitai Bot commented Nov 10, 2026 •

Copy link
Copy Markdown

Explain Change →

Caution

Review failed

The pull request is closed.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

The resolver now prioritizes complete root-level solution or project sets, preserves bare-call and nested-discovery behavior, and adds regression coverage for mixed workspace layouts.

No open issues 🎉

What changed in this PR

Updates the shared .NET workspace resolver so roots containing multiple solutions or projects are handled as a unit before nested workspaces are considered.

Changes:

  • Select root-level solutions when solutions: 'true' is enabled, falling back to the project pathspec when none exist.
  • Preserve exactly-one bare-call behavior and nested discovery only when the root has no entries.
  • Add regression coverage for mixed root and nested workspace layouts.
  • Clarify the test documentation to accurately describe root-level selection.
File Description
tests/​test_release_guards.py Adds regression layouts for multiple root projects or solutions alongside nested workspaces and documents the selection behavior.
.github/​actions/​dotnet-workspaces/​action.yml Updates workspace resolution to prioritize multiple root-level entries and documents the corresponding selection rule.

Review effort: Lite

@codecov

codecov Bot commented Nov 10, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 79.03%. Comparing base (a735c0a) to head (5cc9352).

Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #4042   +/-   ##
========================================
  Coverage    79.03%   79.03%           
========================================
  Files           37       37           
  Lines        12676    12676           
========================================
  Hits         10019    10019           
  Misses        2657     2657           
Flag Coverage Δ
python-3.13 79.03% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ptr727

ptr727 commented Nov 10, 2026

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@ptr727

ptr727 commented Nov 10, 2026

Copy link
Copy Markdown
Owner Author

/review

@coderabbitai

coderabbitai Bot commented Nov 10, 2026 •

Copy link
Copy Markdown
Action not completed

Pull request is closed.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

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