-
Notifications
You must be signed in to change notification settings - Fork 314
Add Json Payload Functionality for User Agent Feature Extension #3582
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR implements JSON payload functionality for the User Agent Feature Extension, adding the necessary classes and logic to generate constrained JSON payloads containing driver and environment information. The implementation follows specification guidelines for field prioritization, size limits, and truncation behavior.
- Adds UserAgentInfo class with payload generation, size adjustment, and field truncation logic
- Creates UserAgentInfoDto as a data transfer object for JSON serialization with proper field mapping
- Implements comprehensive unit tests covering payload constraints, field dropping, and serialization contracts
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.
Show a summary per file
File | Description |
---|---|
UserAgentInfoTests.cs | Comprehensive unit tests for payload validation, field truncation, size adjustment, and JSON contract verification |
UserAgentInfoDto.cs | Data transfer object with JSON property mappings and nested OS information structure |
UserAgentInfo.cs | Core implementation with payload generation, size constraints, OS detection, and field prioritization logic |
Microsoft.Data.SqlClient.csproj (netfx) | Project file update to include new UserAgent classes |
Microsoft.Data.SqlClient.csproj (netcore) | Project file update to include new UserAgent classes |
src/Microsoft.Data.SqlClient/tests/UnitTests/UserAgentInfoTests.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.Data.SqlClient/tests/UnitTests/UserAgentInfoTests.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.Data.SqlClient/tests/UnitTests/UserAgentInfoTests.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/UserAgent/UserAgentInfo.cs
Show resolved
Hide resolved
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3582 +/- ##
==========================================
+ Coverage 63.19% 65.29% +2.09%
==========================================
Files 274 276 +2
Lines 62478 62577 +99
==========================================
+ Hits 39486 40861 +1375
+ Misses 22992 21716 -1276
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Description
Part 2 of UserAgent work. Previous PR: #3451
(Note: This PR is identical to #3489 but due to recent MDS GH rule compliance had to create new branch to allow merges from
main
)Testing
Builds are running and added unit tests to verify changes.