Skip to content

Enable storage retention for nuget - #446

Merged
andrew merged 2 commits into
git-pkgs:mainfrom
pinguinfuss:issue-306-retention-nuget
Oct 13, 2026
Merged

andrew merged 2 commits into
git-pkgs:mainfrom
pinguinfuss:issue-306-retention-nuget

Conversation

@pinguinfuss

Copy link
Copy Markdown
Contributor

Refs #306.

Registers nuget for storage.retention.

The handler stores NuGet ids lowercased, but purl keeps nuget names as written, so package rules are lowercased before they're matched. Case in a rule doesn't matter.

The mirror stores ids as given, so a mixed-case PURL ends up as a separate copy that clients are never served. Mirroring it doesn't keep the copy clients use from aging out. Until that's fixed, the docs ask for lowercase ids in mirror lists.

The handler stores NuGet ids lowercased, but purl keeps nuget names as written, so package rules get lowercased before they're matched. Case in a rule doesn't matter.

The mirror stores ids as given, so a mixed-case PURL ends up as a copy clients never get. Until that's fixed, the docs ask for lowercase ids in mirror lists.

Refs git-pkgs#306

@andrew andrew 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.

Rather than asking users to give proxy mirror lowercase ids, please fix the mirror path. mirrorOne passes the id through to GetOrFetchArtifact as written (internal/mirror/mirror.go:206), so pkg:nuget/Newtonsoft.Json@13.0.3 is stored as pkg:nuget/Newtonsoft.Json while the handler stores and serves pkg:nuget/newtonsoft.json. Mirroring a mixed-case id downloads a copy no client is ever served and never warms the one they use, independent of retention.

Lowercasing the name for nuget before the PURLs are built (in GetOrFetchArtifact or mirrorOne), with a mirror test using a mixed-case id, should be enough. With that in, the lowercase-ids sentence in the nuget docs row can go. The fix can be in this PR or a separate one merged first.

The mirror passed ids through as written, so pkg:nuget/Newtonsoft.Json@13.0.3 was stored under a copy no client is served while the handler kept serving its lowercased one. GetOrFetchArtifact now lowercases nuget names, and the docs no longer ask for lowercase ids in mirror lists.

Refs git-pkgs#306
@pinguinfuss

Copy link
Copy Markdown
Contributor Author

Fixed in 5d7855f: GetOrFetchArtifact lowercases nuget names, so mirroring pkg:nuget/Newtonsoft.Json@13.0.3 fills the record clients are served. The new mirror test mirrors Serilog and checks that the client's download comes from the cache. The lowercase-ids sentence is gone from the docs. Versions are left alone: an upper-case prerelease like 9.0.0-RC.2… isn't found on nuget.org, so mirroring it fails visibly rather than storing a stray copy.

@pinguinfuss
pinguinfuss requested a review from andrew October 12, 2026 19:48
@andrew
andrew merged commit 9a6b467 into git-pkgs:main Oct 13, 2026
6 checks passed
@pinguinfuss
pinguinfuss deleted the issue-306-retention-nuget branch October 13, 2026 15:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants