Skip to content

Validate installed SqlClient family versions from Logging packages - #4815

Draft
paulmedynski wants to merge 1 commit into
dev/paul/aot/phase-1.0from
dev/paul/aot/phase-1.1
Draft

paulmedynski wants to merge 1 commit into
dev/paul/aot/phase-1.0from
dev/paul/aot/phase-1.1

Conversation

@paulmedynski

Copy link
Copy Markdown
Contributor

Description

Ship exact installed-family package validation from Internal.Logging, in both build/ and buildTransitive/.

  • Use the resolved Logging package version as the anchor; check only installed SqlClient, Abstractions, Azure and AKV family members.
  • Collect compile/reference/runtime/RID-specific assets safely when references lack NuGet metadata.
  • Support PackageReference and legacy packages.config, including prerelease labels, SQLCLIENT001 diagnostics, design-time skipping and the emergency SqlClientEnforceFamilyVersions=false opt-out.
  • Exclude independently versioned SqlServer.Server and native SNI packages.
  • Document scope and escape hatch. Ordinary project references do not propagate these consumer build assets.

Layer 1 of 6 in the seven-PR phase-one authentication stack; based on the branch-guidance layer. No authentication implementation changes.

Issues

No issue is automatically closed by this infrastructure layer.

Testing

  • pwsh -NoProfile -File src/Microsoft.Data.SqlClient.Internal/Logging/test/RunVersionChecks.ps1 — passed, 503 checked dotnet commands.
    • Synthetic exact-version matrix covers all asset groups, metadata-free references, stable/prerelease versions, optional packages, exclusions, design-time skipping, opt-out and packages.config.
    • The real Logging package contains identical build/ and buildTransitive/ targets.
    • Actual isolated direct/transitive NuGet consumers prove automatic imports, matching/mixed versions and runtime-only dependencies. Other family packages are small fixtures, not production builds.
  • git -C ../phase-1.1 diff --check — passed before commit.

No SQL Server or identity service was required.

Guidelines

Please review the contribution guidelines before submitting a pull request:

  • Contributing

  • Code of Conduct

  • Best Practices

  • Coding Style

  • Review Process

  • Tests added or updated.

  • Public API changes documented — no public API changes.

  • Verified against customer repro — no customer repro applies.

  • Ensure no breaking changes introduced — mixed installed family versions intentionally fail with an explicit emergency opt-out.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings October 9, 2026 18:24
@paulmedynski
paulmedynski added this pull request to stack #4822 October 9, 2026 18:25

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 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/ and buildTransitive/.
  • 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.

Comment on lines +39 to +41
<XmlPeek XmlInputPath="$(MSBuildProjectDirectory)/packages.config"
Query="/packages/package[@id='Microsoft.Data.SqlClient.Internal.Logging']/@version"
Condition="Exists('$(MSBuildProjectDirectory)/packages.config')">
@@ -0,0 +1,53 @@
<Project>
@codecov

codecov Bot commented Oct 9, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (dev/paul/aot/phase-1.0@c3f01b0). Learn more about missing BASE report.

Additional details and impacted files
@@                    Coverage Diff                    @@
##             dev/paul/aot/phase-1.0    #4815   +/-   ##
=========================================================
  Coverage                          ?   65.10%           
=========================================================
  Files                             ?      286           
  Lines                             ?    68600           
  Branches                          ?        0           
=========================================================
  Hits                              ?    44665           
  Misses                            ?    23935           
  Partials                          ?        0           
Flag Coverage Δ
PR-SqlClient-Project 65.10% <ø> (?)

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

☔ View full report in Codecov by Harness.
📢 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.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: To triage

Development

Successfully merging this pull request may close these issues.

2 participants