Skip to content

ci(pipeline): add package build to Control Tower integration#17116

Open
dmcilvaney wants to merge 3 commits intomicrosoft:tomls/base/mainfrom
dmcilvaney:damcilva/4.0/pipelines/delta_3_package_build
Open

ci(pipeline): add package build to Control Tower integration#17116
dmcilvaney wants to merge 3 commits intomicrosoft:tomls/base/mainfrom
dmcilvaney:damcilva/4.0/pipelines/delta_3_package_build

Conversation

@dmcilvaney
Copy link
Copy Markdown
Contributor

@dmcilvaney dmcilvaney commented May 10, 2026

NOTE: This will require changes on the ADO side to align with the new names.

Add a 'Submit package build to Control Tower' step that calls the /api/Scenario/package endpoint after the prcheck step succeeds. The step is gated on PR triggers so unmerged code never kicks off a build.

Naming: the pipeline now does more than source upload, so rename to reflect what it actually does (call Control Tower).

  • sources-upload.yml -> control-tower-integration.yml
  • sources-upload-stages.yml -> control-tower-integration-stages.yml
  • Stage PRCheck -> Integration
  • Job CallControlTowerAPI -> UploadAndBuild

Both API calls live in a single job. Two jobs would have doubled the fixed-cost OneBranch SDL/binary-analysis injections, required a cross-job artifact handoff for the changed-components JSON, and bought us only marginal isolation -- upload finishes in minutes and the package-build call only briefly polls to confirm acceptance.

The ADO pipeline definition's 'YAML file path' must be updated in the portal from sources-upload.yml to control-tower-integration.yml when this lands.

Package-build step details:

  • condition: and(succeeded(), ne(Build.Reason, PullRequest))
  • Reuses the changed-components JSON from earlier in the job, filters to changeType in {added, changed}, submits with packageTarget=azl4, isScratchBuild=true.
  • run_package_build.py polls briefly (default 5 min) just to confirm the job left Queued; full build progress is monitored in CT itself.

Add a 'Submit package build to Control Tower' step that calls the
/api/Scenario/package endpoint after the prcheck step succeeds. The
step is gated on PR triggers so unmerged code never kicks off a build.

Naming: the pipeline now does more than source upload, so rename to
reflect what it actually does (call Control Tower).
* sources-upload.yml -> control-tower-integration.yml
* sources-upload-stages.yml -> control-tower-integration-stages.yml
* Stage PRCheck -> Integration
* Job CallControlTowerAPI -> UploadAndBuild

Both API calls live in a single job. Two jobs would have doubled the
fixed-cost OneBranch SDL/binary-analysis injections, required a
cross-job artifact handoff for the changed-components JSON, and bought
us only marginal isolation -- upload finishes in minutes and the
package-build call only briefly polls to confirm acceptance.

The ADO pipeline definition's 'YAML file path' must be updated in the
portal from sources-upload.yml to control-tower-integration.yml when
this lands.

Package-build step details:
* condition: and(succeeded(), ne(Build.Reason, PullRequest))
* Reuses the changed-components JSON from earlier in the job, filters
  to changeType in {added, changed}, submits with packageTarget=azl4,
  isScratchBuild=true.
* run_package_build.py polls briefly (default 5 min) just to confirm
  the job left Queued; full build progress is monitored in CT itself.
Copilot AI review requested due to automatic review settings May 10, 2026 20:26
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds a Control Tower “package build” submission to the existing Control Tower integration ADO pipeline so that, after the prcheck/upload portion completes successfully, the pipeline can also request package builds for changed components (while still gating builds off PR-triggered runs).

Changes:

  • Introduces run_package_build.py to submit /api/Scenario/package requests and briefly poll for early failure/acceptance.
  • Extends the raw ADO stages template to run the new “Submit package build to Control Tower” step on non-PR triggers only.
  • Renames/aligns pipeline naming and documentation to reflect broader “Control Tower integration” responsibilities.

Reviewed changes

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

File Description
.github/workflows/scripts/control-tower/run_package_build.py New helper script to submit package-build scenarios and do a short acceptance/health poll.
.github/workflows/ado/templates/control-tower-integration-stages.yml Adds a new AzureCLI step to submit package builds after prcheck on non-PR triggers; renames stage/job.
.github/workflows/ado/control-tower-integration.yml Updates wrapper comments and points the wrapper to the renamed stages template.
.github/instructions/ado-pipeline.instructions.md Updates examples/canonical references to use the new Control Tower integration pipeline names.

Comment thread .github/workflows/scripts/control-tower/run_package_build.py Outdated
Comment thread .github/workflows/scripts/control-tower/run_package_build.py Outdated
Comment thread .github/workflows/scripts/control-tower/run_package_build.py
Copy link
Copy Markdown
Member

@reubeno reubeno left a comment

Choose a reason for hiding this comment

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

Why did we end up with "package build" as the contract between CI and Control Tower? I understand that we've made the call to detect changes on the workflow/pipeline side -- but my expectation is still that the Control Tower will decide which tasks need to be run, depending on whether it's pre-merge qualification, or as part of merge/post-merge.

Did we not add endpoints to Control Tower that are more scenario driven?

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