Keep publishing the CLI as Fallout.GlobalTool - #581
Conversation
The dotnet-tool package id had been changed to Fallout.GlobalTools (plural)
ahead of first release. Revert it: Fallout.GlobalTool is the id the entire
10.2.x/10.3.x install base already has pinned (52 published versions, latest
10.3.49), so continuing to publish under it means nobody migrates and no id
has to be unlisted. Assembly/namespace stay Fallout.Cli; command stays
`fallout`.
- Fallout.Cli.csproj: <PackageId>Fallout.GlobalTool</PackageId>, with a comment
recording why it deliberately doesn't match the assembly name.
- templates/dotnet-tools.json + BuildScaffolder comments: `fallout :setup`
writes a `fallout.globaltool` pin into consumer repos again.
- UpdateNotificationAttribute: in-tool prompt says `dotnet tool update
Fallout.GlobalTool -g`.
- build/Build.cs: the Install target installed `Solution.Fallout_Cli.Name`
("Fallout.Cli"), which never matched the packed nupkg id. Point it at a new
GlobalToolPackageId constant instead.
Docs swept repo-wide for the plural id: README install + note, CONTRIBUTING,
introduction, 01-installation, 02-setup, 03-execution, github-actions,
rebrand-plan. docs/migration/from-globaltool-to-cli.md deleted — it documented
a GlobalTool -> Cli rename that is now explicitly never happening, and was
already draft:true with no inbound links.
Left alone: .config/dotnet-tools.json still pins fallout.cli 10.3.45. That is
the repo's own dogfood pin and flipping it needs a published Fallout.GlobalTool
build newer than 10.3.49; doing it here would regress `dotnet tool restore`.
Verified: pack produces Fallout.GlobalTool.*.nupkg; Fallout.Cli.Specs 47/47.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Review feedback on Fallout-build#581: the Install target shouldn't carry yet another hardcoded copy of the package id. Fallout.ProjectModel already exposes MSBuild property access on the solution model, so walk the object path instead: Solution.Fallout_Cli.GetProperty("PackageId") // -> Fallout.GlobalTool Drops the GlobalToolPackageId constant added in the previous commit. The csproj is now the single source of truth for the id, so changing it later touches one file. No new API was needed — ProjectExtensions.GetProperty (src/Fallout.ProjectModel) has covered this since the NUKE days, and the same MSBuild-evaluation path is already exercised by this build at Build.cs:98 via GetTargetFrameworks(). Verified end-to-end against fallout.slnx: GetProperty("PackageId") on the Fallout.Cli project returns "Fallout.GlobalTool". Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
…t id Two changes to what fallout-migrate does about the tool package id. Point the migration at Fallout.GlobalTool. Fallout-build#581 settled on keeping the NUKE-era id rather than moving to Fallout.GlobalTools, so the current id and the retired list swap places: current: fallout.globaltool retired: nuke.globaltool, fallout.cli, fallout.globaltools A consumer already pinning fallout.globaltool now migrates to nothing, which is the point of keeping that id. Covered by a spec. Add SwitchGlobalToolStep. Rewriting .config/dotnet-tools.json only fixes the repo. A machine-wide install of a retired tool stays behind, and two packages providing the `fallout` command conflict, so the repo-only fix left the machine broken. The new step reads `dotnet tool list --global`, uninstalls each retired id that is installed, then installs the current one at the resolved version. It runs after RewriteToolManifestStep: repo first, so an interrupted run still leaves the committed state correct. Every command is best-effort — no dotnet on PATH, no global install, or an unreachable feed produces a Summary warning naming the command to run by hand, never a failed migration. --dry-run prints the commands without running them. Introduces CliWrap (3.10.3, central pin) for the process calls: buffered output and a cancellation token without hand-rolled ProcessStartInfo plumbing. Scoped to Fallout.Migrate on purpose. Fallout.Common has its own ProcessTasks layer that build authors consume, and that is not changing. Added to docs/dependencies.md under a new Console / process section. Also flips .config/dotnet-tools.json to fallout.globaltool 10.3.49. The pin could not move while the id was Fallout.GlobalTools, because nothing was published there above 10.4.0-rc.4. Verified: `dotnet tool restore` resolves it. docs/migration/tool-package-id.md rewritten around the kept id. It is now a "move off a retired id" page, and most readers need no action at all. Verified: Fallout.Migrate.Specs 63/63; solution builds; dry-run against a scratch repo pinning fallout.cli rewrites the manifest as expected. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
Follow-ups from this thread are now in place:
One useful side effect: with the id back to |
CI on this branch went into a loop of repeated `dotnet tool restore` and was killed by the OOM killer after 11 minutes. Two problems, one of which is a real bug in the previous commits. Revert .config/dotnet-tools.json to fallout.cli 10.3.45. Moving it to fallout.globaltool 10.3.49 was verified only as far as `dotnet tool restore` succeeding, which it does. What was never checked is that a 10.3.49 CLI can actually run this repo's build, and CI says something in that path does not terminate. 10.3.49 is a late one-off publish under the old id, not a build this branch has ever run against. The pin stays where main has it until a Fallout.GlobalTool release newer than the 10.4 line exists — which is the constraint Fallout-build#581 documented and this branch wrongly assumed it had cleared. Gate SwitchGlobalToolStep behind --switch-global-tool, default off. MigrationIntegrationSpecs runs the real pipeline with dryRun: false, so the step was shelling out to `dotnet tool list --global` on every spec run, and would have run uninstall/install on any machine that happened to have a retired id installed. A unit test run must not change what software is on the machine. Beyond the specs, silently changing a machine-wide install is too large a side effect for a tool whose job is to migrate a repository, so opt-in is the right default regardless of the test problem. Flag threads MigrateSettings -> Migration -> MigrationContext, next to DryRun. docs/migration/tool-package-id.md documents it. Verified: Fallout.Migrate.Specs 63/63. CI is the real check for the pin revert. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
dennisdoomen
left a comment
There was a problem hiding this comment.
🤔 Don't you want this on 10.4? If so, it should target the release branch.
The tool id the migration moves consumers onto was a literal, independent of
the id Fallout.Cli is actually published under. The two could drift, and a
migration would then pin an id that does not exist.
Holds the id in one place instead: a FalloutGlobalToolPackageId property in
Directory.Build.props feeds Fallout.Cli's PackageId, and a small MSBuild
target compiles the same value into Fallout.Migrate as a constant. Lowercased
on the way in, so written dotnet-tools.json manifests stay byte-identical to
what the previous literal produced.
Runtime lookup is not an option here: fallout-migrate runs against a
consumer's repository, where no Fallout csproj exists, so the
Solution.Fallout_Cli.GetProperty("PackageId") approach used in build/Build.cs
cannot reach anything.
Both projects fail the build if the property is ever empty. Without that,
Fallout.Cli would quietly fall back to its assembly name and publish as
Fallout.Cli, which is the id Fallout-build#581 exists to avoid.
This is a hotfix so Fallout-build#576 is not blocked. Fallout-build#584 designs the general mechanism
for flowing published ids into shipped code and should replace all of it; the
three touched files carry HOTFIX notes saying what to remove.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The "UPDATE RECOMMENDED FROM 5.1.0" header was hardcoded in NUKE 9885956 (March 2021) and never updated since, so it named a version no Fallout consumer has ever run. The header still earns its place — it gives the numbered steps context in a server-build warning — so only the version reference goes. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
docs/rebrand-plan.md is being removed — it describes a rename that has already landed and reads to AI tools as a live plan needing maintenance. The reason this PackageId deliberately diverges from the assembly name belongs with the package-id-as-consumer-contract discussion in Fallout-build#582. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
Review round two — all threads answered. On 10.4 (@dennisdoomen): yes, it needs to land there, but via
Pushed:
Filed:
Separate PR incoming for removing |
Review feedback on #581: the Install target shouldn't carry yet another hardcoded copy of the package id. Fallout.ProjectModel already exposes MSBuild property access on the solution model, so walk the object path instead: Solution.Fallout_Cli.GetProperty("PackageId") // -> Fallout.GlobalTool Drops the GlobalToolPackageId constant added in the previous commit. The csproj is now the single source of truth for the id, so changing it later touches one file. No new API was needed — ProjectExtensions.GetProperty (src/Fallout.ProjectModel) has covered this since the NUKE days, and the same MSBuild-evaluation path is already exercised by this build at Build.cs:98 via GetTargetFrameworks(). Verified end-to-end against fallout.slnx: GetProperty("PackageId") on the Fallout.Cli project returns "Fallout.GlobalTool". Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
…tion FalloutGlobalToolPackageId was added but never used — UpdateNotificationAttribute still printed the id as a literal, so the constant was dead and free to drift from the thing it claimed to mirror. Now that Fallout-build#581 has landed and <PackageId> is settled as the singular Fallout.GlobalTool, the two agree and the attribute can read the constant. This is still a hand-kept copy, not a derivation: the attribute ships inside Fallout.Common and runs in a consumer's build, where no Fallout csproj exists to read <PackageId> from. Flowing the id in at compile time is the follow-up on Fallout-build#584. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Review feedback on #581: the Install target shouldn't carry yet another hardcoded copy of the package id. Fallout.ProjectModel already exposes MSBuild property access on the solution model, so walk the object path instead: Solution.Fallout_Cli.GetProperty("PackageId") // -> Fallout.GlobalTool Drops the GlobalToolPackageId constant added in the previous commit. The csproj is now the single source of truth for the id, so changing it later touches one file. No new API was needed — ProjectExtensions.GetProperty (src/Fallout.ProjectModel) has covered this since the NUKE days, and the same MSBuild-evaluation path is already exercised by this build at Build.cs:98 via GetTargetFrameworks(). Verified end-to-end against fallout.slnx: GetProperty("PackageId") on the Fallout.Cli project returns "Fallout.GlobalTool". Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> (cherry picked from commit cef0b37)
Keep publishing the dotnet tool as
Fallout.GlobalTool(singular) instead of theFallout.GlobalToolsid introduced in f020810.Fallout.GlobalToolhas 52 published versions on nuget.org (10.2.12 → 10.3.49) — that's the id the entire existing install base already has pinned. Staying on it means no consumer migrates, no id gets unlisted, and no migration guide is needed. Assembly/namespace stayFallout.Cli; the command staysfallout.The plural id shipped exactly one prerelease,
Fallout.GlobalTools 10.4.0-rc.4, so the blast radius is rc testers only — not a GA break, hence nobreaking-changelabel. The README note covers them.Changes
Fallout.Cli.csproj—<PackageId>Fallout.GlobalTool</PackageId>, with a comment recording why the package id deliberately doesn't match the assembly name.templates/dotnet-tools.json+BuildScaffolder—fallout :setupwrites afallout.globaltoolpin into consumer repos again.UpdateNotificationAttribute— in-tool prompt saysdotnet tool update Fallout.GlobalTool -g.build/Build.cs— drive-by fix: theInstalltarget installedSolution.Fallout_Cli.Name("Fallout.Cli"), which never matched the packed nupkg id and has been broken since the id was first decoupled. Now uses aGlobalToolPackageIdconstant.docs/migration/from-globaltool-to-cli.md(documented aGlobalTool → Clirename that is now explicitly never happening; alreadydraft: true, no inbound links).Deliberately not in this PR
.config/dotnet-tools.jsonstill pinsfallout.cli 10.3.45— the repo's own dogfood pin. Flipping it needs a publishedFallout.GlobalToolnewer than 10.3.49; changing it here would regressdotnet tool restorefor the bootstrappers.Verification
dotnet pack src/Fallout.Cli→Fallout.GlobalTool.10.0.0-preview.55.g748120854f.nupkgFallout.Cli.Specs47/47 passing;build/_build.csprojcompilesFollow-ups
release/v10.4before 10.4.0 GA, so GA continues theFallout.GlobalToolsequence from 10.3.49.Fallout.GlobalTools 10.4.0-rc.4on nuget.org withFallout.GlobalToolas the alternate package.RewriteToolManifestStepthat rewrites consumer manifests tofallout.globaltools. Needs rebasing to the singular id or closing.🤖 Generated with Claude Code