Skip to content

Add cooldown to dotnet package update - #7705

Merged
zivkan merged 4 commits into
devfrom
dev-zivkan-package-update-cooldown
Sep 17, 2026
Merged

zivkan merged 4 commits into
devfrom
dev-zivkan-package-update-cooldown

Conversation

@zivkan

@zivkan zivkan commented Sep 14, 2026

Copy link
Copy Markdown
Member

Bug

Fixes: NuGet/Home#15027

Description

Adds support for cooldown to dotnet package update, for both "update to latest" as well as "update vulnerable". When an update detects a version in cooldown, it outputs a message, so customers can be aware that an ineligible newer version exists (and also that they have cooldown configured).

PR Checklist

  • Meaningful title, helpful description and a linked NuGet/Home issue
  • Added tests
  • Link to an issue or pull request to update docs if this PR changes settings, environment variables, new feature, etc. cooldown: update docs Home#15036

@zivkan
zivkan requested a review from a team as a code owner September 14, 2026 21:36
@zivkan
zivkan requested review from donnie-msft and nkolev92 and removed request for a team September 14, 2026 21:36
@zivkan
zivkan marked this pull request as draft September 15, 2026 10:36
@zivkan
zivkan changed the base branch from feature-cooldown to dev September 16, 2026 00:12
@zivkan
zivkan force-pushed the dev-zivkan-package-update-cooldown branch from 11c0733 to 593c9dd Compare September 16, 2026 00:16
@zivkan
zivkan marked this pull request as ready for review September 16, 2026 00:16

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

Some more tests/documentation would be great. There may be some details in the spec.

Overall it looks pretty good.

@zivkan
zivkan requested a review from nkolev92 September 16, 2026 23:12
@nkolev92

Copy link
Copy Markdown
Member

I investigated the package-source-mapping failure path for vulnerable updates further. This is a real bug, but it is preexisting and not introduced by this PR. The same behavior is present on dev; the mapping branch logs Error_PackageSourceMappingNotFound and continues without propagating failure.

I added this local regression test:

VulnerablePackageWithPackageSourceMapping_ErrorWhenPackageNameIsNotMapped

The test sets up:

  • a direct Test.Package reference at 1.0.0
  • an NU1903 vulnerability for that package
  • --vulnerable
  • enabled package source mapping whose only pattern is contoso.*

It asserts that the command returns ExitCodes.Error, logs the source-mapping error, does not call GetNonVulnerableAsync, and does not modify the project. On the current implementation it fails with:

Expected exitCode to be 3, but found 0

So this should be tracked and fixed separately rather than treated as a blocking finding for #7705.

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

LGTM.

There's a preexisting what might be a bug that I had copilot write a test for and it'll be a separate comment here.

@zivkan
zivkan merged commit 5b486f6 into dev Sep 17, 2026
18 checks passed
@zivkan
zivkan deleted the dev-zivkan-package-update-cooldown branch September 17, 2026 22:51
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.

cooldown: dotnet package update

2 participants