Skip to content

Conversation

@paulmedynski
Copy link
Contributor

@paulmedynski paulmedynski commented Nov 10, 2025

Description

  • Updated key dependencies to the latest versions that don't trigger major version bumps.
  • Fixed all build warnings and Wave Analysis vulnerability warnings.
  • Updated .NET Framework project to be a moden SDK project.
  • Updated xUnit packages and made associated test changes for modernization.
  • Updated .NET Framework project to build on Linux.
    • Powershell targets still fail, but it's good enough for this branch which is close to EOL.
  • Updated official pipeline build version numbers to 5.1.8.

Testing

Existing CI should find any problems.

- Updated key dependencies to the latest versions that don't trigger major version bumps.
- Updated xUnit packages and made associated test changes for modernization.
- Updated .NET Framework project to build on Linux.
- Fixed build issues that only appear when building on Windows.
@paulmedynski paulmedynski added this to the 5.1.8 milestone Nov 10, 2025
Copilot AI review requested due to automatic review settings November 10, 2025 16:06
- Removed ancient obsolete copy of XunitExtensions project.
Copy link
Contributor

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 modernizes the build system and test infrastructure for Microsoft.Data.SqlClient by updating dependencies, migrating to SDK-style projects, and improving test code quality.

Key Changes

  • Dependency Updates: Azure.Identity (1.11.4 → 1.12.1), MSAL (4.61.3 → 4.78.0), Azure.Core (version ranges → 1.45.0), and test framework packages (xUnit 2.4.2 → 2.9.3, .NET Test SDK 17.4.1 → 17.12.0)
  • .NET Framework Project Modernization: Migrated netfx/src project to SDK-style format, removing legacy COM references and adding proper .NET Framework reference assemblies support
  • Test Code Improvements: Replaced Assert.False(true, message) anti-pattern with Assert.Fail(message), updated ActiveIssue attributes to use string parameters, and converted synchronous tests to properly async methods

Reviewed Changes

Copilot reviewed 93 out of 94 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
tools/props/Versions.props Updated dependency versions across Azure SDK, MSAL, xUnit, and test infrastructure packages; changed Azure package versions from ranges to fixed versions
src/Microsoft.Data.SqlClient/netfx/src/Microsoft.Data.SqlClient.csproj Migrated to SDK-style project format, removed COM references to mscoree, added Microsoft.NETFramework.ReferenceAssemblies support
src/Microsoft.Data.SqlClient/tests/ManualTests/*.cs Modernized test assertions (Assert.Fail, proper async/await), updated ActiveIssue attributes to string format
src/Microsoft.Data.SqlClient/tests/FunctionalTests/*.cs Improved test assertions (Assert.Empty, Assert.Single), converted tests to async, added AssertExtensions and PlatformDetection helpers
src/Microsoft.Data.SqlClient/tests/**/Microsoft.Data.SqlClient.*.Tests.csproj Added xUnit and Microsoft.DotNet.XUnitExtensions package references, replaced project references with packages
src/Microsoft.Data.SqlClient/src/*/ActiveDirectoryAuthenticationProvider.cs Added pragma warnings to suppress CS0618 for obsolete MSAL API usage
src/Microsoft.Data.SqlClient/netcore/src/Microsoft.Data.SqlClient.csproj Removed explicit Microsoft.Win32.Registry reference, added Azure.Core package reference
src/Microsoft.Data.SqlClient.sln Removed Microsoft.DotNet.XUnitExtensions project reference and dependencies
build.proj Commented out Microsoft.DotNet.XUnitExtensions project from build targets
src/Directory.Build.props Added MSBuild workaround for synthetic project references and suppressed NETSDK1138 warning for .NET 6.0

Copy link
Contributor

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.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@codecov
Copy link

codecov bot commented Nov 10, 2025

Codecov Report

❌ Patch coverage is 33.33333% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 70.98%. Comparing base (499b095) to head (349d0e0).
⚠️ Report is 1 commits behind head on release/5.1.

Files with missing lines Patch % Lines
...SqlClient/ActiveDirectoryAuthenticationProvider.cs 33.33% 2 Missing ⚠️
Additional details and impacted files
@@               Coverage Diff               @@
##           release/5.1    #3754      +/-   ##
===============================================
- Coverage        72.29%   70.98%   -1.31%     
===============================================
  Files              293      293              
  Lines            61612    61928     +316     
===============================================
- Hits             44544    43962     -582     
- Misses           17068    17966     +898     
Flag Coverage Δ
addons 92.38% <ø> (ø)
netcore 75.19% <33.33%> (-1.13%) ⬇️
netfx 68.97% <33.33%> (-0.96%) ⬇️

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.

- Fixed ManualTests SqlBulkCopy file inclusion issues.
@paulmedynski paulmedynski marked this pull request as draft November 10, 2025 17:48
- Fixed MDS nuspec to look for net462 artifacts in the correct place.
- Reverted SqlBulkCopy tests Helpers namespace change.
Copilot AI review requested due to automatic review settings November 10, 2025 18:20
Copy link
Contributor

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

Copilot reviewed 96 out of 97 changed files in this pull request and generated 4 comments.

Comments suppressed due to low confidence (2)

src/Microsoft.Data.SqlClient/tests/ManualTests/SQL/LocalDBTest/LocalDBTest.cs:147

  • Hardcoding the enum value (TargetFrameworkMonikers)0x4 instead of using the named enum member TargetFrameworkMonikers.Uap reduces code readability. The original code was clear about the intent. Since the TargetFrameworkMonikers enum is being removed from the local XUnit extensions and now comes from the NuGet package, verify that the value 0x4 corresponds to the correct enum member in the new package version.
    src/Microsoft.Data.SqlClient/tests/FunctionalTests/AssertExtensions.cs:317
  • The exception type changed from AssertActualExpectedException to EqualException, and the exception creation method changed from constructor to EqualException.ForMismatchedStrings(). The new method requires index parameters (0, 0) that may not accurately represent where the mismatch occurred in the byte arrays. Consider calculating the actual mismatch index to provide more accurate error messages.

- Fixed Helpers namespace for real.
- Added sunit.runner.json config to avoid XUnitExtensions strong name errors.
- Fixed SNI DLL copying for .NET Framework test projects.
Copilot AI review requested due to automatic review settings November 10, 2025 19:43
Copy link
Contributor

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

Copilot reviewed 96 out of 97 changed files in this pull request and generated 4 comments.

Comments suppressed due to low confidence (1)

src/Microsoft.Data.SqlClient/tests/FunctionalTests/AssertExtensions.cs:317

  • The EqualException.ForMismatchedStrings call is missing the expected and actual array lengths which are required parameters. The correct signature should include the index position and lengths: EqualException.ForMismatchedStrings(expectedString, actualString, indexOfFirstDifference, indexOfFirstDifference) or similar. Please verify the correct overload for xUnit 2.9.3 and provide appropriate parameters.

Copy link
Contributor

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.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Copy link
Contributor Author

@paulmedynski paulmedynski left a comment

Choose a reason for hiding this comment

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

Commentary for reviewers.

- Whoops - forget to add the new target file.
@paulmedynski paulmedynski marked this pull request as ready for review November 10, 2025 22:48
Copilot AI review requested due to automatic review settings November 10, 2025 22:48
Copilot finished reviewing on behalf of paulmedynski November 10, 2025 22:50
Copy link
Contributor

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

Copilot reviewed 97 out of 98 changed files in this pull request and generated 5 comments.

Comments suppressed due to low confidence (1)

src/Microsoft.Data.SqlClient/tests/FunctionalTests/AssertExtensions.cs:317

  • The change from AssertActualExpectedException to EqualException is correct for xUnit 2.9.3, but the constructor call EqualException.ForMismatchedStrings(expectedString, actualString, 0, 0) may not work as intended. The last two parameters (0, 0) represent the index and pointer position in the strings. This should likely use actual mismatch positions or a different factory method. Consider using just new EqualException(expectedString, actualString) if the simpler constructor is available.

- Pipeline tweaks in preparation for the official 5.1.8 build.
Copy link
Contributor Author

@paulmedynski paulmedynski left a comment

Choose a reason for hiding this comment

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

Commentary for reviewers.

- Fixed variable -> parameter that I missed earlier.
- Added target framework to paths for .NET Framework DLL copying steps
Copilot AI review requested due to automatic review settings November 11, 2025 13:25
Copy link
Contributor

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

Copilot reviewed 102 out of 103 changed files in this pull request and generated 3 comments.

Comments suppressed due to low confidence (2)

src/Microsoft.Data.SqlClient/tests/FunctionalTests/AssertExtensions.cs:313

  • The catch block catches EqualException and the throw statement calls EqualException.ForMismatchedStrings(). This change suggests migration to a newer xUnit version where AssertActualExpectedException was replaced with EqualException. However, the ForMismatchedStrings method signature with four parameters (two index parameters at the end) might not be correct. Verify that EqualException.ForMismatchedStrings accepts these parameters in xUnit 2.9.3, as this could cause runtime errors.
    src/Microsoft.Data.SqlClient/tests/FunctionalTests/AssertExtensions.cs:317
  • The catch block catches EqualException and the throw statement calls EqualException.ForMismatchedStrings(). This change suggests migration to a newer xUnit version where AssertActualExpectedException was replaced with EqualException. However, the ForMismatchedStrings method signature with four parameters (two index parameters at the end) might not be correct. Verify that EqualException.ForMismatchedStrings accepts these parameters in xUnit 2.9.3, as this could cause runtime errors.

- Ignoring ADO Library variables for NuGet and assembly versioning.
Copy link
Contributor Author

@paulmedynski paulmedynski left a comment

Choose a reason for hiding this comment

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

Commentary for reviewers.

Copy link
Contributor

@mdaigle mdaigle left a comment

Choose a reason for hiding this comment

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

Ideally would have liked to see this as three separate PRs: build improvements, xunit updates, and version bumps

@paulmedynski
Copy link
Contributor Author

Ideally would have liked to see this as three separate PRs: build improvements, xunit updates, and version bumps.

Agreed - this one got away from me!

… major version bumps for transitive packages.

- Left breadcrumbs indicating why we're including Azure.Core explicitly.
Copilot AI review requested due to automatic review settings November 12, 2025 18:36
Copilot finished reviewing on behalf of paulmedynski November 12, 2025 18:37
Copy link
Contributor

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

Copilot reviewed 104 out of 105 changed files in this pull request and generated 1 comment.

Comments suppressed due to low confidence (1)

src/Microsoft.Data.SqlClient/tests/FunctionalTests/AssertExtensions.cs:317

  • The change from AssertActualExpectedException to EqualException.ForMismatchedStrings alters the exception type and API. Verify that this aligns with the xUnit 2.9.3 API and that the parameters (0, 0 for index and pointer position) are appropriate for all use cases of this extension method.

mdaigle
mdaigle previously approved these changes Nov 12, 2025
@paulmedynski paulmedynski merged commit 080c712 into release/5.1 Nov 13, 2025
80 checks passed
@paulmedynski paulmedynski deleted the dev/paul/release/5.1/update-dependencies branch November 13, 2025 12:21
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.

4 participants