Smooth the Fallout.Common.ProjectModel → Fallout.Solutions migration path#528
Smooth the Fallout.Common.ProjectModel → Fallout.Solutions migration path#528ChrisonSimtian wants to merge 3 commits into
Conversation
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 #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 #253, which never reached the CLI tool. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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 (#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>
… 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 #528 adds). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
| @@ -31,7 +41,13 @@ public static RewriteResult Rewrite(string original) | |||
| { | |||
| var edits = 0; | |||
|
|
|||
| var content = namespacePrefix.Replace(original, _ => | |||
| var content = projectModelNamespace.Replace(original, _ => | |||
| { | |||
| edits++; | |||
| return "Fallout.Solutions"; | |||
| }); | |||
|
|
|||
| content = namespacePrefix.Replace(content, _ => | |||
There was a problem hiding this comment.
I understand the new migration design, that new migrations should go into their dedicated `XxxStep".
There was a problem hiding this comment.
yep, claude doesn't quite understand it yet. so this needs some work plus some agent.md adjustments. just down with a pretty bad cold this week so doing things slower and one at a time 😊
|
I was really struggling with the title and the description. Took quite some time until I understood that this is a fix for a previous breaking change on the I've created #544 to help prevent that situation and took the liberty to have Copilot rewrite the description using those new instructions. Now I finally get it 😀 |
The existing rule was one abstract line and easy to ignore in practice (see PR #528's description). Break it into checkable rules -- one idea per sentence, no idioms, define jargon on first use, gloss cross-references -- and add two anti-pattern examples pulled from a real PR description. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
The existing rule was one abstract line and easy to ignore in practice (see PR #528's description). Break it into checkable rules -- one idea per sentence, no idioms, define jargon on first use, gloss cross-references -- and add two anti-pattern examples pulled from a real PR description. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> (cherry picked from commit 56733af)
Follow-up to #257 (the rename of
Fallout.Common.ProjectModeltoFallout.Solutions). That rename shipped in 11.0.13 as a breaking change, with no compatibility shim. This PR does not undo that break — it stays. It adds a shim and a migration-tool fix so consumers upgrading from 11.0.1–11.0.12 have an easier, mechanical way to move to the new namespace.Non-breaking / additive.
What changed
fallout-migrateonly replaced theNuke.prefix, sousing Nuke.Common.ProjectModel;was rewritten to the now-unusedFallout.Common.ProjectModel, not the real new namespace. It now maps both the oldNuke.Common.ProjectModeland the interimFallout.Common.ProjectModeltoFallout.Solutionsin one edit. This closes a gap in the CLI tool that Update Nuke→Fallout codefix to map Common.ProjectModel → Solutions for v11 #253 (an earlier fix) left open — Update Nuke→Fallout codefix to map Common.ProjectModel → Solutions for v11 #253 only fixed the analyzer's code-fix, not the CLI migrator.SolutionandSolutionAttributeare mirrored back intoFallout.Common.ProjectModelinsideFallout.Common, so[Solution] readonly Solution Solution;still compiles.Fallout.Consumer.ProjectModelShim(infallout.slnx), fails CI if the shim above stops working. This mirrors howNuke.Consumeralready guards theNuke.Common.ProjectModelshim.Limits
This shim only covers the common entry-point pattern above — it is not a full alias for the old namespace. Code that navigates the project graph still gets the real
Fallout.Solutions.*types. TheGenerateProjectscode generator still keys off the new namespace's attribute. Binary compatibility and the package-ID rename are unaffected. For anything beyond the entry-point pattern,fallout-migrateis the complete fix — same as the existingNuke.Common.ProjectModelshim.Verification
Fallout.Common, the shim, and the new consumer sentinel build with 0 errors.Fallout.Migrate.Specspasses (34 tests, 4 new ones for the ProjectModel rule).