Conversation
There was a problem hiding this comment.
Pull request overview
This PR migrates repository builds/tests/packs to use build2.proj-driven conventions across packages, updates per-package versioning to new Versions.props files, and adjusts CI/OneBranch pipelines and supporting documentation to match the new build flow.
Changes:
- Replace shared versioning/import wiring (removing
tools/props/Versions.props) with per-packageVersions.propsplus shared build-number handling insrc/Directory.Build.props. - Update package projects (SqlClient, extensions, SqlServer, AKV provider) to the new version properties and build2-compatible layout.
- Update CI/OneBranch pipelines to add SqlServer packaging and to run build/pack/analyzers via build2-friendly templates.
Reviewed changes
Copilot reviewed 65 out of 74 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| tools/targets/GenerateThisAssemblyCs.targets | Changes default ThisAssembly namespace generation behavior. |
| tools/props/Versions.props | Removes legacy centralized version property definitions/imports. |
| src/Microsoft.SqlServer.Server/Versions.props | Adds new SqlServer versioning logic. |
| src/Microsoft.SqlServer.Server/TypeForwards.netfx.cs | Adds conditional compilation for NETFRAMEWORK. |
| src/Microsoft.SqlServer.Server/StringsHelper.netstandard.cs | Adds NETSTANDARD guard + formatting cleanup. |
| src/Microsoft.SqlServer.Server/SqlUserDefinedTypeAttribute.netstandard.cs | Adds NETSTANDARD guard. |
| src/Microsoft.SqlServer.Server/SqlUserDefinedAggregateAttribute.netstandard.cs | Adds NETSTANDARD guard. |
| src/Microsoft.SqlServer.Server/SqlMethodAttribute.netstandard.cs | Adds NETSTANDARD guard. |
| src/Microsoft.SqlServer.Server/SqlFunctionAttribute.netstandard.cs | Adds NETSTANDARD guard. |
| src/Microsoft.SqlServer.Server/SqlFacetAttribute.netstandard.cs | Adds NETSTANDARD guard. |
| src/Microsoft.SqlServer.Server/Microsoft.SqlServer.Server.csproj | Switches to Versions.props-based versioning + new output layout. |
| src/Microsoft.SqlServer.Server/InvalidUdtException.netstandard.cs | Adds NETSTANDARD guard. |
| src/Microsoft.SqlServer.Server/IBinarySerialize.netstandard.cs | Adds NETSTANDARD guard. |
| src/Microsoft.SqlServer.Server/.editorconfig | Removes project-local analyzer config. |
| src/Microsoft.Data.SqlClient/tests/UnitTests/UserAgentTests.cs | Updates ThisAssembly usage and whitespace formatting. |
| src/Microsoft.Data.SqlClient/tests/UnitTests/Microsoft.Data.SqlClient.UnitTests.csproj | Removes CodeCoverage runsettings copy item. |
| src/Microsoft.Data.SqlClient/tests/ManualTests/Microsoft.Data.SqlClient.ManualTests.csproj | Removes CodeCoverage runsettings copy item; updates AKV project reference path. |
| src/Microsoft.Data.SqlClient/tests/FunctionalTests/Microsoft.Data.SqlClient.FunctionalTests.csproj | Removes CodeCoverage runsettings copy item. |
| src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/UserAgent.cs | Uses ThisAssembly in new namespace; whitespace/doc formatting cleanup. |
| src/Microsoft.Data.SqlClient/src/Microsoft.Data.SqlClient.csproj | Moves versioning import to new Versions.props; consolidates references layout. |
| src/Microsoft.Data.SqlClient/ref/Microsoft.Data.SqlClient.csproj | Updates ref project versioning import to new Versions.props. |
| src/Microsoft.Data.SqlClient/notsupported/Microsoft.Data.SqlClient.csproj | Renames build2 target in guidance; switches to new Versions.props. |
| src/Microsoft.Data.SqlClient/add-ons/AzureKeyVaultProvider/AkvProviderVersions.props | Removes legacy AKV versioning props file. |
| src/Microsoft.Data.SqlClient/Versions.props | Renames MDS version properties to SqlClient equivalents. |
| src/Microsoft.Data.SqlClient.slnx | Updates solution entries for moved/renamed files/projects. |
| src/Microsoft.Data.SqlClient.Internal/Logging/src/Versions.props | Adds new Logging versioning logic. |
| src/Microsoft.Data.SqlClient.Internal/Logging/src/LoggingVersions.props | Removes legacy Logging versioning props file. |
| src/Microsoft.Data.SqlClient.Internal/Logging/src/Logging.csproj | Switches Logging to new Versions.props and output layout. |
| src/Microsoft.Data.SqlClient.Extensions/Azure/test/Azure.Test.csproj | Reorganizes properties; keeps test project settings. |
| src/Microsoft.Data.SqlClient.Extensions/Azure/src/Versions.props | Adds new Azure extension versioning logic. |
| src/Microsoft.Data.SqlClient.Extensions/Azure/src/AzureVersions.props | Removes legacy Azure versioning props file. |
| src/Microsoft.Data.SqlClient.Extensions/Azure/src/Azure.csproj | Switches Azure extension to new Versions.props and reference layout. |
| src/Microsoft.Data.SqlClient.Extensions/Abstractions/test/Abstractions.Test.csproj | Reorganizes test csproj structure; keeps references. |
| src/Microsoft.Data.SqlClient.Extensions/Abstractions/src/Versions.props | Adds new Abstractions versioning logic. |
| src/Microsoft.Data.SqlClient.Extensions/Abstractions/src/AbstractionsVersions.props | Removes legacy Abstractions versioning props file. |
| src/Microsoft.Data.SqlClient.Extensions/Abstractions/src/Abstractions.csproj | Switches Abstractions to new Versions.props and reference layout. |
| src/Microsoft.Data.SqlClient.AlwaysEncrypted.AzureKeyVaultProvider/src/Versions.props | Adds new AKV provider versioning logic. |
| src/Microsoft.Data.SqlClient.AlwaysEncrypted.AzureKeyVaultProvider/src/Utils.cs | Introduces shared validation/exception helpers for AKV provider. |
| src/Microsoft.Data.SqlClient.AlwaysEncrypted.AzureKeyVaultProvider/src/Strings.resx | Adds localized resources for AKV provider errors. |
| src/Microsoft.Data.SqlClient.AlwaysEncrypted.AzureKeyVaultProvider/src/Strings.Designer.cs | Adds generated strongly-typed resource accessors. |
| src/Microsoft.Data.SqlClient.AlwaysEncrypted.AzureKeyVaultProvider/src/PackageReadme.md | Adds NuGet package readme for AKV provider. |
| src/Microsoft.Data.SqlClient.AlwaysEncrypted.AzureKeyVaultProvider/src/Microsoft.Data.SqlClient.AlwaysEncrypted.AzureKeyVaultProvider.csproj | Updates AKV provider csproj to new versioning/output and reference wiring. |
| src/Microsoft.Data.SqlClient.AlwaysEncrypted.AzureKeyVaultProvider/src/LocalCache.cs | Adds local caching helper for heavy objects. |
| src/Microsoft.Data.SqlClient.AlwaysEncrypted.AzureKeyVaultProvider/src/Constants.cs | Adds shared constants (endpoints, parameter names). |
| src/Microsoft.Data.SqlClient.AlwaysEncrypted.AzureKeyVaultProvider/src/AzureSqlKeyCryptographer.cs | Adds Azure Key Vault crypto/key client wrapper. |
| src/Microsoft.Data.SqlClient.AlwaysEncrypted.AzureKeyVaultProvider/src/.editorconfig | Adds analyzer settings for AKV provider source. |
| src/Directory.Build.props | Adds shared build-number handling and reorganizes warning settings; removes legacy versions import. |
| eng/pipelines/stages/verify-nuget-packages-ci-stage.yml | Adds SqlServer artifact download/dependency for package verification stage. |
| eng/pipelines/stages/build-sqlserver-package-ci-stage.yml | Adds CI stage template for building/packing SqlServer.Server. |
| eng/pipelines/onebranch/steps/roslyn-analyzers-csproj-step.yml | Removes legacy build.proj-based Roslyn analyzer step. |
| eng/pipelines/onebranch/steps/roslyn-analyzers-build2-step.yml | Updates Roslyn analyzer step to build2-based parameters/targets. |
| eng/pipelines/onebranch/steps/pack-sqlclient-step.yml | Removes legacy SqlClient-specific pack step. |
| eng/pipelines/onebranch/steps/pack-csproj-step.yml | Removes legacy csproj pack step for build.proj. |
| eng/pipelines/onebranch/steps/pack-build2-step.yml | Adds generic build2-based pack step. |
| eng/pipelines/onebranch/steps/copy-apiscan-files-sqlclient-step.yml | Removes legacy SqlClient APIScan copy step. |
| eng/pipelines/onebranch/steps/build-sqlclient-step.yml | Removes legacy SqlClient build step. |
| eng/pipelines/onebranch/steps/build-csproj-step.yml | Removes legacy build.proj csproj build step. |
| eng/pipelines/onebranch/steps/build-build2-step.yml | Adds generic build2-based build step. |
| eng/pipelines/onebranch/stages/build-stages.yml | Rewires OneBranch stages to the new build-build2 job/template structure. |
| eng/pipelines/onebranch/jobs/build-signed-sqlclient-package-job.yml | Removes legacy SqlClient-specific signed job. |
| eng/pipelines/onebranch/jobs/build-build2-package-job.yml | Adds/updates generic OneBranch job to build/sign/pack via build2 steps. |
| eng/pipelines/libraries/ci-build-variables.yml | Adds SqlServer package version variable. |
| eng/pipelines/jobs/pack-sqlserver-package-ci-job.yml | Adds CI job template to pack SqlServer.Server via dotnet pack. |
| eng/pipelines/dotnet-sqlclient-ci-core.yml | Adds SqlServer build stage + threads artifact into verification. |
| eng/pipelines/common/templates/steps/run-all-tests-step.yml | Updates test targets/properties to new build2 target names and property names. |
| eng/pipelines/common/templates/steps/ci-project-build-step.yml | Updates build invocation for SqlClient and AKV provider wiring. |
| eng/pipelines/common/templates/jobs/ci-build-nugets-job.yml | Updates AKV provider packing to dotnet pack and new property names. |
| build.proj | Removes legacy build.proj orchestrator. |
| Directory.Packages.props | Updates central package version properties to new SqlClient/AkvProvider names. |
| .github/prompts/release-notes.prompt.md | Updates prompt content but currently contains path/version-source inconsistencies. |
Comments suppressed due to low confidence (2)
src/Microsoft.Data.SqlClient/Versions.props:28
- This comment still refers to build number coalescing happening in /tools/props/Versions.props and being stored as AssemblyBuildNumber, but that file was removed and the shared property is now FileVersionBuildNumber (from src/Directory.Build.props). Update the comment to match the current versioning flow so future changes don’t rely on outdated guidance.
eng/pipelines/onebranch/jobs/build-build2-package-job.yml:147 - The command that sets dependencyPackageArguments is missing a closing quote (and effectively spans lines), which will likely inject an extra quote/newline into the variable value and break subsequent msbuild invocations. Make this a single-line echo with balanced quoting (or no quotes) so the variable contains clean "-p:PackageVersionX=Y" tokens.
| <!-- Put the ThisAssembly class in the System namespace by default. --> | ||
| <ThisAssemblyNamespace Condition="'$(ThisAssemblyNamespace)' == ''">System</ThisAssemblyNamespace> | ||
| <ThisAssemblyNamespace Condition="'$(ThisAssemblyNamespace)' == ''">$(AssemblyName)</ThisAssemblyNamespace> |
There was a problem hiding this comment.
The comment says ThisAssembly defaults to the System namespace, but the default was changed to $(AssemblyName). This is both misleading and a breaking change for any code (including reflection-based lookups) that expects "System.ThisAssembly". Either keep the default as System, or update the comment and ensure all known call sites are updated to the new fully-qualified name.
| -p:AkvProviderPackageVersion=${{ parameters.akvPackageVersion }} | ||
| -p:AbstractionsPackageVersion=${{ parameters.abstractionsPackageVersion }} | ||
| -p:LoggingPackageVersion=${{ parameters.loggingPackageVersion }} | ||
| -p:MdsPackageVersion=${{ parameters.mdsPackageVersion }} |
There was a problem hiding this comment.
This AKV provider build passes -p:MdsPackageVersion, but central package versions now key off SqlClientPackageVersion (see Directory.Packages.props). As written, package-mode builds/restores can pick up an empty SqlClient version. Pass -p:SqlClientPackageVersion (or otherwise map the provided mdsPackageVersion) instead of MdsPackageVersion.
| -p:MdsPackageVersion=${{ parameters.mdsPackageVersion }} | |
| -p:SqlClientPackageVersion=${{ parameters.mdsPackageVersion }} |
| configurationToPack: ${{ parameters.buildConfiguration }} | ||
| nobuild: true | ||
| packDirectory: $(packagePath) | ||
| buildProperties: ReferenceType=${{ parameters.referenceType }};AbstractionsPackageVersion=${{ parameters.abstractionsPackageVersion }};LoggingPackageVersion=${{ parameters.loggingPackageVersion }};MdsPackageVersion=${{ parameters.mdsPackageVersion }};AkvProviderPackageVersion=${{ parameters.akvPackageVersion }};BuildNumber=$(Build.BuildNumber);AssemblyBuildNumber=$(assemblyBuildNumber) |
There was a problem hiding this comment.
The AKV provider pack task passes MdsPackageVersion in buildProperties, but Directory.Packages.props uses SqlClientPackageVersion/AkvProviderPackageVersion. If this pack is intended to restore Microsoft.Data.SqlClient from the local feed in package mode, MdsPackageVersion won’t affect the resolved version. Consider switching this to SqlClientPackageVersion (and verify the other property names align with the new *Versions.props files).
| buildProperties: ReferenceType=${{ parameters.referenceType }};AbstractionsPackageVersion=${{ parameters.abstractionsPackageVersion }};LoggingPackageVersion=${{ parameters.loggingPackageVersion }};MdsPackageVersion=${{ parameters.mdsPackageVersion }};AkvProviderPackageVersion=${{ parameters.akvPackageVersion }};BuildNumber=$(Build.BuildNumber);AssemblyBuildNumber=$(assemblyBuildNumber) | |
| buildProperties: ReferenceType=${{ parameters.referenceType }};AbstractionsPackageVersion=${{ parameters.abstractionsPackageVersion }};LoggingPackageVersion=${{ parameters.loggingPackageVersion }};SqlClientPackageVersion=${{ parameters.mdsPackageVersion }};AkvProviderPackageVersion=${{ parameters.akvPackageVersion }};BuildNumber=$(Build.BuildNumber);AssemblyBuildNumber=$(assemblyBuildNumber) |
| | `AzureKeyVaultProvider` | [tools/props/Versions.props](tools/props/Versions.props) (`AkvVersionDefault`) | [AKV project file](src/Microsoft.Data.SqlClient.AlwaysEncrpypted.AzureKeyVaultProvider/src//Microsoft.Data.SqlClient.AlwaysEncrypted.AzureKeyVaultProvider.csproj) and [Directory.Packages.props](Directory.Packages.props) | | ||
| | `Microsoft.SqlServer.Server` | [tools/props/Versions.props](tools/props/Versions.props) (`SqlServerPackageVersion`) | [SqlServer project file](src/Microsoft.SqlServer.Server/Microsoft.SqlServer.Server.csproj) | |
There was a problem hiding this comment.
The AzureKeyVaultProvider row has a misspelled folder name ("AlwaysEncrpypted") and an invalid path ("src//..."). Also, the version source reference still points at tools/props/Versions.props, which was removed in this PR. Update the table entry to the correct package folder and current versioning source so the prompt remains accurate.
|
A Big YES to the last item in your checklist 🎉 |
paulmedynski
left a comment
There was a problem hiding this comment.
Loving the improvements and consolidation here - looking forward to porting this back to the release branches for a consistent experience.
A few questions and some comment typos to fix.
| -p:MdsPackageVersion=${{ parameters.mdsPackageVersion }} | ||
| -p:AkvPackageVersion=${{ parameters.akvPackageVersion }} | ||
| -p:PackageOutputPath=$(packagePath) | ||
| command: pack |
There was a problem hiding this comment.
I thought build2.proj had Pack targets...
There was a problem hiding this comment.
It does, but the pattern for the CI/PR pipelines seems to overwhelmingly be to directly build the csproj files. So rather than change the outlier (AKV Provider using build.proj) to a different outlier (AKV Provider using build2.proj), I changed it to follow the pattern for the other CI/PR pack tasks.
Please note that all of this will be obliterated as part of this semester's pipeline work :)
| configuration: '${{ parameters.buildConfiguration }}' | ||
| msbuildArguments: >- | ||
| -t:BuildAkvProvider | ||
| command: build |
There was a problem hiding this comment.
No Build target for AKV?
There was a problem hiding this comment.
Same comment as pack comment applies. Rather than move it from build.proj to build2.proj, I updated it to use the csproj directly like all the other projects in the CI/PR pipelines.
|
|
||
| pool: | ||
| name: Azure Pipelines | ||
| vmImage: ubuntu-latest |
There was a problem hiding this comment.
I believe we're supposed to use only our 1ES images. The other extensions packages are doing this wrong as well. Just FYI - we will fix this in a future PR once we have appropriate 1ES images setup.
There was a problem hiding this comment.
Well ... it's been like that since at least 2/24/26. 🤷♂️
Not sure why the entire file looks new - this was one of the commits I let the 🤖 handle.
| - name: packageName | ||
| # List of packages that the package being built with this job depends on. Each entry in the | ||
| # object should have the fields: | ||
| # * artifactName - Name of the artifact to published in a previous job that contains the desired |
There was a problem hiding this comment.
Name of the artifact pubished in a previous ...
| # Inform OneBranch that files put in this directory should be uploaded as artifacts. | ||
| ob_outputDirectory: $(PACK_OUTPUT) | ||
| # Placeholder for dependency package arguments. This will be constructed later as it depends | ||
| # on scripting to decompose parameters.dependencies. |
There was a problem hiding this comment.
parameters.dependencies.
There was a problem hiding this comment.
🤔 Isn't that what I have?
| publishSymbols: ${{ parameters.publishSymbols }} | ||
| downloadArtifacts: | ||
| dependencies: | ||
| - artifactName: '${{ parameters.loggingArtifactsName }}' |
There was a problem hiding this comment.
I like this approach - obvious and readable.
| ## Versioning | ||
|
|
||
| Versioning can be accomplished by using a mix of different parameters to the `build2.proj` targets: | ||
| `PackageVersion<TargetProject>`, `BuildNumber`, `and `BuildSuffix`. Using these in different combinations, can generate |
| ### Running Tests with Reference Type | ||
| The above documentation is the default mode of operation, and is the recommended mode for most developers. However, | ||
| `build2.proj` supports "package mode" builds. In this mode, instead of projects depending on other projects, they | ||
| depend on NuGet packages. This mode is useful for verifying that packages work witheach other, especially in automated |
| <Link>xunit.runner.json</Link> | ||
| </None> | ||
|
|
||
| <None Include="$(RepoRoot)src/Microsoft.Data.SqlClient/tests/tools/Microsoft.Data.SqlClient.TestUtilities/CodeCoverage.runsettings"> |
There was a problem hiding this comment.
Where did these copy commands go?
There was a problem hiding this comment.
Not necessary anymore, right? They got put into the build2.proj as what gets included if code coverage is turned on?
<TestCodeCoverage Condition="'$(TestCodeCoverage)' == ''">true</TestCodeCoverage>
<TestCodeCoverageArgument Condition="'$(TestCodeCoverage.ToLower())' == 'true'">
--collect "Code coverage"
--settings "$(RepoRoot)src/Microsoft.Data.SqlClient/tests/tools/Microsoft.Data.SqlClient.TestUtilities/CodeCoverage.runsettings"
</TestCodeCoverageArgument>
mdaigle
left a comment
There was a problem hiding this comment.
All the changes make sense to me. Look forward to seeing some pipeline runs.
| The above documentation is the default mode of operation, and is the recommended mode for most developers. However, | ||
| `build2.proj` supports "package mode" builds. In this mode, instead of projects depending on other projects, they | ||
| depend on NuGet packages. This mode is useful for verifying that packages work witheach other, especially in automated | ||
| build scenarios. For completeness, and debugging of autoamted builds, this section documents behavior of "package mode". |
| @@ -0,0 +1,311 @@ | |||
| # Test Guide for Microsoft.Data.SqlClient | |||
There was a problem hiding this comment.
Can we link to this from BUILDGUIDE rather than duplicating the content?
There was a problem hiding this comment.
For the sections I rewrote, yes, we have links to the TESTGUIDE.
For more
information about test procedures, including config file setup, see TESTGUIDE.md.
Manual test prerequisites and configuration are covered in TESTGUIDE.md.
For the stuff after the sections I rewrote ... well no, I didn't because I guess I figured everything after the sections I rewrote were just about managing runtime switches (which imo, doesn't seem like a great place to put them, but whatever - it's outside the scope of this PR). Since I had the 🤖 write the TESTGUIDE, I'll just tell it to include the stuff about perf testing and databases and whatever.
…r to build2.proj norms
…csproj, just like all the other projects.
Migrate the SqlClient csproj files to the same pattern as the other projects.
…ctory.Build.props
9c8cd1c to
6be4e7a
Compare
Description
This PR moves all projects in the repository to be built, tested, and packed with build2.proj. This style was pioneered with the merge project and this PR migrates all the other projects to this format. Versioning has been updated for each package as well, and explained thoroughly in BUILDGUIDE.md. A new TESTGUIDE.md has been added as well.
🤖
Testing
Local tests of build2.proj is working as intended
Non-official build pipeline is passing: https://sqlclientdrivers.visualstudio.com/ADO.Net/_build/results?buildId=148136&view=results
CI/PR pipeline validation is forthcoming.
Work to do before completing PR
[ ] Validate PR/CI pipeline
[ ] Update agent instructions
[ ] Rename build2.proj to build.proj?