Skip to content

build: define the package feeds as readonly variables in the product builds - #350600

Merged
Ladislau Szomoru (lszomoru) merged 1 commit into
lszomoru/agents/remove-sdk-parameters-product-buildfrom
lszomoru/agents/secure-product-build-feeds
Nov 26, 2026
Merged

Ladislau Szomoru (lszomoru) merged 1 commit into
lszomoru/agents/remove-sdk-parameters-product-buildfrom
lszomoru/agents/secure-product-build-feeds

Conversation

@lszomoru

Copy link
Copy Markdown
Member

Stacked on #350593. Review only the last commit.

Why

The product builds take the npm and Cargo feeds as free-text queue parameters, NPM_REGISTRY and CARGO_REGISTRY. A run can be queued with any feed, or with none, which also swaps the Microsoft Rust toolchain for rustup. The feeds of a product build should come from reviewed YAML only. Recent product builds left both parameters at their defaults.

What changed

product-build.yml, product-build-ado-ci.yml and sdk-validation-build.yml drop the two parameters and define both feeds as variables with readonly: true. product-build-variables.yml, which the TSA pipeline includes, does the same. product-build-ci.yml marks its existing feed variables readonly. product-build-template.yml drops the two parameters, which it never read. The azure-pipelines skill no longer lists them.

Scope

The shared setup templates keep their ne(variables['NPM_REGISTRY'], 'none') conditions, because product-copilot-recovery.yml sets none on purpose. product-smoke-flaky.yml and product-sanity-tests.yml still take an npm feed parameter. They test published builds and are unchanged here.

Tradeoffs

One shared variables template would hold the two URLs once. Inline constants keep the feeds visible in each pipeline file, as product-build-ci.yml already does.

Blast radius

Queuing any of the three pipelines with NPM_REGISTRY or CARGO_REGISTRY now fails with Unexpected parameter. The queue form no longer shows the two fields. A run with other feeds needs a YAML change on its branch.

Verification

  • Azure Pipelines preview API (POST _apis/pipelines/{id}/preview with yamlOverride, templates from main) on the new product-build.yml, sdk-validation-build.yml and product-build-ci.yml: passed. The final YAML has both feeds as readonly constants.
  • The same previews queued with NPM_REGISTRY: each fails with Unexpected parameter 'NPM_REGISTRY', as expected. The old product-build.yml, queued with NPM_REGISTRY=https://example.invalid/npm/, expanded with that feed.
  • product-build-ado-ci.yml: queued with NPM_REGISTRY it fails with Unexpected parameter. Its full preview fails on a template path outside this change, the same way with the old YAML.
  • product-build-variables.yml: a preview that includes only this template from this branch expands to the two readonly constants. The TSA pipeline itself doesn't expand on main (1ES SDL repository settings), and it fails with the same errors on this branch.
  • node --test lib/test/privilegedConnections.test.ts lib/test/mobileWebPublication.test.ts lib/test/testCheckpointTemplates.test.ts lib/test/workspaceImage.test.ts lib/test/sanityTestSelection.test.ts lib/test/windowsNetworkDiagnostics.test.ts lib/test/agentHostTestSelection.test.ts in build/: 46 passed, 1 failed. The failing test, "mobile script failures warn and stop the optional job before publishing a partial archive", fails the same way without this change.
  • Hygiene during the commit: passed.

…builds

product-build.yml, product-build-ado-ci.yml and sdk-validation-build.yml took the npm and Cargo feeds as free-text NPM_REGISTRY and CARGO_REGISTRY parameters, so a run could be queued with any feed. They now define both as readonly variables. Queuing a run with either parameter fails with "Unexpected parameter", and no step can change the feeds with task.setvariable. product-build-variables.yml does the same for the TSA pipeline, product-build-ci.yml marks its feed variables readonly, and product-build-template.yml drops the two parameters it never read.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@lszomoru
Ladislau Szomoru (lszomoru) force-pushed the lszomoru/agents/secure-product-build-feeds branch from beeb8b7 to daba1ab Compare November 26, 2026 22:01
@lszomoru
Ladislau Szomoru (lszomoru) merged commit 04bcde1 into lszomoru/agents/remove-sdk-parameters-product-build Nov 26, 2026
1 check passed
@lszomoru
Ladislau Szomoru (lszomoru) deleted the lszomoru/agents/secure-product-build-feeds branch November 26, 2026 22:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant