Repository navigation
Consumer build-time validation of SqlClient family package versions - #4815
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
Project-specific legacy packages configuration files currently bypass validation.
2 open findings
What changed in this PR
Adds consumer-side validation ensuring installed SqlClient family packages use identical versions.
Changes:
- Ships validation through
build/andbuildTransitive/. - Adds extensive synthetic and package-consumer tests.
- Documents diagnostics and the emergency opt-out.
| File | Description |
|---|---|
BUILDGUIDE.md |
Documents validation and testing. |
Logging.targets |
Implements family-version checks. |
Logging.csproj |
Packages the targets. |
PackageReadme.md |
Documents consumer behavior. |
RunVersionChecks.ps1 |
Adds the regression matrix. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Codecov Report✅ All modified and coverable lines are covered by tests.
Additional details and impacted files@@ Coverage Diff @@
## main #4815 +/- ##
==========================================
- Coverage 72.40% 65.87% -6.54%
==========================================
Files 292 286 -6
Lines 45471 68619 +23148
==========================================
+ Hits 32924 45201 +12277
- Misses 12547 23418 +10871
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Support project-specific legacy manifests with NuGet precedence. Convert version checks to Pester and invoke them directly from YAML. Run checks in PR Logging test jobs and OneBranch package validation. Document pinned PowerShell tooling and regression coverage. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Run pinned PowerShell commands through DotNetCoreCLI tasks. Document test intent and remove YAML-wiring tests in favor of pipeline runs. Update the documented Pester command to run only version-check tests. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
/azp run |
|
Azure Pipelines: Successfully started running 2 pipeline(s). 1 pipeline(s) were filtered out due to trigger conditions. |
Remove the shared Pester step and dedicated Logging test jobs. Keep the family-version regression suite available for local execution. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Address review feedback: SqlClient depends on every other family package, so it now owns the consumer target and anchors the check on its own resolved version. Logging is checked like any other member. - Rename the target to Microsoft.Data.SqlClient.targets and pack it into build/ and buildTransitive/ via the SqlClient nuspec. - Stop packing the target from the Logging package. - Move the Pester suite to tests/VersionChecks; consumer tests use a fixture SqlClient package carrying the real target, plus a check that the real nuspec packs it. - Move package readme docs to SqlClient and update BUILDGUIDE. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Downgrade XmlPeek failures on a malformed packages.config to warnings so the version check never fails a consumer build on its own, and document the target's limitations: it depends on .NET SDK/NuGet targets and metadata, silently skips builds that lack them, and only checks inner builds of multi-targeting projects. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>



Description
Consumers of the SqlClient family of packages must use identically versioned assemblies. This PR adds a build target to the Microsoft.Data.SqlClient package that warns consuming apps and libraries when their installed SqlClient family packages have mismatched versions.
ValidateSqlClientFamilyPackageVersionsin the Microsoft.Data.SqlClient package under bothbuild/andbuildTransitive/.SQLCLIENT001for mismatches; the warning does not fail the build by default.SqlClientEnforceFamilyVersions=falseas an opt-out, and exclude independently versionedSqlServer.Serverand native SNI.Public API and behavior changes
No public CLR types or method signatures are added or removed. This PR adds consumer-facing MSBuild validation that reports mismatched installed family package versions as a warning by default.
mainValidateSqlClientFamilyPackageVersionsin Microsoft.Data.SqlClient'sbuild/andbuildTransitive/assets, enabled by default.SQLCLIENT001; builds continue by default, though consumers that treat warnings as errors may choose to fail their builds.SqlClientEnforceFamilyVersions=falseas an opt-out.Issues
Related runtime authentication version enforcement: #4820. This consumer build-time check is separate from the AOT 1-7 runtime/validation chain.
Testing