Skip to content

Pipelines | Pre-compute all OneBranch package and file versions - #4652

Open
paulmedynski wants to merge 4 commits into
dev/paul/apiscan-package-configfrom
dev/paul/onebranch-version-cleanup
Open

Pipelines | Pre-compute all OneBranch package and file versions#4652
paulmedynski wants to merge 4 commits into
dev/paul/apiscan-package-configfrom
dev/paul/onebranch-version-cleanup

Conversation

@paulmedynski

@paulmedynski paulmedynski commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

Makes 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

Package versions had two mutually exclusive shapes. The revision shape (7.1.0.34430-preview1) is gone, along with the 16-bit wrapping of Build.BuildId, the four-part package base special case in both Versions.props files, and the addRevision queue-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-preview1 outranked 7.1.0 on the feed, and a four-part core with a prerelease tag isn't valid SemVer 2.0.

Move package version stamping 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 the declared version or the suffix, is stamped with the build number; released versions are left exactly as declared.

NextVersion BuildSuffix Package version
7.1.0-preview3 — (OneBranch) 7.1.0-preview3.26238.3
7.1.0 — (release branch) 7.1.0
7.1.0-preview3 ci 7.1.0-preview3-ci.26238.3
7.1.0 ci 7.1.0-ci.26238.3
— (local dev) 7.1.0-preview3-dev

⚠️ PR/CI package versions gain a dot before the build number (-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 …ci9 sorted 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_versions stage already computed. build.proj gains opt-in FileVersionSqlClient / FileVersionSqlServer arguments, which emit nothing unless set — so PR/CI and local builds are unchanged.

This also fixes a latent bug: compute-versions.ps1 invoked the GetVersions* 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.sbom reported $(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.ps1 updated and passing (8/8)

  • Version shapes verified against build.proj GetVersions* for prerelease/stable bases, with and without a build suffix, and for the explicit-package-version path

  • Confirmed -p:SqlClientFileVersion= overrides the Versions.props computation and that assembly version still derives from it

  • Non-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

Copilot AI balanced review requested due to automatic review settings September 6, 2026 13:20
@github-project-automation github-project-automation Bot moved this to To triage in SqlClient Board Sep 6, 2026

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

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.

Comment thread src/Microsoft.Data.SqlClient/Versions.props
Comment thread eng/pipelines/onebranch/scripts/tests/compute-versions.Tests.ps1
@paulmedynski paulmedynski added this to the 7.1.0 milestone Sep 6, 2026
@paulmedynski paulmedynski added the Area\Engineering Use this for issues that are targeted for changes in the 'eng' folder or build systems. label Sep 6, 2026
@paulmedynski paulmedynski moved this from To triage to In progress in SqlClient Board Sep 6, 2026
@codecov

codecov Bot commented Sep 6, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (dev/paul/apiscan-package-config@b70170c). Learn more about missing BASE report.

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           
Flag Coverage Δ
PR-SqlClient-Project 64.52% <ø> (?)

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.

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.

🔵 Needs a closer look

Broad versioning and pipeline behavior changes require final human validation.

Review details
  • Files reviewed: 20/20 changed files
  • Comments generated: 1
  • Review effort level: Balanced

Comment thread build.proj
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.
Copilot AI review requested due to automatic review settings September 6, 2026 19:05
@paulmedynski
paulmedynski force-pushed the dev/paul/onebranch-version-cleanup branch from a73ce5e to 06f14b6 Compare September 6, 2026 19:05

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.

🔵 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 updated Versions.props appends the build number to the prerelease package version, so the shown 7.1.0-preview1 output 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-308 still says BuildSuffix=ci produces 1.2.3-ci1234, while this line now produces 1.2.3-ci.1234; build.proj:511-514 also 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

Copilot AI review requested due to automatic review settings September 7, 2026 12:33
@paulmedynski
paulmedynski marked this pull request as ready for review September 7, 2026 12:33
@paulmedynski
paulmedynski requested a review from a team September 7, 2026 12:33

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

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

Comment thread src/Microsoft.Data.SqlClient/Versions.props
Comment thread src/Microsoft.SqlServer.Server/Versions.props
Copilot AI review requested due to automatic review settings September 7, 2026 13:12

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

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:308 still documents 1.2.3-ci1234, Directory.Packages.props:46 uses preview1-ci123, and .github/instructions/ado-pipelines.instructions.md:108 describes 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

Comment thread build.proj
Comment on lines +148 to +150
<FileVersionSqlClient Condition="'$(FileVersionSqlClient)' == ''" />
<FileVersionSqlClientArgument Condition="'$(FileVersionSqlClient)' != ''">
-p:SqlClientFileVersion=$(FileVersionSqlClient)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area\Engineering Use this for issues that are targeted for changes in the 'eng' folder or build systems.

Projects

Status: In progress

Development

Successfully merging this pull request may close these issues.

4 participants