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
7e34992 to
79664c2
Compare
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 <17556515+jeffkl@users.noreply.github.com>
Co-authored-by: jeffkl <17556515+jeffkl@users.noreply.github.com>
Co-authored-by: jeffkl <17556515+jeffkl@users.noreply.github.com>
… PublicAPI files Agent-Logs-Url: https://github.com/NuGet/NuGet.Client/sessions/99e74a70-9115-4726-adbb-4b262f30d6da Co-authored-by: nkolev92 <2878341+nkolev92@users.noreply.github.com>
5a894ff to
6cb9d56
Compare
nkolev92
approved these changes
Apr 23, 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