Skip to content

Generalize BCS upload + register-build templates with repoName parameter#5241

Merged
LoopedBard3 merged 5 commits into
dotnet:mainfrom
LoopedBard3:loopedbard3/generalize-upload-template
Jun 12, 2026
Merged

Generalize BCS upload + register-build templates with repoName parameter#5241
LoopedBard3 merged 5 commits into
dotnet:mainfrom
LoopedBard3:loopedbard3/generalize-upload-template

Conversation

@LoopedBard3

@LoopedBard3 LoopedBard3 commented Jun 11, 2026

Copy link
Copy Markdown
Member

Make the build registration and upload steps generalized by repo for the BuildCacheService so that we can manage the steps in the dotnet/performance repo instead of requiring each setup we end up with having to duplicate the work. This keeps the defaults to runtime so that the runtime ymls continue working.

AI Summary:
Companion to a forthcoming dotnet/aspnetcore PR (LoopedBard3/aspnetcore#2 in fork-staging) that wires aspnetcore per-commit perf builds into BCS using the templates this PR generalizes.

Why

Today the BCS-upload templates in eng/pipelines/ are hard-tied to dotnet/runtime: both templates/upload-build-artifacts-job.yml and templates/register-build-job.yml write to literal builds/runtime/... blob paths. To let dotnet/aspnetcore (and any future tenant) consume the same primitives — and produce a BCS layout that's uniform with runtime's, so a single dashboard / cleanup tool / future indexer code path can serve both — we just need to parameterize the path prefix.

What changes

eng/pipelines/templates/upload-build-artifacts-job.yml (per-artifact upload primitive):

  • Adds repoName (default 'runtime', back-compat for existing runtime callers).
  • Replaces both occurrences of literal builds/runtime/ with builds/${{ parameters.repoName }}/.

eng/pipelines/templates/register-build-job.yml (per-config buildInfo.json marker):

  • Adds repoName (default 'runtime').
  • Replaces literal builds/runtime/ with builds/${{ parameters.repoName }}/.

eng/pipelines/upload-build-artifacts-jobs.yml and eng/pipelines/register-build-jobs.yml (dispatchers):

  • Forward repoName into each per-config invocation.
  • The upload dispatcher additionally gains 5 new dispatch cases for the aspnetcore configKeys (aspnetcore_{x64,arm64}_linux + aspnetcore_{x64,arm64,x86}_windows), each depending on the corresponding Windows_build / Linux_x64_build / Linux_arm64_build job that the aspnetcore perf-build defines via default-build.yml@self. (RegisterBuild's dispatcher is buildType-agnostic by construction so it needs no new cases.)

What we deliberately did NOT add

  • No poolName / poolImage / poolOs params. An earlier draft of this PR added optional pool params to the upload leaf so a 1ES.Official-extending tenant could declare a per-job pool (1ES requires every job to have one). aspnetcore's caller in Add Status Tracking Jobs #2 dropped 1ES.Official to match runtime's plain non-1ES shape (private cache content, not signed/redistributed), so no current or planned tenant needs them. Removed to keep the surface area minimal; if a future 1ES tenant ever lands, re-adding the params is ~10 lines of YAML.
  • No runtimeRepoAlias / mauiFramework cleanup. Both are pre-existing dead params on the upload dispatcher. Cleanup is split into a separate small PR (Clean up unused parameter and stray escape in upload template #5242) to keep this one focused on generalization.

Validation

Why a single shared template (not a fork)

Earlier plan iterations considered duplicating the upload logic in dotnet/aspnetcore. After reading runtime's actual perf-build.yml structure, it's clear runtime ALREADY consumes a thin-wrapper-from-dotnet-performance architecture (register-build-jobs.yml@performance, runtime-perf-build-jobs.yml@performance, upload-build-artifacts-jobs.yml@performance). Generalizing the existing primitives instead of forking keeps a single source of truth for the BCS contract, and means future BCS-shape changes land once for all tenants.

Sequencing

This PR must merge upstream before the aspnetcore perf-build pipeline can run end-to-end — the aspnetcore-side YAML resolves the templates via @performance (= internal/dotnet-performance AzDO mirror), which only updates after dotnet/performance's main branch advances.

* Add repoName parameter (defaults to 'runtime' for back-compat) that
  controls the {repoName} segment of the BCS blob path. Lets
  non-runtime perf-build pipelines (starting with dotnet/aspnetcore)
  upload to builds/{repoName}/buildArtifacts/{sha}/{configKey}/{file}.

* Add optional poolName/poolImage/poolOs parameters to
  templates/upload-build-artifacts-job.yml. The historical runtime
  callsite passes none, preserving the old behavior; pipelines
  extending 1ES.Official (which requires every job to declare a pool)
  pass them explicitly.

* Add 5 aspnetcore dispatch cases to upload-build-artifacts-jobs.yml
  for aspnetcore_{x64,arm64}_linux and aspnetcore_{x64,arm64,x86}_windows.
  dependencyJobName values match the jobName declared in the corresponding
  dotnet/aspnetcore perf-build.yml; artifactName values match the artifact
  `name:` published by those build jobs.

The dotnet/runtime perf-build.yml callsite needs no changes:
repoName defaults to 'runtime' and no pool* parameters are passed.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

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.

Pull request overview

Generalizes the build-artifacts upload pipeline templates so multiple repositories/tenants (e.g., dotnet/aspnetcore) can upload to tenant-specific BCS paths and (optionally) declare explicit agent pools required by 1ES.Official-based pipelines.

Changes:

  • Add repoName parameter to route uploads to builds/{repoName}/buildArtifacts/... (defaulting to runtime for back-compat).
  • Add optional poolName / poolImage / poolOs parameters and conditionally emit a pool: block.
  • Add new dispatcher cases for aspnetcore build types (linux/windows, multiple architectures) that invoke the per-artifact upload job.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
eng/pipelines/upload-build-artifacts-jobs.yml Adds repoName and optional pool parameters, forwards them to per-artifact jobs, and introduces aspnetcore dispatch cases.
eng/pipelines/templates/upload-build-artifacts-job.yml Adds repoName and optional pool support; updates BCS upload path to use repoName.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread eng/pipelines/templates/upload-build-artifacts-job.yml Outdated
Comment thread eng/pipelines/templates/upload-build-artifacts-job.yml Outdated
@LoopedBard3 LoopedBard3 self-assigned this Jun 11, 2026
Mirrors the repoName parameterization added to upload-build-artifacts-job.yml
in the prior commit. Aspnetcore (and any other future tenant) needs its
per-configKey buildInfo.json markers to land under builds/aspnetcore/...
to match the layout written by the upload primitive — otherwise crank/UI
tooling that reads buildInfo.json would have to special-case the path.

Defaults to 'runtime' so the existing dotnet/runtime perf-build callsite
is unaffected.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@LoopedBard3 LoopedBard3 changed the title [Draft] Generalize upload-build-artifacts-job.yml for multi-tenant BCS uploads [Draft] Generalize BCS upload + register-build templates with repoName parameter Jun 11, 2026
…s-job.yml

The original 'Generalize upload-build-artifacts-job.yml for multi-tenant
BCS uploads' commit (a8e0454) inadvertently pasted the entire upload
steps block (checkout / download / each fileName / az storage blob upload)
twice. Without this fix every per-artifact upload job would download the
same pipeline artifact twice and run 'az storage blob upload' twice
(--overwrite true so the second upload would no-op or stomp the first,
both wasteful and confusing in build logs).

Bisecting / cleanup tools that count expected upload steps per build
would also report misleading numbers.

Drops 15 duplicate lines. No behavioral change vs. the intended
single-upload-per-artifact contract that runtime's pipeline relies on
today.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings June 11, 2026 23:15

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.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

Comment thread eng/pipelines/templates/upload-build-artifacts-job.yml Outdated
When upload-build-artifacts-job.yml was first generalized in a8e0454,
I added optional poolName/poolImage/poolOs params + a conditional
`${{ if parameters.poolName }}: pool:` clause anticipating that the
aspnetcore perf-build would extend 1ES.Official and therefore need
each upload job to declare its own pool (1ES.Official requires it).

That requirement is gone: aspnetcore's perf-build.yml no longer extends
1ES.Official — it matches dotnet/runtime's plain non-1ES shape, since
these per-commit BCS uploads are private cache content (not signed or
redistributed). Neither current caller passes pool params:

  * dotnet/runtime/eng/pipelines/performance/perf-build.yml
    -> passes runtimeRepoAlias, performanceRepoAlias, buildType only.
  * dotnet/aspnetcore/.azure/pipelines/perf-build.yml
    -> passes performanceRepoAlias, repoName, buildType only.

With no caller setting poolName, the `${{ if parameters.poolName }}`
clause always evaluates false, so the generated YAML is identical to
what we'd produce without the clause. Removing the params and the
clause is a pure refactor.

Net change in this commit:
  * upload-build-artifacts-job.yml: -17 lines (param block + pool
    conditional)
  * upload-build-artifacts-jobs.yml: -79 lines (param block + 3
    passthrough lines x 23 dispatch cases)

If a future tenant ever needs 1ES.Official, re-adding these is a few
lines of YAML and a one-line caller update — cheap to bring back.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@LoopedBard3 LoopedBard3 marked this pull request as ready for review June 11, 2026 23:44

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.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated no new comments.

@LoopedBard3 LoopedBard3 changed the title [Draft] Generalize BCS upload + register-build templates with repoName parameter Generalize BCS upload + register-build templates with repoName parameter Jun 11, 2026
DrewScoggins
DrewScoggins previously approved these changes Jun 12, 2026

@DrewScoggins DrewScoggins left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@DrewScoggins DrewScoggins left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@LoopedBard3 LoopedBard3 merged commit d0304ac into dotnet:main Jun 12, 2026
3 of 75 checks passed
@LoopedBard3 LoopedBard3 deleted the loopedbard3/generalize-upload-template branch June 12, 2026 17:58
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.

3 participants