[release/10.0.1xx] Backport a number of CI changes to make PRs work.#25344
Conversation
rolfbjarne
commented
May 6, 2026
- [devops] Make the tests pipeline use a pr: trigger. ([devops] Make the tests pipeline use a pr: trigger. #25239)
- [devops] Make the API diff pipeline use a pr: trigger. ([devops] Make the API diff pipeline use a pr: trigger. #25284)
- [devops] Fix PR latest-commit detection ([devops] Fix PR latest-commit detection #25231)
- [devops] Add a timeout to the 'Publish to Artifact Services Drop' step. ([devops] Add a timeout to the 'Publish to Artifact Services Drop' step. #25210)
- [devops] Disable implicit CI triggers on xamarin-macios-pr pipeline ([devops] Disable implicit CI triggers on xamarin-macios-pr pipeline #25211)
- [devops] Remove the branch-based trigger for pull requests. ([devops] Remove the branch-based trigger for pull requests. #25182)
The pull request #25177 ran the PR pipeline twice: * https://dev.azure.com/devdiv/DevDiv/_build/results?buildId=13868591&view=results * https://dev.azure.com/devdiv/DevDiv/_build/results?buildId=13868592&view=results when it should only have been done once. So I asked Copilot, which said: It was triggered twice because two different Azure triggers fired for the same change. - 13868591 was queued as individualCI for refs/heads/dev/rolf/nsurlsession-cleanup on commit b3223c4. - 13868592 was queued seconds later as pullRequest for refs/pull/25177/merge on the synthetic merge commit 7fccb8c. That matches the repo’s PR pipeline config in tools/devops/automation/build-pull-request.yml, which has both a branch trigger: for refs/heads/dev/* and a pr: trigger for '*'. So opening/updating PR #25177 caused one normal branch CI run and one PR-validation run. So disable the branched-based trigger.
…25211) Without an explicit trigger section, Azure DevOps defaults to enabling CI triggers on all branches. This causes duplicate builds when a branch (e.g. darc-main-*) has an open PR — one from the implicit CI trigger and one from the PR trigger. Adding 'trigger: none' ensures only PR-triggered builds run. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…p. (#25210) This step has taken to hanging recently, and it'll hang until the job's timeout of 3 hours is hit, at which point it'll mark the entire job as failed. So add a timeout just for this step, so that it can timeout by itself, and then the job can finish successfully.
Treat PR merge refs as PR builds regardless of the reported build reason, and consider synthetic merge commits current when one of their parents matches the PR head. Also pass the checkout template's isPR flag correctly so the fixed commit hash is used for PR comment handling. --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Unfortunately Azure DevOps doesn't properly report GitHub checks for pipelines triggered by another pipeline, when that other pipeline was triggered from a pr trigger. So go back to triggering the API diff pipeline using a pr: trigger. This effectively reverts #21880 ("[CI] Make the API diff be triggered as soon as the config of the build is done.") References: * https://stackoverflow.com/questions/78443654/reporting-stage-statuses-to-github-for-pipeline-triggered-by-another-pipeline
Unfortunately Azure DevOps doesn't properly report GitHub checks for pipelines triggered by another pipeline, when that other pipeline was triggered from a pr trigger. So start triggering this pipeline using a pr: trigger. References: * https://stackoverflow.com/questions/78443654/reporting-stage-statuses-to-github-for-pipeline-triggered-by-another-pipeline --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This backport updates the Azure DevOps PR validation pipelines so GitHub checks report correctly (by using pr: triggers directly), improves PR latest-commit detection for comment hiding, and adds guardrails to avoid hangs in artifact publishing.
Changes:
- Switch PR-related pipelines (tests + API diff) from pipeline-resource triggers back to
pr:triggers, and disable implicit CI triggers where needed. - Add an option to build packages inside the tests pipeline (
buildPackages) and wire up stage dependencies accordingly. - Improve PR commit detection in
GitHub.psm1(including synthetic merge commits), add tests for the new behavior, and add 30-minute timeouts to Artifact Services Drop publish steps.
Reviewed changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| tools/devops/automation/templates/windows/stage.yml | Add conditional dependency on build_packages when tests are not running as a post-build pipeline. |
| tools/devops/automation/templates/windows/build.yml | Add a 30-minute timeout to the Artifact Services Drop publish task. |
| tools/devops/automation/templates/tests/run-tests.yml | Add a 30-minute timeout to the Artifact Services Drop publish task. |
| tools/devops/automation/templates/tests-stage.yml | Introduce buildPackages mode (configure-from-scratch + optional build_packages stage) and propagate postPipeline based on that mode. |
| tools/devops/automation/templates/pipelines/run-tests-pipeline.yml | Surface the buildPackages parameter to the pipeline template. |
| tools/devops/automation/templates/mac/build.yml | Add a 30-minute timeout to the Artifact Services Drop publish task. |
| tools/devops/automation/templates/common/configure.yml | Export TEST_MATRIX and SIMULATOR_TEST_MATRIX as output variables for downstream stages. |
| tools/devops/automation/templates/common/checkout.yml | Change PR detection passed to undo_github_merge.ps1 to use the provided isPR parameter directly. |
| tools/devops/automation/scripts/GitHub.Tests.ps1 | Expand unit test coverage for synthetic merge commit detection and PR identification via merge refs. |
| tools/devops/automation/scripts/GitHub.psm1 | Add git-based ancestry/parent helpers and enhance “latest commit in PR” detection (including synthetic merge commits) with caching. |
| tools/devops/automation/run-pr-api-diff.yml | Convert API diff pipeline to run via pr: trigger with path exclusions. |
| tools/devops/automation/run-post-pr-build-tests.yml | Convert post-PR tests pipeline to run via pr: trigger and enable in-pipeline package building. |
| tools/devops/automation/build-pull-request.yml | Disable implicit CI triggers (trigger: none) so PR validation runs don’t duplicate. |
| Makefile | Remove a trailing blank line. |
| @@ -55,7 +55,7 @@ steps: | |||
| workingDirectory: $(System.DefaultWorkingDirectory)/$(BUILD_REPOSITORY_TITLE)/tools/devops/automation/scripts | |||
| timeoutInMinutes: 15 | |||
✅ [PR Build #bcd5f8c] Build passed (Detect API changes) ✅Pipeline on Agent |
This comment has been minimized.
This comment has been minimized.
✅ [PR Build #bcd5f8c] Build passed (Build packages) ✅Pipeline on Agent |
✅ API diff for current PR / commitNET (empty diffs)✅ API diff vs stableNET (empty diffs)ℹ️ Generator diffGenerator Diff: vsdrops (html) vsdrops (raw diff) gist (raw diff) - Please review changes) Pipeline on Agent |
✅ [PR Build #bcd5f8c] Build passed (Build macOS tests) ✅Pipeline on Agent |
🔥 [CI Build #bcd5f8c] Test results 🔥Test results❌ Tests failed on VSTS: test results 0 tests crashed, 11 tests failed, 145 tests passed. Failures❌ monotouch tests (tvOS)11 tests failed, 0 tests passed.Failed tests
|
🔥 [CI Build #bcd5f8c] Test results 🔥Test results❌ Tests failed on VSTS: test results 0 tests crashed, 11 tests failed, 145 tests passed. Failures❌ monotouch tests (tvOS) [attempt 2]11 tests failed, 0 tests passed.Failed tests
|
🚀 [CI Build #bcd5f8c] Test results 🚀Test results✅ All tests passed on VSTS: test results. 🎉 All 156 tests passed 🎉 Tests counts✅ cecil: All 1 tests passed. Html Report (VSDrops) Download macOS tests✅ Tests on macOS Monterey (12): All 5 tests passed. Html Report (VSDrops) Download Linux Build VerificationPipeline on Agent |