Versioning script follow-ups deferred from #4602
- Dominant language
- C#
- Stars
- 989
- Forks
- 340
- Avg merge
- 4d 19h
- Merged PRs (30d)
- 72
Description
Splitting these out of #4602 so that PR stays scoped to restoring the preview2 package and file version convention for the 7.1.0-preview3 release. None of these block the release; all came up during review of that PR.
### 1. Decide whether the `addRevision: true` version shape should exist
`compute-versions.ps1` supports a second shape, `1.2.3.-previewX`, selected by the `addRevision` pipeline parameter. It stamps the build ID in as the fourth numeric component so repeated publishes of the same base version get distinct package versions, which NuGet requires.
Raised by @cheenamalhotra in https://github.com/dotnet/SqlClient/pull/4602#discussion_r3865793744.
Current usage, across the last 100 runs of each pipeline:
| Pipeline | Runs with `addRevision: true` |
| --- | --- |
| `sqlclient-official` (def 2241) | 0 |
| `sqlclient-non-official` (def 2240) | 7 |
Both pipelines default it to `false` (`sqlclient-official.yml` L41-44, `sqlclient-non-official.yml` L33-36), and it has never been used on an official build. Six of the seven non-official runs were on 2026-08-07, while #4336 was in development.
If it is dropped, we need an answer for how test-feed republishing of an unchanged base version works instead. Worth @paulmedynski weighing in since it arrived with #4336.
### 2. Nothing in CI runs the versioning Pester tests
`eng/pipelines/onebranch/scripts/tests/` is never executed anywhere. There is no pipeline stage, GitHub workflow, or `build.proj` target referencing it — the only reference in the repo is the tests' own README.
Two things need fixing together:
- Wire the suite into CI.
- Pin Pester to 5.x. The README says `-MinimumVersion 5.0`, which now resolves to 6.x, and 6.x fails both test files at discovery with `InvalidOperationException: A 'break' or 'continue' statement with a label that does not match any enclosing loop escaped from your code` (pester/Pester#2669).
Also worth noting `compute-versions.Tests.ps1` uses the three-argument form of `Join-Path`, which is PowerShell 6+ only, so the suite needs `pwsh` rather than Windows PowerShell 5.1.
### 3. `Get-CanonicalVersions` passes a build number that cannot apply
`compute-versions.ps1` passes `-p:BuildNumber=$wrappedRevision` to the `GetVersions` targets unconditionally, including when `AddRevision` is `$false`. It is harmless today because `BuildSuffix` is empty on that path so `Versions.props` ignores it, but the call reads as though the revision is in play when it is not. Left alone in #4602 to keep that diff minimal.
Contributor guide
Research direction
Start with compute-versions.ps1, compute-versions.Tests.ps1, and the README under eng/pipelines/onebranch/scripts/tests/. Inspect sqlclient-official.yml, sqlclient-non-official.yml, and build.proj for existing CI entry points, then run the suite with pwsh and Pester 5.x. Done means the addRevision behavior is decided, the tests run reliably in CI, and the BuildNumber argument is handled consistently.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- powershell
- Domain
- build-system, ci-cd
- Issue type
- Refactor
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100