Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UserAgentParser parsing #10114

Merged
merged 6 commits into from
Aug 8, 2024
Merged

UserAgentParser parsing #10114

merged 6 commits into from
Aug 8, 2024

Conversation

clairernovotny
Copy link
Contributor

@clairernovotny clairernovotny commented Aug 7, 2024

A building block for https://github.com/NuGet/Engineering/issues/5082

Adds support for custom user agent parsing based on the LogInterpretation library

@clairernovotny clairernovotny requested a review from a team as a code owner August 7, 2024 19:50
@clairernovotny
Copy link
Contributor Author

Tests all pass
image

("NuGet+VS+VSIX/4.8.1+(Microsoft+Windows+NT+10.0.17134.0,+VS+Enterprise/15.0)", "NuGet VS VSIX", "4", "8", "1"),
("NuGet+Command+Line/4.3.0+(Microsoft+Windows+NT+6.2.9200.0)", "NuGet Command Line", "4", "3", "0"),
("Mozilla/5.0 (Windows NT 10.0; Microsoft Windows 10.0.19045; en-US) PowerShell/7.2.9", "PowerShell Core", "7", "2", "9"),
("Xamarin Updater (Platform: osx-13.1.0) (Application: Visual Studio Community) (Version: 17.4.5 (build 8))", "Xamarin Updater", "17", "4", "5"),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you add test for '(Linux 5.18.0-14.2-liquorix-amd64 #1 ZEN SMP PREEMPT_DYNAMIC liquorix 5.18-16ubuntu1~jammy (2022-0)' which has unmatched parenthesis? See more context:
https://github.com/NuGet/NuGet.Client/pull/4991/files

Copy link
Contributor Author

@clairernovotny clairernovotny Aug 8, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What would you expect the result to be here? Parsing returns Other, None bc there's no user agent specified here and none of the regexes we have match it. This is the same on the current parsing codebase too. Unmatched parentheses aren't the issue, it's the missing user agent string.

Also, the code here just is to extract the user agent info, not the OS info; that's done by the ImportAzureCdnStatistics job, which isn't affected by this and will continue to use the .NET code.

@clairernovotny clairernovotny merged commit b1c2839 into dev Aug 8, 2024
2 checks passed
@clairernovotny clairernovotny deleted the cnov-stats-uap branch August 8, 2024 16:12
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.

5 participants