[7.0] Merge | Pack Mds Target, Wire PR/CI Pipelines to Build2.proj#4110
[7.0] Merge | Pack Mds Target, Wire PR/CI Pipelines to Build2.proj#4110paulmedynski wants to merge 1 commit intorelease/7.0from
Conversation
* In progress work for pack target ... kinda working * Add config to genapi path. Remove unnecessary dependencies from genapi project * Fix generation of docs in ref project * Dump reference type specific builds Fix xml documentation file generation for implementation project * Generating a package file works!!! * Resync pipelines folder in solution * Add an assembly build number argument? ... it doesn't work * Wiring up build numbers through build2.proj * Build number argument * Maybe wiring it up?!? * Reinstate the assemblybuildnumber property * Build all of MDS, once * PR comments from copilot * Specify test results folder for CI builds * TargetFramework => TestFramework * Fixing a couple more comments * Couple more comments from copilot * downgrade back to 7.0.0 :) * I dunno, fixing some stuff, I guess. * Fix indenting * Back out changes to official pipelines * A couple more comments from CoPilot * Generate AKV documentation file during CI build ... idk why this is only a problem *now* * Comments from Copilot ... I'd love it if it could give the same comments across commits.
There was a problem hiding this comment.
Pull request overview
This PR introduces a PackMds target in build2.proj to package Microsoft.Data.SqlClient (MDS) from the new artifacts layout, and updates PR/CI pipeline steps and project files to build/test/package via build2.proj while centralizing MDS versioning.
Changes:
- Centralize MDS versioning in
src/Microsoft.Data.SqlClient/MdsVersions.propsand import it from the impl/ref/notsupported projects. - Update MDS build output paths and the MDS
.nuspecfile list to align with the newartifacts/Microsoft.Data.SqlClient/<ReferenceType>-<Configuration>/<os>/<tfm>/layout. - Rewire test/build pipeline steps to call
build2.projtargets (e.g.,TestMdsUnit,TestMdsFunctional,TestMdsManual,BuildMds) and ensure PR pipelines trigger onbuild2.projchanges.
Reviewed changes
Copilot reviewed 19 out of 19 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| tools/targets/GenerateThisAssemblyCs.targets | Defaults AssemblyFileVersion to AssemblyVersion for generated ThisAssembly metadata. |
| tools/specs/Microsoft.Data.SqlClient.nuspec | Updates file includes to the new artifacts folder structure and separates lib/ref/runtime binaries. |
| tools/props/Versions.props | Removes inlined MDS version properties in favor of MdsVersions.props. |
| tools/intellisense/TrimDocs.ps1 | Makes trimming fail-fast by throwing on missing input and stopping on errors. |
| src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlTypes/SqlVector.cs | Fixes <include> doc paths and whitespace cleanup. |
| src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlTypes/SqlJson.cs | Fixes <include> doc paths and formatting cleanup. |
| src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlDbTypeExtensions.cs | Fixes <include> doc paths for snippets. |
| src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlDataReader.cs | Fixes <include> doc paths and whitespace cleanup in comments. |
| src/Microsoft.Data.SqlClient/src/Microsoft.Data.SqlClient.csproj | Imports MdsVersions.props, enables XML docs, and changes OutputPath to include ReferenceType-Configuration. |
| src/Microsoft.Data.SqlClient/ref/Microsoft.Data.SqlClient.csproj | Imports MdsVersions.props, enables XML docs, updates OutputPath, and refines TrimDocs target conditions/inputs. |
| src/Microsoft.Data.SqlClient/ref/Microsoft.Data.SqlClient.cs | Fixes snippet include paths and minor whitespace formatting. |
| src/Microsoft.Data.SqlClient/notsupported/Microsoft.Data.SqlClient.csproj | Imports MdsVersions.props and aligns output/ref artifact paths with new layout. |
| src/Microsoft.Data.SqlClient/MdsVersions.props | New centralized MSBuild versioning logic for MDS assembly/package versions. |
| src/Microsoft.Data.SqlClient.sln | Updates solution items (adds MdsVersions.props, adjusts pipeline solution items). |
| eng/pipelines/sqlclient-pr-project-ref-pipeline.yml | Adds build2.proj to PR path filters. |
| eng/pipelines/sqlclient-pr-package-ref-pipeline.yml | Adds build2.proj to PR path filters. |
| eng/pipelines/common/templates/steps/run-all-tests-step.yml | Switches test execution from build.proj to build2.proj targets and updates property names. |
| eng/pipelines/common/templates/steps/ci-project-build-step.yml | Switches MDS build step to build2.proj/BuildMds and updates arguments passed. |
| build2.proj | Adds PackMds, expands build/test parameters, and aligns build/test targets with the new artifacts/versioning conventions. |
|
|
||
| <!-- Versioning arguments --> | ||
| $(BuildNumberArgument) | ||
| $(PacakgeVersionMdsArgument) |
There was a problem hiding this comment.
In BuildMdsNotSupported, the command uses $(PacakgeVersionMdsArgument) (typo). This property is undefined, so the PackageVersionMds override won’t be forwarded to the notsupported build, which can cause version mismatches between the notsupported/ref/impl assemblies when a package version override is supplied. Rename this to $(PackageVersionMdsArgument) so -p:MdsPackageVersion=... is passed correctly.
| $(PacakgeVersionMdsArgument) | |
| $(PackageVersionMdsArgument) |
|
|
||
| <!-- Versioning arguments --> | ||
| $(BuildNumberArgument) | ||
| $(PacakgeVersionMdsArgument) |
There was a problem hiding this comment.
In BuildMdsRef, the command uses $(PacakgeVersionMdsArgument) (typo). This means PackageVersionMds overrides won’t be forwarded to the ref build, so the ref assembly version may not match the implementation/package version when overrides are used. Rename this to $(PackageVersionMdsArgument) so -p:MdsPackageVersion=... is applied consistently.
| $(PacakgeVersionMdsArgument) | |
| $(PackageVersionMdsArgument) |
| msbuildArguments: | ||
| -t:BuildMds | ||
| -p:ReferenceType=${{ parameters.referenceType }} | ||
| -p:AbstractionsPackageVersion=${{ parameters.abstractionsPackageVersion }} | ||
| -p:LoggingPackageVersion=${{ parameters.loggingPackageVersion }} | ||
| -p:MdsPackageVersion=${{ parameters.mdsPackageVersion }} | ||
| retryCountOnTaskFailure: 1 | ||
|
|
||
| - ${{ if eq(parameters.build, 'allNoDocs') }}: | ||
| - task: MSBuild@1 | ||
| displayName: 'Build Driver (no docs) [Win]' | ||
| condition: and(succeeded(), eq(variables['Agent.OS'], 'Windows_NT')) | ||
| inputs: | ||
| solution: build.proj | ||
| msbuildArchitecture: x64 | ||
| platform: '${{ parameters.platform }}' | ||
| configuration: '${{ parameters.buildConfiguration }}' | ||
| msbuildArguments: >- | ||
| -t:BuildAllConfigurations | ||
| -p:ReferenceType=${{ parameters.referenceType }} | ||
| -p:GenerateNuget=false | ||
| -p:GenerateDocumentationFile=false | ||
| -p:BuildNumber=${{ parameters.buildNumber }} | ||
| -p:AssemblyBuildNumber=${{ parameters.assemblyBuildNumber }} | ||
| -p:AbstractionsPackageVersion=${{ parameters.abstractionsPackageVersion }} | ||
| -p:LoggingPackageVersion=${{ parameters.loggingPackageVersion }} | ||
| -p:MdsPackageVersion=${{ parameters.mdsPackageVersion }} | ||
|
|
||
| - ${{ if or(eq(parameters.build, 'MDS'), eq(parameters.build, 'all')) }}: | ||
| - task: MSBuild@1 | ||
| displayName: 'Build Driver [Win]' | ||
| condition: and(succeeded(), eq(variables['Agent.OS'], 'Windows_NT')) | ||
| inputs: | ||
| solution: build.proj | ||
| msbuildArchitecture: x64 | ||
| platform: '${{ parameters.platform }}' | ||
| configuration: '${{ parameters.buildConfiguration }}' | ||
| msbuildArguments: | ||
| -t:BuildAllConfigurations | ||
| -p:ReferenceType=${{ parameters.referenceType }} | ||
| -p:GenerateNuget=false | ||
| -p:BuildNumber=${{ parameters.buildNumber }} | ||
| -p:AssemblyBuildNumber=${{ parameters.assemblyBuildNumber }} | ||
| -p:AbstractionsPackageVersion=${{ parameters.abstractionsPackageVersion }} | ||
| -p:LoggingPackageVersion=${{ parameters.loggingPackageVersion }} | ||
| -p:MdsPackageVersion=${{ parameters.mdsPackageVersion }} | ||
| -p:BuildNumber=${{ parameters.buildNumber }} | ||
| -p:PackageVersionAbstractions=${{ parameters.abstractionsPackageVersion }} | ||
| -p:PackageVersionLogging=${{ parameters.loggingPackageVersion }} | ||
| -p:PackageVersionMds=${{ parameters.mdsPackageVersion }} |
There was a problem hiding this comment.
msbuildArguments under the MSBuild@1 task is currently written as a YAML mapping (each line contains a :), not a scalar string. Azure Pipelines expects msbuildArguments to be a string, so this will either fail YAML parsing/type validation or pass the wrong value to the task. Use a folded scalar (>-) or quote the entire argument string so the task receives a single msbuild arguments string.
Codecov Report✅ All modified and coverable lines are covered by tests.
Additional details and impacted files@@ Coverage Diff @@
## release/7.0 #4110 +/- ##
===============================================
- Coverage 73.07% 65.74% -7.34%
===============================================
Files 280 275 -5
Lines 42997 65822 +22825
===============================================
+ Hits 31422 43273 +11851
- Misses 11575 22549 +10974
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Cherry-pick of #4033 to release/7.0
Original PR Description
Description
This PR adds a PackMds target to Build2.proj that conveniently packages the MDS projects into a NuGet package. This PR also reworks the CI/PR pipelines to use the build2.proj targets to build, test, and package the MDS project.
Commentary has been added in-line.
Testing
Ran PR validation while still in draft mode and verifies that it generates good output. There are a lot of things to go through to verify that everything is behaving correctly, but it seems good.