Pipelines | Pre-compute all OneBranch package and file versions - #4652
Pipelines | Pre-compute all OneBranch package and file versions#4652paulmedynski wants to merge 4 commits into
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
Stable test-feed publishing can collide, and the moved version-shape logic lacks required automated coverage.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
Centralizes OneBranch package/file version computation and corrects per-package SBOM metadata.
Changes:
- Removes revision-based versioning and standardizes SemVer stamping.
- Passes precomputed file versions through build and packaging jobs.
- Configures per-package SBOM identities and updates documentation/tests.
File summaries
| File | Review |
|---|---|
src/Microsoft.SqlServer.Server/Versions.props |
Standardizes SqlServer version generation. |
src/Microsoft.Data.SqlClient/Versions.props |
Critical: Stable test-feed versions can collide on repeated publishes; retain exact production versions while making test releases build-specific. |
eng/pipelines/onebranch/variables/package-variables.yml |
Removes obsolete versioning guidance. |
eng/pipelines/onebranch/steps/roslyn-analyzers-buildproj-step.yml |
Passes precomputed file versions to analysis builds. |
eng/pipelines/onebranch/steps/pack-buildproj-step.yml |
Passes file versions during packaging. |
eng/pipelines/onebranch/steps/build-buildproj-step.yml |
Passes file versions during builds. |
eng/pipelines/onebranch/stages/compute-versions-stage.yml |
Simplifies canonical version computation. |
eng/pipelines/onebranch/stages/build-stages.yml |
Distributes computed versions to package jobs. |
eng/pipelines/onebranch/sqlclient-official.yml |
Removes revision mode and fixes SBOM metadata. |
eng/pipelines/onebranch/sqlclient-non-official.yml |
Mirrors official-pipeline version and SBOM changes. |
eng/pipelines/onebranch/scripts/tests/compute-versions.Tests.ps1 |
Moderate: Add automated GetVersionsSqlClient and GetVersionsSqlServer coverage for stable/prerelease bases, with and without BuildSuffix. |
eng/pipelines/onebranch/scripts/compute-versions.ps1 |
Emits canonical package and file versions. |
eng/pipelines/onebranch/jobs/publish-symbols-job.yml |
Disables irrelevant SBOM generation. |
eng/pipelines/onebranch/jobs/build-buildproj-job.yml |
Sets package-specific SBOM metadata. |
build.proj |
Adds file-version forwarding parameters. |
.github/instructions/sqlclient-package-versions.instructions.md |
Documents the new version shapes. |
.github/instructions/onebranch-pipeline-design.instructions.md |
Documents per-job SBOM configuration. |
Review details
- Files reviewed: 17/17 changed files
- Comments generated: 2
- Review effort level: 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 @@
## dev/paul/apiscan-package-config #4652 +/- ##
==================================================================
Coverage ? 64.52%
==================================================================
Files ? 284
Lines ? 67967
Branches ? 0
==================================================================
Hits ? 43858
Misses ? 24109
Partials ? 0
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:
|
Make the compute-versions stage the single source of every version the OneBranch build jobs consume, so nothing is re-derived downstream. - Remove the addRevision mode entirely. Package versions now have a single shape driven by the pipeline build number, and the 16-bit revision wrapping, the four-part package base handling, and the Build.BuildId plumbing are gone. - Move package version stamping out of PowerShell and into Versions.props. BuildSuffix now does what it always documented: it turns a stable base into a prerelease. Any version carrying a prerelease tag, from either source, is stamped with the build number; released versions are left untouched. - Publish SqlClient and SqlServer file versions from the compute-versions stage and pass them into the build jobs, which previously received a raw build number and re-derived the file version through MSBuild. build.proj gains opt-in FileVersion* arguments, so PR/CI and local builds are unchanged. - Fix SBOM metadata, which reported the pipeline run number as the version of a single hardcoded package name. Each build job now supplies the name and computed version of the package it produces, and jobs that publish no packages disable SBOM generation instead.
a73ce5e to
06f14b6
Compare
There was a problem hiding this comment.
🔵 Needs a closer look
Pipeline-wide versioning changes require human approval, and outdated version examples remain unresolved.
Review details
Suppressed comments (2)
build.proj:519
- The usage example immediately above this target is now outdated: with
BuildNumber=1234, the updatedVersions.propsappends the build number to the prerelease package version, so the shown7.1.0-preview1output is no longer possible. Update the example to reflect the new target output.
<_Cmd>"$(DotnetPath)dotnet" build "$(SqlClientProjectPath)" -getProperty:SqlClientPackageVersion $(BuildNumberArgument) $(BuildSuffixArgument) $(SqlClientNextVersionArgument)</_Cmd>
src/Microsoft.Data.SqlClient/Versions.props:78
- The new dot-separated prerelease shape is not reflected in the public build documentation.
BUILDGUIDE.md:302-308still saysBuildSuffix=ciproduces1.2.3-ci1234, while this line now produces1.2.3-ci.1234;build.proj:511-514also still shows a prerelease version without the appended build number. Please update these canonical examples with the behavior change so contributors can predict the generated artifact names.
<SqlClientPackageVersion Condition="$(_SqlClientCandidateVersion.Contains('-'))">$(_SqlClientCandidateVersion).$(BuildNumber)</SqlClientPackageVersion>
- Files reviewed: 18/18 changed files
- Comments generated: 0 new
- Review effort level: Balanced
There was a problem hiding this comment.
🟡 Changes recommended
Explicit four-component package-version overrides currently generate invalid five-component file versions.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Review details
- Files reviewed: 18/18 changed files
- Comments generated: 2
- Review effort level: Balanced
There was a problem hiding this comment.
🟡 Changes recommended
The new build and pack wrapper forwarding lacks direct regression coverage.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Review details
Suppressed comments (1)
Previously missed (1) — in code that hasn't changed since the last review.
src/Microsoft.Data.SqlClient/Versions.props:79
- The new separator leaves the repository's versioning documentation inconsistent with the implementation:
BUILDGUIDE.md:308still documents1.2.3-ci1234,Directory.Packages.props:46usespreview1-ci123, and.github/instructions/ado-pipelines.instructions.md:108describes a different old ordering. Since this changes every PR/CI package version, update those references to the new-ci.<BuildNumber>/-pr.<BuildNumber>shape in this PR.
- Files reviewed: 18/18 changed files
- Comments generated: 1
- Review effort level: Balanced
| <FileVersionSqlClient Condition="'$(FileVersionSqlClient)' == ''" /> | ||
| <FileVersionSqlClientArgument Condition="'$(FileVersionSqlClient)' != ''"> | ||
| -p:SqlClientFileVersion=$(FileVersionSqlClient) |
Makes the
compute_versionsstage the single source of every version the OneBranch build jobs consume, so nothing is re-derived downstream.Remove the
addRevisionmodePackage versions had two mutually exclusive shapes. The revision shape (
7.1.0.34430-preview1) is gone, along with the 16-bit wrapping ofBuild.BuildId, the four-part package base special case in bothVersions.propsfiles, and theaddRevisionqueue-time parameter.Worth noting the shape it removes was also a versioning hazard: a four-part core sorts above the stable release, so
7.1.0.34430-preview1outranked7.1.0on the feed, and a four-part core with a prerelease tag isn't valid SemVer 2.0.Move package version stamping into
Versions.propsBuildSuffixnow does what it always documented — it turns a stable base into a prerelease. Any version carrying a prerelease tag, from either the declared version or the suffix, is stamped with the build number; released versions are left exactly as declared.NextVersionBuildSuffix7.1.0-preview37.1.0-preview3.26238.37.1.07.1.07.1.0-preview3ci7.1.0-preview3-ci.26238.37.1.0ci7.1.0-ci.26238.37.1.0-preview3-dev-ci26238.3→-ci.26238.3), because the old suffix path fused them. This is a deliberate improvement: SemVer splits the prerelease on dots, so the build number now compares numerically instead of lexically (previously…ci9sorted above…ci10). No in-repo consumer string-matches the old form.Pass pre-computed file versions into the build jobs
Build jobs received a raw build number and re-derived the file version through MSBuild. They now receive the file version the
compute_versionsstage already computed.build.projgains opt-inFileVersionSqlClient/FileVersionSqlServerarguments, which emit nothing unless set — so PR/CI and local builds are unchanged.This also fixes a latent bug:
compute-versions.ps1invoked theGetVersions*targets with a different build number than the build jobs used, then discarded the result and re-derived it in PowerShell.Assembly version stays derived from the file version, as it's always
major.0.0.0.Fix SBOM metadata
globalSdl.sbomreported$(Build.BuildNumber)(e.g.26238.3) as the version of a single hardcoded package name — a version matching no package produced, and used a single name for six different packages. Now it expands the SDL template with macro-expansion variables$(...)whose values are defined by each package's build job, and then interpolated for SBOM use. We are now using consistent package name/version values in each package's SBOM.Testing
compute-versions.Tests.ps1updated and passing (8/8)Version shapes verified against
build.projGetVersions*for prerelease/stable bases, with and without a build suffix, and for the explicit-package-version pathConfirmed
-p:SqlClientFileVersion=overrides theVersions.propscomputation and that assembly version still derives from itNon-official OneBranch run 26250.2 succeeded; all build/pack stages consumed the expected package and file versions
Tests added or updated
Public API changes documented — n/a
Ensure no breaking changes introduced — PR/CI prerelease separator change noted above