Skip to content

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

Merged
christopherco merged 1 commit into
microsoft:tomls/base/mainfrom
dmcilvaney:damcilva/4.0/pipelines/delta_3_package_build
May 13, 2026
Merged

ci(pipeline): add package build to Control Tower integration#17116
christopherco merged 1 commit into
microsoft:tomls/base/mainfrom
dmcilvaney:damcilva/4.0/pipelines/delta_3_package_build

Conversation

@dmcilvaney

@dmcilvaney dmcilvaney commented May 10, 2026

Copy link
Copy Markdown
Contributor

Add a "Submit package build to Control Tower" step that calls the /api/Scenario/package endpoint after the prcheck step succeeds.

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.

Stage / job rename

The pipeline now does more than source upload, so the stage and job inside the YAML are renamed to reflect what it actually does. The file names stay the same for now -- renaming the wrapper file would require a coordinated portal update of the ADO pipeline definition's YAML path, which will happen in a follow-up PR.

  • Stage PRCheck -> Integration
  • Job CallControlTowerAPI -> UploadAndBuild

Package-build step details

  • run_package_build.py reuses the changed-components JSON from earlier in the job, filters to changeType in {added, changed}, and submits to /api/Scenario/package.
  • --package-target is a parameter of the stages template (defaults set by the wrapper, currently azl4).
  • --official-build is opt-in: omitting it submits a scratch build (isScratchBuild=true); the production wrapper passes --official-build so production runs submit non-scratch (persisted) builds.
  • --build-reason is consumed by the script for a local PR-trigger skip guard (buildReason is also forwarded in the API payload). PR triggers do not submit package builds; the skip lives in the script for parity with run_prcheck.py.
  • The script polls briefly (default 10 min) for the job to reach a terminal state, surfacing immediate failures. A non-terminal status at the timeout is treated as acceptance -- the build continues async and is monitored in Control Tower.

Follow-up after merge

  • Rename sources-upload[.yml,-stages.yml] -> control-tower-integration* and update the ADO build definition's YAML file path in the portal at the same time.
  • Remove job-level continueOnError: true once the pipeline is stable (tracked under ADO task 19179).

Copilot AI review requested due to automatic review settings May 10, 2026 20:26

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

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 Outdated

@reubeno reubeno 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.

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?

@dmcilvaney

Copy link
Copy Markdown
Contributor Author

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?

We looked at the control tower side, and the cost there was much higher than integrating it here in the short-term. I built the azldev components to support this so it will be easy to move this logic into CT if we desire, but this was the shortest path to functionality.

@dmcilvaney dmcilvaney force-pushed the damcilva/4.0/pipelines/delta_3_package_build branch from 8fbf85e to c94440f Compare May 12, 2026 17:53
Comment thread .github/workflows/ado/sources-upload.yml Outdated
Comment thread .github/workflows/scripts/control-tower/run_package_build.py Outdated
Comment thread .github/workflows/scripts/control-tower/run_package_build.py
Comment thread .github/workflows/scripts/control-tower/run_package_build.py Outdated
Comment thread .github/workflows/scripts/control-tower/run_package_build.py
@dmcilvaney dmcilvaney force-pushed the damcilva/4.0/pipelines/delta_3_package_build branch from e685095 to 8217326 Compare May 13, 2026 02:05
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.
@dmcilvaney dmcilvaney force-pushed the damcilva/4.0/pipelines/delta_3_package_build branch from 8217326 to f5bae39 Compare May 13, 2026 02:06
@github-actions

Copy link
Copy Markdown

🔒❌ Lock files are out of date

FIX: — run this and commit the result:

azldev component update -p kernel -p kernel-headers

Or download the fix patch and apply it:

gh run download 25773772562 -R microsoft/azurelinux -n locks-patch
git apply locks.patch

Changed components (2)

Component New upstream commit
kernel 5271a1b047ef402ddee40242e02eda23fc273044
kernel-headers bf1c109a1065217ca13cfe5af45fedf1dfb58ffe

@christopherco christopherco merged commit ff517e7 into microsoft:tomls/base/main May 13, 2026
7 of 9 checks passed
@github-actions

Copy link
Copy Markdown

📄❌ Rendered specs are out of date

FIX: — run this and commit the result:

azldev component render kernel-headers

Or download the fix patch and apply it:

gh run download 25773772562 -R microsoft/azurelinux -n rendered-specs-patch
git apply rendered-specs.patch
Category Count
Content diffs 1
Extra files (untracked) 0
Missing files (deleted) 0

Content diffs

`specs/k/kernel-headers/kernel-headers.spec`
--- committed/specs/k/kernel-headers/kernel-headers.spec
+++ rendered/specs/k/kernel-headers/kernel-headers.spec
@@ -151,7 +151,10 @@
 
 %changelog
 ## START: Generated by rpmautospec
-* Thu Apr 30 2026 Daniel McIlvaney <damcilva@microsoft.com> - 6.18.5-1
+* Wed May 13 2026 azldev <azldev@local> - 6.18.5-1
+- Local changes (uncommitted)
+
+* Thu Apr 30 2026 Daniel McIlvaney <damcilva@microsoft.com> - 6.18.3-2
 - feat: introduce deterministic commit resolution via Azure Linux lock file
 
 * Fri Jan 02 2026 Justin M. Forbes <jforbes@fedoraproject.org> - 6.18.3-1

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.

5 participants