Skip to content

feat: use vsts-task-installer User-Agent for NuGet download statistics#15

Merged
Arthurvdv merged 1 commit into
mainfrom
feat/nuget-useragent-stats
Apr 26, 2026
Merged

feat: use vsts-task-installer User-Agent for NuGet download statistics#15
Arthurvdv merged 1 commit into
mainfrom
feat/nuget-useragent-stats

Conversation

@Arthurvdv

Copy link
Copy Markdown
Member

Summary

Change the NuGet download User-Agent from custom ALCops-AzureDevOps to vsts-task-installer/{version} which matches a recognized known client pattern in NuGet.org's CDN log parser (knownclients.yaml), making ALCops.Analyzers downloads visible in per-package statistics.

This mirrors what was done for the VS Code extension in ALCops/vscode-extension#34, but uses a different known client name (vsts-task-installer vs NuGet VS VSIX) so downloads from each extension are distinguishable.

Changes

File Change
shared/user-agent.ts New shared helper returning vsts-task-installer/{version} (Node.js ...; ...)
tests/shared/user-agent.test.ts Tests for the helper
tasks/install-analyzers/src/nuget-api.ts Use getUserAgent() with task.json version instead of hardcoded string
tests/install-analyzers/nuget-api.test.ts Updated assertion
.github/copilot-instructions.md Updated documentation

Why vsts-task-installer?

  • Matches an existing regex in NuGet.org's knownclients.yaml (no upstream PR needed)
  • Semantically accurate: "VSTS task installer" describes an Azure DevOps pipeline task that installs packages
  • ALCops.Analyzers is niche, so real vsts-task-installer downloads for this package are effectively zero
  • ALCops version numbers in the UA distinguish it from the original client

Change the NuGet download User-Agent from custom 'ALCops-AzureDevOps'
to 'vsts-task-installer/{version} (Node.js {v}; {os} {release})' which
matches a recognized known client pattern in NuGet.org's CDN log parser
(knownclients.yaml), making ALCops.Analyzers downloads visible in
per-package statistics and distinguishable from the VS Code extension.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@Arthurvdv Arthurvdv merged commit 6468408 into main Apr 26, 2026
3 checks passed
@Arthurvdv Arthurvdv deleted the feat/nuget-useragent-stats branch April 26, 2026 13:31
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.

1 participant