Skip to content

Cherry-pick the Fallout.Common.ProjectModel migration path onto 10.4 - #590

Merged
ChrisonSimtian merged 4 commits into
Fallout-build:release/v10.4from
ChrisonSimtian:bugfix/projectmodel-shim-for-10.4
Jul 28, 2026
Merged

Cherry-pick the Fallout.Common.ProjectModel migration path onto 10.4#590
ChrisonSimtian merged 4 commits into
Fallout-build:release/v10.4from
ChrisonSimtian:bugfix/projectmodel-shim-for-10.4

Conversation

@ChrisonSimtian

Copy link
Copy Markdown
Collaborator

Cherry-picks #528 onto the 10.4 release line. Non-breaking / additive.

Why

10.4.0-rc.4 breaks consumers upgrading from 10.3.x. The solution types moved from Fallout.Common.ProjectModel to Fallout.Solutions, with no shim on this branch:

Build.cs(5,22): error CS0234: The type or namespace name 'ProjectModel' does not exist in the namespace 'Fallout.Common'
Build.cs(42,6): error CS0246: The type or namespace name 'SolutionAttribute' could not be found
Build.cs(43,14): error CS0246: The type or namespace name 'Solution' could not be found

Reported against rc.4 on a real consumer repo. Shipping 10.4.0 GA as-is makes every [Solution] readonly Solution Solution; build fail on upgrade.

Changes

Four commits, cherry-picked with -x, no conflicts:

  • Map Common.ProjectModelFallout.Solutions in the CLI migratorfallout-migrate only replaced the Nuke. prefix, rewriting using Nuke.Common.ProjectModel; to the now-unused Fallout.Common.ProjectModel instead of the real namespace. Both the old and interim namespaces now map to Fallout.Solutions in one edit.
  • Add the Fallout.Common.ProjectModel entry-point transition shimSolution and SolutionAttribute mirrored back so the canonical consumer pattern keeps compiling without running fallout-migrate first.
  • Stop the shim colliding with the Nuke.Common shim generator.
  • Fold CodeRewriter into RewriteCsFilesStep — included so Fallout.Migrate stays byte-identical to main, keeping later cherry-picks clean.

All six touched source files are now identical to main.

Limits

The shim is shallow by design — an entry-point grace period, not a full alias. Navigating the graph still hands back canonical Fallout.Solutions.* types, and GenerateProjects keys off the canonical attribute. fallout-migrate remains the complete path. Same ceiling as the existing Nuke.Common.ProjectModel shim.

Verification

  • Full fallout.slnx build: 0 errors.
  • Full test run: all suites pass except 3 pre-existing GitRepositoryWorktreeSpecs failures that reproduce identically on the unmodified base commit — they assert on the git remote identifier and only fail on a fork clone whose branch tracks upstream. Not related to this change.
  • Fallout.Migrate.Specs 38/38, Fallout.SourceGenerators.Specs 9/9.
  • All four consumer sentinels compile, including Nuke.Consumer (shim-collision guard) and the new Fallout.Consumer.ProjectModelShim, which is exactly the reported pattern.

Follow-ups

ChrisonSimtian and others added 4 commits July 29, 2026 10:02
The fallout-migrate CLI rewriter only swapped the `Nuke.` prefix, so a NUKE-era
`using Nuke.Common.ProjectModel;` landed on the now-dead `Fallout.Common.ProjectModel`
namespace — the solution types moved to `Fallout.Solutions` in Fallout-build#257. Add a rule
mapping both the Nuke and interim Fallout `Common.ProjectModel` namespaces to
`Fallout.Solutions`, run before the generic prefix swap so each reference migrates
in a single edit. Mirrors the analyzer codefix from Fallout-build#253, which never reached the
CLI tool.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
(cherry picked from commit 8da363e)
The solution types shipped under `Fallout.Common.ProjectModel` in Fallout
11.0.1–11.0.12 and moved to `Fallout.Solutions` in 11.0.13 (Fallout-build#257), breaking that
upgrade with no shim. Restore the common entry-point pattern
(`[Solution] readonly Solution Solution;`) by mirroring `Solution` +
`SolutionAttribute` back into the old namespace inside Fallout.Common. Shallow by
design — deep graph navigation, GenerateProjects source-gen, and binary compat
still require `fallout-migrate` — matching the ceiling of the generated
`Nuke.Common.ProjectModel` shim. A new compile-time consumer sentinel
(Fallout.Consumer.ProjectModelShim, in fallout.slnx) fails CI if the shim regresses.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
(cherry picked from commit 63ac171)
… shim generator

The new Fallout.Common.ProjectModel.Solution/SolutionAttribute entry-point
shims are public types under Fallout.Common, so the Nuke.Common shim's
'Fallout.Common -> Nuke.Common' generator rule swept them up and emitted
Nuke.Common.ProjectModel.Solution — which the 'Fallout.Solutions ->
Nuke.Common.ProjectModel' rule also emits from the canonical type. Two
partial declarations with different base classes → CS0263/CS0111, failing
Compile.

Give ShimAllPublicTypesUnder an ExceptNamespacePrefixes option and exclude
Fallout.Common.ProjectModel from the broad Fallout.Common rule. Those types
relocated to Fallout.Solutions in v11 and are shimmed by the dedicated rule;
the Fallout.Common.ProjectModel re-exports are a Fallout-side grace shim that
must not be re-shimmed into Nuke. Regenerated the affected Verify snapshots
(attribute surface + the solution generator picking up the new sentinel
consumer project Fallout-build#528 adds).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
(cherry picked from commit 26280ad)
CodeRewriter.Rewrite had a single caller (RewriteCsFilesStep). Move its regex
fields and Rewrite method directly into the step and delete the now-empty class.
Rename the spec file/class to match.

Mirrors the CsprojRewriter fold, so a migration step owns the rewrite rules for
its artifact type instead of delegating them to a free-floating static class in
Steps/. Raised in review on Fallout-build#528.

No behaviour change.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
(cherry picked from commit 9fb8800)
@ChrisonSimtian ChrisonSimtian added bug Something isn't working target/vCurrent Targets the current version labels Jul 28, 2026
@ChrisonSimtian
ChrisonSimtian marked this pull request as ready for review July 28, 2026 22:41
@ChrisonSimtian
ChrisonSimtian requested a review from a team as a code owner July 28, 2026 22:41
@ChrisonSimtian
ChrisonSimtian merged commit feadd5b into Fallout-build:release/v10.4 Jul 28, 2026
3 checks passed
@ChrisonSimtian
ChrisonSimtian deleted the bugfix/projectmodel-shim-for-10.4 branch July 28, 2026 22:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working target/vCurrent Targets the current version

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant