Skip to content

Scope package-id restore telemetry flag to actual packages - #7576

Merged
nkolev92 merged 1 commit into
devfrom
dev-nkolev92-telemetryPackageIdFalsePositive
Jul 21, 2026
Merged

nkolev92 merged 1 commit into
devfrom
dev-nkolev92-telemetryPackageIdFalsePositive

Conversation

@nkolev92

@nkolev92 nkolev92 commented Jul 20, 2026 •

Copy link
Copy Markdown
Member

Bug

Fixes: https://github.com/NuGet/Client.Engineering/issues/3889

Description

The AnyPackageIdContainsNonAlphanumericDotDashOrUnderscoreCharacters restore telemetry flag scanned every node in the flattened dependency graph, including project nodes. A project's name (or, for unresolved references, its project file path containing \ and :) tripped the check, so the signal was dominated by false positives from projects rather than real package ids.

The fix restricts the check to LibraryType.Package nodes, so only actual package ids are considered.

Tests cover the three misfire cases: an unresolved package, a non-existent project reference (NU1104), and a project reference with a non-ASCII name.

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.

The AnyPackageIdContainsNonAlphanumericDotDashOrUnderscoreCharacters telemetry
flag inspected every node in the flattened restore graph, including project
nodes. Project PackageIds (or, for unresolved references, project file paths
containing '\' and ':') tripped the flag, dominating the signal with false
positives. Restrict the check to LibraryType.Package nodes.

Adds tests covering: an unresolved package, a non-existent project reference
(NU1104), and a project reference with a non-ASCII name.

Co-authored-by: Copilot <[email protected]>
Copilot-Session: d6ed873c-2b1e-4d4e-9cde-c217bfdc3a73
@nkolev92
nkolev92 marked this pull request as ready for review July 20, 2026 22:43
@nkolev92
nkolev92 requested a review from a team as a code owner July 20, 2026 22:43
@nkolev92
nkolev92 requested a review from donnie-msft July 20, 2026 23:50

@donnie-msft donnie-msft 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.

Approving, but the test comments/name/functionality seem a bit off. Made 1 suggestion that might fix it.

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.

4 participants