Pipelines | Use per-package APIScan name/version pairs - #4637
Pipelines | Use per-package APIScan name/version pairs#4637paulmedynski wants to merge 2 commits into
Conversation
Each of our NuGet packages is now registered with APIScan under its own name/version pair, so stop attributing every scan to a single global Microsoft.Data.SqlClient / 6.10 registration. - Reinstate the per-job ob_sdl_apiscan_softwareName and ob_sdl_apiscan_versionNumber variables in build-buildproj-job, driven by packageFullName and a new apiScanSoftwareVersion parameter. - Remove softwareName/versionNumber from the globalSdl.apiscan blocks so the build job template is the single place the pair is specified. - Replace ApiScanSoftwareVersion with ApiScanVersionSqlClient (7.1, this branch targets the 7.1.0 release) and ApiScanVersionSqlServer (1.0). - Disable APIScan on validate-signed-package-job, which produces no assemblies and previously relied on the global registration. - Update the SDL section of the OneBranch pipeline design instructions.
There was a problem hiding this comment.
🔵 Needs a closer look
Correctness depends on external APIScan registrations and a successful OneBranch validation run.
Pull request overview
Updates OneBranch pipelines to attribute APIScan results to each NuGet package’s registered name/version pair.
Changes:
- Adds per-package APIScan names and versions to build jobs.
- Removes global APIScan identity settings and disables scanning for package validation.
- Updates OneBranch pipeline documentation.
File summaries
| File | Description |
|---|---|
eng/pipelines/onebranch/variables/onebranch-variables.yml |
Defines SqlClient and SqlServer APIScan versions. |
eng/pipelines/onebranch/stages/build-stages.yml |
Passes registration versions to all package builds. |
eng/pipelines/onebranch/sqlclient-official.yml |
Removes the global APIScan identity. |
eng/pipelines/onebranch/sqlclient-non-official.yml |
Removes the global APIScan identity. |
eng/pipelines/onebranch/jobs/validate-signed-package-job.yml |
Disables APIScan for the validation-only job. |
eng/pipelines/onebranch/jobs/build-buildproj-job.yml |
Configures each build job’s APIScan identity. |
.github/instructions/onebranch-pipeline-design.instructions.md |
Documents the per-package configuration. |
Review details
- Files reviewed: 7/7 changed files
- Comments generated: 0
- Review effort level: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| # quoted value directly through an Azure template expression perturbs '6.10' to the number 6.1. | ||
| - name: ApiScanSoftwareVersion | ||
| value: '6.10' | ||
| # APIScan registration versions. Each package is registered with APIScan under its own |
There was a problem hiding this comment.
Can we use the same version number variables instead? That will push us to register the new versioned products before we can update product versions.
There was a problem hiding this comment.
🟡 Changes recommended
The default SqlServer build derives APIScan version 1.1, conflicting with the documented registered 1.0 pair.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Review details
- Files reviewed: 9/9 changed files
- Comments generated: 1
- Review effort level: Balanced
Description
Each of our NuGet packages is now registered with APIScan under its own name/version pair, so this stops attributing every scan to the single global
Microsoft.Data.SqlClient/6.10registration.ob_sdl_apiscan_softwareNameandob_sdl_apiscan_versionNumbervariables inbuild-buildproj-job.yml. The name comes from the existingpackageFullNameparameter (already constrained to exactly the registered names); the version comes from a new requiredapiScanSoftwareVersionparameter passed frombuild-stages.yml.softwareName/versionNumberfrom theglobalSdl.apiscanblocks in both the official and non-official pipelines, so the build job template is the single place the pair is specified.ApiScanSoftwareVersionvariable withApiScanVersionSqlClient(7.1) andApiScanVersionSqlServer(1.0). This branch targets the 7.1.0 release. These stay runtime$(...)references because a template expression coerces a quoted version to a number, which would turn'1.0'into1(the same failure mode that previously turned'6.10'into6.1).validate-signed-package-job. It is a Windows job that installs and inspects an already-built package, produces no assemblies, and was silently relying on the global registration that no longer exists.break: false"pending package registration" and listed the wrong APIScan folder paths.Name/version pairs reported by this branch:
Microsoft.Data.SqlClientMicrosoft.Data.SqlClient.Internal.LoggingMicrosoft.Data.SqlClient.Extensions.AbstractionsMicrosoft.Data.SqlClient.Extensions.AzureMicrosoft.Data.SqlClient.AlwaysEncrypted.AzureKeyVaultProviderMicrosoft.SqlServer.ServerThe APIScan version tracks the major.minor of each package's NuGet version, so a new pair must be registered with APIScan before we release a new major.minor.
Issues
Implements the
main(7.1) portion of AB#46589 — Register new APIScan name/version pairs.The remaining branches are tracked separately and are not covered here:
release/7.0release/6.1Testing
Pipeline-only change; there is no product code to unit test.
Validated with a full non-official OneBranch run against this branch: sqlclient-non-official 26246.1 — succeeded, all stages green, no failed records.
All six build jobs ran
🛡 Guardian: APIScanand passed the expected registered pair:--software-name--software-versionMicrosoft.Data.SqlClient7.1Microsoft.Data.SqlClient.Internal.Logging7.1Microsoft.Data.SqlClient.Extensions.Abstractions7.1Microsoft.Data.SqlClient.Extensions.Azure7.1Microsoft.Data.SqlClient.AlwaysEncrypted.AzureKeyVaultProvider7.1Microsoft.SqlServer.Server1.0Notably
Microsoft.SqlServer.Serverpassed--software-version 1.0, not1, confirming the runtime$(...)indirection prevents the numeric coercion that would otherwise produce an unregistered pair.Scan coverage is as intended: the six build jobs scanned, and the four jobs that produce no assemblies (version extraction, SDL sources analysis, agentless tag, finalize build) did not, so removing the global name/version left nothing unattributed. Each job also picked up its own
apiScan/<package>/dllsand/pdbsfolders.Also verified locally that all modified YAML parses and that no references to the removed
ApiScanSoftwareVersionvariable remain.Not covered by this run:
validate-signed-package-jobdoes not execute in the non-official pipeline (there is nothing signed to validate), so theob_sdl_apiscan_enabled: falseadded there is untested. It mirrors the existingpublish-symbols-jobpattern, but it only takes effect on the official pipeline and would benefit from a reviewer's eye or an official dry run.