Skip to content

Conversation

samsharma2700
Copy link
Contributor

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.

@Copilot Copilot AI review requested due to automatic review settings August 22, 2025 22:48
@samsharma2700 samsharma2700 requested a review from a team as a code owner August 22, 2025 22:48
Copy link
Contributor

@Copilot Copilot AI left a 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

Copy link

codecov bot commented Aug 23, 2025

Codecov Report

❌ Patch coverage is 64.64646% with 35 lines in your changes missing coverage. Please review.
✅ Project coverage is 65.29%. Comparing base (cf2bdc7) to head (13090ce).
⚠️ Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
...icrosoft/Data/SqlClient/UserAgent/UserAgentInfo.cs 61.95% 35 Missing ⚠️
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     
Flag Coverage Δ
addons 90.82% <ø> (ø)
netcore 66.74% <62.88%> (-0.03%) ⬇️
netfx 69.16% <68.96%> (+2.99%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@samsharma2700 samsharma2700 merged commit 4e93076 into main Aug 26, 2025
250 checks passed
@samsharma2700 samsharma2700 deleted the dev/samsharma2700/user_agent_fe branch August 26, 2025 19:31
@paulmedynski paulmedynski added this to the 7.0-preview1 milestone Aug 28, 2025
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.

3 participants