fix(migrate): bump Nuke→Fallout PackageReference versions + strip stale Cryptography.Xml pin (#217)#226
Merged
ChrisonSimtian merged 1 commit intoMay 27, 2026
Conversation
…le Cryptography.Xml pin Closes #217 (reported by @dennisdoomen migrating FluentAssertions). The Nuke.X → Fallout.X namespace rewrite carried the original NUKE `Version="10.1.0"` pins onto `Fallout.*` packages. But `Fallout.*` was never published at 10.1.0 (oldest is 10.2.12), so NuGet hit NU1603 ("not found, falling back to next-higher") and `WarningsAsErrors` in the migrated project escalated the warning to fatal. CsprojRewriter changes: - New `NukePackageWithInlineVersionPattern` runs first, matching the full `<PackageReference Include="Nuke.X" ... Version="Y" />` shape (tolerates `PrivateAssets="..."` etc. between Include and Version) and rewrites BOTH the namespace AND the version in one pass. - Existing namespace-only `PackageReferencePattern` still handles CPM-managed references (no inline Version — version lives in Directory.Packages.props), so we don't accidentally inject a Version where there wasn't one. - New `CryptographyXmlPackageRefPattern` removes explicit `System.Security.Cryptography.Xml` `<PackageReference>` lines. NUKE-era projects often pinned older majors (9.x) that conflict with `Fallout.Common`'s transitive ≥ 10.0.6 → NU1605 downgrade. Stripping the explicit pin lets the transitive version win, which matches Dennis's manual workaround. Migration.ResolveFalloutVersion inlines a small InformationalVersion reader (instead of pulling in Fallout.Utilities just for GetVersionText) so the migrate tool stays dependency-free. Falls back to a hardcoded `11.0.0` for local dev builds where InformationalVersion has no git-height `+` suffix. CHANGELOG entry added under [Unreleased] — 11.0 alongside the existing bug-fix bullets. Tests: - 4 existing CsprojRewriterTest cases updated to pass the new `falloutVersion` parameter (no behaviour change for them). - 5 new tests: BumpsNukeInlineVersionToCurrentFalloutVersion, BumpsVersionAcrossExtraAttributesBetweenIncludeAndVersion, LeavesCpmManagedReferencesWithoutInlineVersionUntouchedByVersionPass, StripsSystemSecurityCryptographyXmlPackageReference, LeavesOtherSystemPackagesAlone. - Fallout.Migrate.Tests: 22/22 passed locally. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
ChrisonSimtian
deleted the
fix/migrate-bump-fallout-version-and-strip-cryptography-xml
branch
May 27, 2026 10:33
This was referenced May 27, 2026
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.
Summary
Closes #217, reported by @dennisdoomen while migrating FluentAssertions to Fallout.
After `fallout-migrate`, the generated `_build.csproj` failed to restore with:
```
error NU1603: Warning As Error: _build depends on Fallout.Common (>= 10.1.0) but Fallout.Common 10.1.0 was not found. Fallout.Common 10.2.12 was resolved instead.
error NU1605: Warning As Error: Detected package downgrade: System.Security.Cryptography.Xml from 10.0.6 to 9.0.15.
```
Two root causes, both fixed here:
What this PR changes
`src/Fallout.Migrate/CsprojRewriter.cs` — two new regex passes:
Existing namespace-only `PackageReferencePattern` still handles CPM-managed references (no inline Version — version lives in `Directory.Packages.props`), so we don't accidentally inject a Version where there wasn't one.
`src/Fallout.Migrate/Migration.cs` — `RewriteCsprojs` derives `falloutVersion` from `AssemblyInformationalVersionAttribute` (stripping the `+gabc...` build-metadata suffix). Inlined to keep `Fallout.Migrate` dependency-free (it has no ProjectReferences today). Falls back to a hardcoded `11.0.0` for local dev builds.
`tests/Fallout.Migrate.Tests/CsprojRewriterTest.cs` — 4 existing tests updated to pass the new `falloutVersion` parameter (no behavioural change for them) + 5 new tests covering:
`CHANGELOG.md` — entry added under `[Unreleased] — 11.0` alongside existing bug-fix bullets.
Test plan
Refs