Skip to content

Fix the SDK pin, Nuke prefix matching and clone path handling in fallout-migrate - #700

Open
ANcpLua wants to merge 4 commits into
Fallout-build:developfrom
ANcpLua:bugfix/migrate-paths-and-sdk-pin
Open

ANcpLua wants to merge 4 commits into
Fallout-build:developfrom
ANcpLua:bugfix/migrate-paths-and-sdk-pin

Conversation

@ANcpLua

@ANcpLua ANcpLua commented Oct 6, 2026

Copy link
Copy Markdown

Fixes three fallout-migrate bugs I found while reviewing the migration for #686 (fallout-migrate 10.4.0 leaves hand edits). Each one breaks a migrated repository even though the tool reports "Migration complete". One commit per fix. There is no separate issue for them; the problem and effect are below.

What changed

  • SDK pin without rollForward. BumpDotNetVersionStep pins global.json to 10.0.100. Without a rollForward property, only a 10.0.1xx SDK is accepted. With only 10.0.4xx installed, every dotnet command then fails. The step now adds "rollForward": "latestFeature" when the sdk object has no policy yet. An existing policy is kept.
  • Nuke inside another dotted name. RewriteCsFilesStep matched \bNuke\., so using Acme.Nuke.Tools; became using Acme.Fallout.Tools; and the build failed with CS0246. The prefix swap now matches only a Nuke. that is not preceded by a letter, digit, underscore or dot.
  • Repository cloned under a bin or obj folder. MigrationFileOperations skipped every file whose absolute path contained /bin/, /obj/ or /.git/. A repository cloned under such a folder got no edits at all. The check now looks only at the folders below the repository root.

Tests

  • BumpDotNetVersionStepSpecs: a bumped SDK gets a roll-forward policy when none is set.
  • RewriteCsFilesStepSpecs: Nuke inside another dotted name is left alone; files are rewritten when the repository sits under a bin folder.

🤖 Generated with Claude Code

ANcpLua and others added 3 commits October 6, 2026 23:58
…json

BumpDotNetVersionStep pins sdk.version to 10.0.100. Without a rollForward
property, the default policy accepts only 10.0.1xx SDKs. On a machine with
only a later feature band, such as 10.0.4xx, every dotnet command then
fails. When the sdk object has no rollForward yet, the step now adds
"rollForward": "latestFeature" next to the new version.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
RewriteCsFilesStep matched `\bNuke\.`, so `using Acme.Nuke.Tools;` became
`using Acme.Fallout.Tools;`. That namespace does not exist and the build
fails with CS0246. The prefix swap now matches only a `Nuke.` that is not
preceded by a letter, digit, underscore or dot.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
MigrationFileOperations skipped every file whose absolute path contained
/bin/, /obj/ or /.git/. For a repository cloned under such a folder, every
step found no files, and the tool still reported "Migration complete". The
check now looks only at the folders below the repository root.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ANcpLua
ANcpLua marked this pull request as ready for review October 7, 2026 01:31
@ANcpLua
ANcpLua requested a review from a team as a code owner October 7, 2026 01:31
Copilot AI balanced review requested due to automatic review settings October 7, 2026 01:31

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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@ChrisonSimtian ChrisonSimtian added the bug Something isn't working label Oct 8, 2026

@ChrisonSimtian ChrisonSimtian left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Approving. The three fixes are clear and each has a spec. I probed the global.json insertion (single-line, CRLF, tabs, version not last, existing policy) and all variants stay valid JSON.

Comment 1 (ProjectModel namespace) is worth fixing in this PR. Comment 2 is a question. Comments 3 and 4 are optional nits.

Comment thread src/Fallout.Migrate/Steps/RewriteCsFilesStep.cs
Comment thread src/Fallout.Migrate/Steps/BumpDotNetVersionStep.cs
Comment thread src/Fallout.Migrate/Common/MigrationFileOperations.cs
Comment thread src/Fallout.Migrate/Steps/BumpDotNetVersionStep.cs
…out-migrate

Review feedback on the SDK pin and Nuke prefix changes:

- Keep `Acme.Nuke.Common.ProjectModel` as it is. Before, it became
  `Acme.Fallout.Solutions`, the same error the prefix fix solves.
- Warn when global.json keeps a rollForward policy (patch, latestPatch or
  disable) that needs the pinned 10.0.1xx feature band.
- Add a spec that bin, obj and .git folders below the root are still skipped.
- Explain why the migration adds latestFeature instead of latestMinor.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ChrisonSimtian

Copy link
Copy Markdown
Collaborator

@ANcpLua let me know when you're ready to merge. As this is your first PR, you wont have permissions yet. I can merge on your behalf, the other ones will then be able to be merged by you once approved.
Welcome to the Fallout and thanks for your Contribution :-)

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants