chore(tools): add tools/ directory + Unlist-NugetPackage.ps1 - #223
Merged
Conversation
Per-repo convention for operational helper scripts that aren't part of
the build or release pipeline:
- Not referenced by fallout.slnx / any .csproj — never built or packed.
- Excluded from version.json's git-height via pathFilters — commits
that only touch tools/ don't bump the patch version. (No more
11.0.<n+1> releases just because a script's docblock got tidied.)
- PowerShell Core 7+ by convention (cross-platform).
First inhabitant: Unlist-NugetPackage.ps1 — wraps `dotnet nuget delete`
with two input modes:
- Single: -Package Foo -Version 1.2.3 (or -Version 1.0,1.1,1.2)
- Bulk: -JsonPath ./batch.json (array of {package, version})
API key from -ApiKey or $env:NUGET_API_KEY. Fails fast if neither.
SupportsShouldProcess, so -WhatIf and -Confirm work for the mutating
calls. Per-item ok/FAIL output; exit code = failure count.
Built to address the 10.3.40-10.3.47 unlist work that surfaced after
the semver-policy fix in #220 — but kept generic so it's reusable for
any future unlist sweep without modification.
Also adds tools/README.md documenting the conventions for future
inhabitants of the directory.
1 task
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.
Why
Surfaced from the v11 / semver-policy work in #220: we need to unlist 102 `Fallout.*` package versions in the `10.3.40`-`10.3.47` range (the ones that shipped breaking changes under patch numbers). Rather than a throwaway shell loop, this PR introduces a proper, reusable tool.
What's in this PR
Smoke-tested locally
```
$ pwsh ./tools/Unlist-NugetPackage.ps1 -Package Foo -Version 1.0.0 -ApiKey dummy -WhatIf
Unlisting 1 package version(s) from https://api.nuget.org/v3/index.json
What if: Performing the operation "Unlist from https://api.nuget.org/v3/index.json" on target "Foo 1.0.0".
[ 1/ 1] Foo 1.0.0 (skipped: -WhatIf)
Done. ok=0 fail=0
```
Bulk mode against a 2-entry JSON also dry-ran cleanly.
Out of scope (follow-up)
The auto-generated CI workflows (`.github/workflows/{ubuntu,macos,windows}-latest.yml` + `release.yml`) have `paths-ignore: [docs/, .assets/, /*.md]` — they don't yet ignore `tools/`. So a `tools/`-only push still triggers the full CI run and release pipeline. Release won't produce a new version (pathFilters prevents height bump → `--skip-duplicate` no-ops on NuGet), but it's a wasted CI cycle. Worth teaching the `[GitHubActions]` attribute about `tools/**` in a separate PR — that touches the generator at `src/Fallout.Common/CI/GitHubActions/`.
Test plan