Skip to content

Document NuGet minimum package publish age CLI options - #56733

Merged
BillWagner merged 1 commit into
mainfrom
nuget-minimum-publish-age
Nov 3, 2026
Merged

BillWagner merged 1 commit into
mainfrom
nuget-minimum-publish-age

Conversation

@zivkan

@zivkan zivkan commented Nov 3, 2026 •

Copy link
Copy Markdown
Member

Summary

  • Document --min-publish-age-hours on dotnet nuget add source and dotnet nuget update source, including .NET SDK 11.0.100 availability, whole-hour values, default behavior, and set/reset examples.
  • Correct the existing .NET 11 SDK summary's “cooldown” terminology and NU1020 condition for floating references.
  • Leave package add/update and restore reference pages unchanged; link to NuGet's conceptual article for detailed behavior.

Related to NuGet/Home#15036. Companion documentation: NuGet/docs.microsoft.com-nuget#3620.

Sources and AI disclosure

Adapted behavior and availability from NuGet/docs.microsoft.com-nuget#3620, verified option registration against NuGet.Client, and executed source-command examples with SDK 11.0.100-rc.3.26522.148. No source prose was copied verbatim.

Source-section breakdown:

  • Introduction: Adapted feature terminology and SDK availability.
  • Configure a minimum publish age: Adapted units and zero behavior; generated CLI option descriptions and 72-hour set/reset examples.
  • How package selection uses the age: Adapted automatic-selection behavior in the existing SDK summary.
  • Package restore and floating versions: Adapted the corrected NU1020 condition in that summary.
  • Publish date requirements: Not reproduced; covered by the conceptual link.
  • Balance the delay with security updates: Not reproduced; covered by the conceptual link.

AI-generated option prose/examples and AI-adapted SDK prose need subject-matter review. Changed articles carry ai-usage: ai-assisted.

Publication dependency: The conceptual and NU1020 links require publication of NuGet/docs.microsoft.com-nuget#3620.

Validation

git diff --check — passed. Article metadata, terminology, code-fence balance, and added relative-link checks — passed.

Executed these commands with $config pointing to an isolated temporary NuGet configuration file:

dotnet nuget add source https://api.nuget.org/v3/index.json -n nuget.org --min-publish-age-hours 72 --configfile $config
dotnet nuget update source nuget.org --min-publish-age-hours 72 --configfile $config
dotnet nuget update source nuget.org --min-publish-age-hours 0 --configfile $config

All passed: inspected XML confirmed minPublishAgeHours="72" after add/update and removal of the attribute after reset.

Also executed the existing SDK examples in a clean isolated configuration:

dotnet nuget add source https://api.nuget.org/v3/index.json --name public --min-publish-age-hours 24 --configfile $config
dotnet nuget update source public --min-publish-age-hours 48 --configfile $config

Both passed: XML confirmed ages of 24 and 48 hours respectively. Also verified that an update without the option preserves the value, and that adding with zero or without the option leaves no age attribute. Temporary configuration removed; user-level NuGet configuration unchanged.

Markdown lint wasn't run successfully: npx --no-install markdownlint-cli2 with the edited article paths failed because the package wasn't installed. No tooling was installed.


Internal previews

File Preview link
docs/core/tools/dotnet-nuget-add-source.md Learn preview
docs/core/tools/dotnet-nuget-update-source.md Learn preview
docs/core/whats-new/dotnet-11/sdk.md Learn preview

Build report

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@zivkan
zivkan requested a review from BillWagner as a code owner November 3, 2026 02:41
Copilot AI balanced review requested due to automatic review settings November 3, 2026 02:42
@dotnetrepoman dotnetrepoman Bot added this to the November 2026 milestone Nov 3, 2026
@zivkan
zivkan requested a review from a team November 3, 2026 02:42

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.

🔵 Needs a closer look

The new conceptual and NU1020 links depend on the still-open NuGet/docs.microsoft.com-nuget#3620, so cross-repository publication sequencing needs confirmation before merging.

No open issues 🎉

What changed in this PR

This PR documents minimum package publish age settings in the NuGet source CLI reference and clarifies the feature’s behavior in the .NET 11 SDK summary.

Changes:

  • Document --min-publish-age-hours availability, defaults, and examples for adding and updating sources.
  • Clarify automatic version selection, explicit-version bypass behavior, and NU1020 conditions for floating references.
  • Link to detailed NuGet guidance, with publication dependent on the companion documentation PR.
File Description
docs/​core/​whats-new/​dotnet-11/​sdk.md Clarifies minimum-age filtering and restore limitations.
docs/​core/​tools/​dotnet-nuget-update-source.md Documents the option and examples to set or remove the minimum age.
docs/​core/​tools/​dotnet-nuget-add-source.md Documents the option, default behavior, and a 72-hour example.

Review effort: Balanced

@BillWagner BillWagner left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This LGTM, and I'll :shipit: now.

@BillWagner
BillWagner merged commit 1b2cd24 into main Nov 3, 2026
17 checks passed
@BillWagner
BillWagner deleted the nuget-minimum-publish-age branch November 3, 2026 15:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants