Repository navigation
Add per-source telemetry for package IDs containing non-alphanumeric, dash, dot, or underscore characters - #7213
Merged
Conversation
Copilot
AI
changed the title
[WIP] Add telemetry for non-standard package ID tracking
Add per-source telemetry for non-standard package ID characters
Mar 13, 2026
jeffkl
reviewed
Mar 16, 2026
jeffkl
reviewed
Mar 16, 2026
jeffkl
force-pushed
the
copilot/add-telemetry-package-id-validation
branch
from
March 30, 2026 20:12
7e34992 to
79664c2
Compare
jeffkl
marked this pull request as ready for review
March 30, 2026 20:12
jeffkl
enabled auto-merge (squash)
March 31, 2026 22:46
nkolev92
reviewed
Mar 31, 2026
jeffkl
approved these changes
Apr 1, 2026
Member
|
@copilot |
auto-merge was automatically disabled
April 15, 2026 18:14
Head branch was pushed to by a user without write access
Contributor
Author
Fixed in 5a894ff. The changes incorporate dev's nullability Phase 1 work for
Build: 0 warnings, 0 errors. |
nkolev92
reviewed
Apr 15, 2026
… per feed source Co-authored-by: jeffkl <[email protected]>
Co-authored-by: jeffkl <[email protected]>
Co-authored-by: jeffkl <[email protected]>
… PublicAPI files Agent-Logs-Url: https://github.com/NuGet/NuGet.Client/sessions/99e74a70-9115-4726-adbb-4b262f30d6da Co-authored-by: nkolev92 <[email protected]>
jeffkl
force-pushed
the
copilot/add-telemetry-package-id-validation
branch
from
April 21, 2026 21:58
5a894ff to
6cb9d56
Compare
jeffkl
enabled auto-merge (squash)
April 22, 2026 16:58
nkolev92
approved these changes
Apr 23, 2026
2 of 3 tasks
1 of 3 tasks
nkolev92
added a commit
that referenced
this pull request
Apr 24, 2026
) PR #7213 added AnyPackageIdContainsNonAlphanumericDotDashOrUnderscoreCharacters telemetry and updated the count from 49 to 50, but PR #7307 had already added TargetFrameworks and TargetFrameworksCount, making the correct count 51. Co-authored-by: Copilot <[email protected]>
Copilot AI
pushed a commit
that referenced
this pull request
Apr 24, 2026
) PR #7213 added AnyPackageIdContainsNonAlphanumericDotDashOrUnderscoreCharacters telemetry and updated the count from 49 to 50, but PR #7307 had already added TargetFrameworks and TargetFrameworksCount, making the correct count 51. Co-authored-by: Copilot <[email protected]> Co-authored-by: nkolev92 <[email protected]>
This was referenced May 14, 2026
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.
Bug
Fixes: NuGet/Home#14212
Description
Adds telemetry to track whether any package ID contains characters outside
[A-Za-z0-9.\-_](i.e., anything other than ASCII letters, digits,., or-,_). This is emitted in two places:PackageSourceDiagnosticsevent) — correlates non-standard ID usage to specific feed providersProjectRestoreInformationevent) — indicates whether any resolved package in the restore graph has a non-standard IDProtocol layer
PackageIdproperty toProtocolDiagnosticNupkgCopiedEvent(nullable; new 3-param constructor, old 2-param delegates to it)FindPackagesByIdNupkgDownloader→identity.IdLocalPackageArchiveDownloader→_packageIdentity.IdLocalV3FindPackageByIdResource/LocalV2FindPackageByIdResource→idparameterPublicAPI.Unshipped.txtfilesPer-source telemetry (
PackageSourceTelemetry)Dataclass: newIdContainsNonAsciiCharacterbool, sticky-true once any non-standard ID is seen for that sourceReadOnlySpan<char>character loop (local functionHasNonASCIICharacters)AddNupkgCopiedData: skips check whenPackageIdis null (events raised by old constructor)ToTelemetryAsync: emitsnupkgs.idcontainsnonasciicharacteralongside the existingnupkgs.copied/nupkgs.bytesPer-restore telemetry (
RestoreCommand)AnyPackageIdContainsNonASCIICharactersproperty on theProjectRestoreInformationtelemetry eventTests
PackageSourceTelemetryTests— Existing tests coveringAddNupkgCopiedDatafor: all-standard IDs →false; non-standard IDs (underscore, Unicode, space,@,+) →true; mixed batch with one non-standard → stickytrue; nullPackageId→false.ToTelemetry_WithData_CreatesTelemetryPropertiesasserts the new property is emitted.RestoreCommandTests— New tests:ExecuteAsync_WithASCIIPackageId_AnyPackageIdContainsNonASCIICharactersIsFalse— standard[A-Za-z0-9.-]package →falseExecuteAsync_WithNonASCIIPackageId_AnyPackageIdContainsNonASCIICharactersIsTrue—[Theory]with underscore, Kelvin sign (U+212A), Greek alpha (U+03B1), accented Latin (U+00E9), Cyrillic (U+0410) →trueExecuteAsync_WithMixedPackageIds_AnyPackageIdContainsNonASCIICharactersIsTrue—[Theory]where direct dep is standard but transitive dep has non-standard chars →truePR Checklist