Consolidate package version specification and computation#4336
Draft
paulmedynski wants to merge 3 commits into
Draft
Consolidate package version specification and computation#4336paulmedynski wants to merge 3 commits into
paulmedynski wants to merge 3 commits into
Conversation
…ions - Rename *VersionDefault -> *NextVersion in all Versions.props - Add *PublishedVersion (last shipped) to all Versions.props - Add 6 GetVersions* targets to build.proj (stdout-based extraction) - Add compute-versions-stage.yml (single job extracts all versions up-front) - Make packageVersion a required parameter in all build/pack steps - Remove BuildSuffix from pipeline variables - Wire release booleans to resolve next vs published version per package
- Add compute-versions-ci-stage.yml that extracts all package/file versions up-front using GetVersions* targets with BuildSuffix - Wire compute-versions as first stage in dotnet-sqlclient-ci-core.yml - PR pipelines pass buildSuffix='pr', CI pipelines pass buildSuffix='ci' - Each downstream stage consumes versions via stageDependencies outputs - Remove buildSuffix from ci-build-variables.yml (now a parameter) - Rename package-versions.instructions.md to 3rd-party scope - Add sqlclient-package-versions.instructions.md documenting version flow
Contributor
There was a problem hiding this comment.
Pull request overview
This PR introduces a centralized “compute versions” stage for CI/PR pipelines (mirroring the OneBranch approach) and refactors version sources so pipelines can compute/package versions once and flow them to downstream stages/jobs.
Changes:
- Added
compute_versions_cistage to extract package/file versions up-front via newGetVersions*targets inbuild.proj. - Refactored each package’s
Versions.propsto introduce*NextVersionand*PublishedVersionproperties. - Began wiring CI/PR and OneBranch pipelines/templates to consume computed versions (but the current wiring is incomplete and will break pipeline execution).
Reviewed changes
Copilot reviewed 33 out of 33 changed files in this pull request and generated 12 comments.
Show a summary per file
| File | Description |
|---|---|
| src/Microsoft.SqlServer.Server/Versions.props | Adds Published/Next version properties; updates computed package/file version logic to use SqlServerNextVersion. |
| src/Microsoft.Data.SqlClient/Versions.props | Adds Published/Next version properties; updates computed package/file version logic to use SqlClientNextVersion. |
| src/Microsoft.Data.SqlClient.Internal/Logging/src/Versions.props | Adds Published/Next version properties; updates computed package/file version logic to use LoggingNextVersion. |
| src/Microsoft.Data.SqlClient.Extensions/Azure/src/Versions.props | Adds Published/Next version properties; updates computed package/file version logic to use AzureNextVersion. |
| src/Microsoft.Data.SqlClient.Extensions/Abstractions/src/Versions.props | Adds Published/Next version properties; updates computed package/file version logic to use AbstractionsNextVersion. |
| src/Microsoft.Data.SqlClient.AlwaysEncrypted.AzureKeyVaultProvider/src/Versions.props | Adds Published/Next version properties; updates computed package/file version logic to use AkvProviderNextVersion. |
| eng/pipelines/stages/compute-versions-ci-stage.yml | New CI/PR stage that runs GetVersions* targets and exports versions as stage/job outputs. |
| eng/pipelines/stages/build-sqlserver-package-ci-stage.yml | Adds dependency on compute stage and maps its outputs to stage variables (but needs additional wiring updates). |
| eng/pipelines/stages/build-sqlclient-package-ci-stage.yml | Adds dependency on compute stage and maps its outputs to stage variables; attempts to use those versions downstream. |
| eng/pipelines/stages/build-logging-package-ci-stage.yml | Adds dependency on compute stage and maps its outputs to stage variables (but needs downstream job wiring updates). |
| eng/pipelines/stages/build-azure-package-ci-stage.yml | Adds dependency on compute stage and maps its outputs to stage variables (but downstream job calls still use template parameters). |
| eng/pipelines/stages/build-abstractions-package-ci-stage.yml | Adds dependency on compute stage and maps its outputs to stage variables (but downstream job calls still use template parameters). |
| eng/pipelines/sqlclient-pr-project-ref-pipeline.yml | Passes buildSuffix: 'pr' into the CI core template. |
| eng/pipelines/sqlclient-pr-package-ref-pipeline.yml | Passes buildSuffix: 'pr' into the CI core template. |
| eng/pipelines/dotnet-sqlclient-ci-project-reference-pipeline.yml | Passes buildSuffix: 'ci' into the CI core template. |
| eng/pipelines/dotnet-sqlclient-ci-package-reference-pipeline.yml | Passes buildSuffix: 'ci' into the CI core template. |
| eng/pipelines/dotnet-sqlclient-ci-core.yml | Adds buildSuffix parameter and injects the compute-versions stage before other stages. |
| eng/pipelines/libraries/ci-build-variables.yml | Removes previously hardcoded per-package version variables in favor of computed versions. |
| build.proj | Adds GetVersions* targets that emit labeled version lines for pipeline parsing. |
| eng/pipelines/onebranch/variables/package-variables.yml | Removes OneBranch per-package version variables; keeps artifact naming variables. |
| eng/pipelines/onebranch/stages/compute-versions-stage.yml | New OneBranch stage to compute “next/published/effective” versions and emit output variables. |
| eng/pipelines/onebranch/stages/build-stages.yml | Refactors build template to require pre-computed versions; comments out SqlClient package validation stage. |
| eng/pipelines/onebranch/stages/publish-symbols-stage.yml | Refactors parameters to require pre-computed package versions for symbol publishing. |
| eng/pipelines/onebranch/stages/release-stages.yml | Removes explicit per-version packagePath in favor of default/wildcarded publish behavior. |
| eng/pipelines/onebranch/jobs/build-buildproj-job.yml | Threads “pre-computed version” concept through build/pack steps; tweaks APIScan versionNumber handling. |
| eng/pipelines/onebranch/jobs/publish-symbols-job.yml | Refactors job variables to list form; clarifies version requirement. |
| eng/pipelines/onebranch/steps/roslyn-analyzers-buildproj-step.yml | Updates comments to reflect version must be pre-computed. |
| eng/pipelines/onebranch/steps/pack-buildproj-step.yml | Updates comments to reflect version must be pre-computed. |
| eng/pipelines/onebranch/steps/build-buildproj-step.yml | Updates comments to reflect version must be pre-computed. |
| eng/pipelines/onebranch/sqlclient-official.yml | Removes passing version vars to templates (but does not yet provide new required version parameters). |
| eng/pipelines/onebranch/sqlclient-non-official.yml | Removes passing version vars to templates (but does not yet provide new required version parameters). |
| .github/instructions/sqlclient-package-versions.instructions.md | New documentation describing version resolution flow (examples need to match actual pipeline build-number format). |
| .github/instructions/3rd-party-package-versions.instructions.md | Renames/re-scopes instructions to explicitly cover third-party dependency versions. |
Comment on lines
+81
to
+85
| variables: | ||
| - name: abstractionsPackageVersion | ||
| value: $[ stageDependencies.compute_versions_ci.compute_versions_job.outputs['versions.AbstractionsPackageVersion'] ] | ||
| - name: abstractionsAssemblyFileVersion | ||
| value: $[ stageDependencies.compute_versions_ci.compute_versions_job.outputs['versions.AbstractionsFileVersion'] ] |
Comment on lines
+77
to
+80
| variables: | ||
| - name: sqlServerPackageVersion | ||
| value: $[ stageDependencies.compute_versions_ci.compute_versions_job.outputs['versions.SqlServerPackageVersion'] ] | ||
|
|
Comment on lines
+100
to
+104
| - name: mdsPackageVersion | ||
| value: $[ stageDependencies.compute_versions_ci.compute_versions_job.outputs['versions.SqlClientPackageVersion'] ] | ||
| - name: akvPackageVersion | ||
| value: $[ stageDependencies.compute_versions_ci.compute_versions_job.outputs['versions.AkvProviderPackageVersion'] ] | ||
| - name: loggingPackageVersion |
Comment on lines
+170
to
+174
| # Package versions from compute-versions stage. | ||
| - name: azurePackageVersion | ||
| value: $[ stageDependencies.compute_versions_ci.compute_versions_job.outputs['versions.AzurePackageVersion'] ] | ||
| - name: azureAssemblyFileVersion | ||
| value: $[ stageDependencies.compute_versions_ci.compute_versions_job.outputs['versions.AzureFileVersion'] ] |
Comment on lines
+82
to
+86
| - name: loggingPackageVersion | ||
| value: $[ stageDependencies.compute_versions_ci.compute_versions_job.outputs['versions.LoggingPackageVersion'] ] | ||
| - name: loggingAssemblyFileVersion | ||
| value: $[ stageDependencies.compute_versions_ci.compute_versions_job.outputs['versions.LoggingFileVersion'] ] | ||
|
|
Comment on lines
+131
to
+135
| # Compute all package versions up-front. Downstream stages consume these via | ||
| # stage dependency output variables (e.g. $(loggingPackageVersion)). | ||
| - template: /eng/pipelines/stages/compute-versions-ci-stage.yml@self | ||
| parameters: | ||
| buildSuffix: ${{ parameters.buildSuffix }} |
Comment on lines
+7
to
11
| # Variables for PR and CI pipelines. Package versions are computed by each project's | ||
| # Versions.props using BuildNumber + buildSuffix. No per-package version variables are needed. | ||
| # The buildSuffix itself is set by each pipeline via the core template parameter. | ||
|
|
||
| variables: |
- Add compute-versions-stage.yml invocation to official and non-official OneBranch pipelines, passing release* parameters - Add dependsOn: compute_versions and stage-level variables to all build stages in build-stages.yml (resolves versions from stageDependencies) - Add dependsOn: compute_versions and stage-level variables to publish-symbols-stage.yml - Give version parameters default values of $(variableName) so they resolve at runtime from stage variables when not passed explicitly - Fix BuildNumber format in docs: use $(Rev:rr) (e.g. 15401) instead of incorrect 20250602.1 format - Add comment on name: explaining 16-bit int FileVersion constraint
10 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Introduces canonical version infrastructure with centralized, pre-computed package versions for all pipeline types (OneBranch official, CI, and PR).
Motivation
Previously, version computation was scattered:
This PR creates a single source of truth for versions (
Versions.propsper project) and a uniform extraction pattern across all pipeline types.Changes
Version Infrastructure (Versions.props)
*VersionDefault→*NextVersionin all 6Versions.propsfiles (SqlClient, Abstractions, Logging, Azure, AKV Provider, SqlServer)*PublishedVersion(last shipped version) to allVersions.props— used for dependency-only packages in official buildsPackageVersionparameter (CI/OneBranch pass this)BuildNumber+ optionalBuildSuffix→ prerelease tag-devsuffix (local developer builds)build.proj — GetVersions Targets
GetVersions{Label}targets that emitPackageVersion:andFileVersion:to stdoutBuildNumber,BuildSuffix, andIsReleasing{Label}parametersOneBranch Pipeline (Official)
eng/pipelines/onebranch/stages/compute-versions-stage.yml— single fast stage extracts all versions up-frontbuild-stages.yml— consumes versions from compute-versions stage viastageDependenciesoutputsbuild-buildproj-job.yml,pack-buildproj-step.yml,build-buildproj-step.yml— acceptpackageVersionas required parameterpackage-variables.yml— removed hardcoded version values (now computed dynamically)publish-symbols-stage.yml/publish-symbols-job.yml— accept version parametersCI/PR Pipeline
eng/pipelines/stages/compute-versions-ci-stage.yml— fast stage runsGetVersions*withBuildSuffixdotnet-sqlclient-ci-core.yml— addedbuildSuffixparameter, wired compute-versions as first stagecompute_versions_citodependsOn, defined stage-level variables from outputsbuildSuffix: 'pr', CI pipelines passbuildSuffix: 'ci'ci-build-variables.yml— removed version variables (now computed dynamically)Documentation
package-versions.instructions.md→3rd-party-package-versions.instructions.md(scoped to external deps)sqlclient-package-versions.instructions.md— comprehensive guide to version resolution across all scenariosVersion Differentiation
-dev7.1.0-preview1-dev-pr7.1.0-preview1-pr20250602.1-ci7.1.0-preview1-ci20250602.17.1.0-preview1Architecture
Verification
-cisuffixed versions-prsuffixed versionsdotnet buildstill produces-devversions