Skip to content

Unify internal CI matrix and refactor CG mode to SDL mode - #55500

Open
MichaelSimons wants to merge 10 commits into
mainfrom
michaelsimons-pipeline-cleanup-plan
Open

Unify internal CI matrix and refactor CG mode to SDL mode#55500
MichaelSimons wants to merge 10 commits into
mainfrom
michaelsimons-pipeline-cleanup-plan

Conversation

@MichaelSimons

@MichaelSimons MichaelSimons commented Jul 28, 2026

Copy link
Copy Markdown
Member

Summary

This PR simplifies and unifies internal CI behavior across PR, official, and complete CG configurations by standardizing on a shared matrix model.

What changed

  1. Fixed TestTemplatesCG after the MSTest conversion by adding explicit local test-execution support in the shared SDK job template and wiring this leg to use that path. This preserves the intended local execution model for template CG validation while aligning with the current test infrastructure.
  2. Added forceCompleteCg queue-time parameter and derived runInCompleteCgMode:
    • Enables triggering a complete CG scan on demand (scheduled builds use this mode automatically).
    • Complete CG mode adds the TestTemplatesCG Windows job to the standard matrix.
    • The base SDL block (policheck, TSA, binskim, componentgovernance) runs unconditionally on all official builds; complete CG mode is only needed for the full template acquisition scan.
    • Publish is skipped in complete CG mode (scheduled and forceCompleteCg=true runs) since these are scan-only builds, not releases.
  3. Unified matrix behavior across pipeline configurations:
    • PR, official, and complete CG now all run the same base matrix.
    • Complete CG mode no longer uses the old "official-only" leg set; it uses the standard matrix and adds one extra Windows job: TestTemplatesCG.
    • Test execution is PR-only by default (runInTestMode), preventing unmonitored Helix test queueing in official non-PR runs.
    • NativeAOT CLI tests are now gated on runTests, consistent with all other test steps.

Test Builds

Switch TestTemplatesCG to local test execution mode and run dotnet-new integration tests directly with MTP-compatible filter/reporting arguments. This avoids the Arcade RunTests target path that broke after MSTest.Sdk migration and restores deterministic TRX publication for the CG leg.

Co-authored-by: Copilot App <[email protected]>

Copilot-Session: d1e72af2-227b-44f0-9d44-7985ea0847fd
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).
2 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

@MichaelSimons
MichaelSimons force-pushed the michaelsimons-pipeline-cleanup-plan branch from 2b79a05 to c8b44cf Compare July 28, 2026 18:03
MichaelSimons and others added 4 commits July 28, 2026 14:10
Add a forceCgMode queue-time parameter and derive runInCgMode so CG-specific official leg configuration can run on demand, while preserving scheduled CG behavior.

Co-authored-by: Copilot App <[email protected]>

Copilot-Session: d1e72af2-227b-44f0-9d44-7985ea0847fd
Co-authored-by: Copilot App <[email protected]>

Copilot-Session: d1e72af2-227b-44f0-9d44-7985ea0847fd

# Conflicts:
#	.vsts-ci.yml

# Conflicts:
#	.vsts-ci.yml
Remove _publishArgument, _signArgument, and _officialBuildProperties
variables that were only used by the official job parameter sets eliminated
in the previous commit.

Remove the conditional on componentgovernance ignoreDirectories — since
componentgovernance runs unconditionally in all official builds, the
ignore directories should always be set consistently.

Co-authored-by: Copilot App <[email protected]>
Copilot-Session: d1e72af2-227b-44f0-9d44-7985ea0847fd
Replaces the previous explicit parameter listing (fragile, would silently
drop new call-site parameters) with a general pattern: iterate top-level
parameters and skip any key already defined in jobParameters, then insert
jobParameters. This gives jobParameters full override priority for any key
(e.g. runTests on build-only arm64 legs or TestTemplatesCG) without
hardcoding specific parameter names and without duplicate-key conflicts.

Co-authored-by: Copilot App <[email protected]>
Copilot-Session: d1e72af2-227b-44f0-9d44-7985ea0847fd
@MichaelSimons
MichaelSimons force-pushed the michaelsimons-pipeline-cleanup-plan branch from c8b44cf to 96ec734 Compare July 28, 2026 19:19
MichaelSimons and others added 4 commits July 28, 2026 14:50
Co-authored-by: Copilot App <[email protected]>
Copilot-Session: d1e72af2-227b-44f0-9d44-7985ea0847fd
Uses a template expression to hide publish from PR pipelines entirely,
and a runtime condition to skip publish when runInCompleteCgMode is true
(scheduled builds and forceCompleteCg=true manual queues).

Co-authored-by: Copilot App <[email protected]>
Copilot-Session: d1e72af2-227b-44f0-9d44-7985ea0847fd
Move the NativeAOT CLI test section inside the runTests if block so it
is skipped in official builds where runTests is false, consistent with
the rest of the test execution steps.

Co-authored-by: Copilot App <[email protected]>
Copilot-Session: d1e72af2-227b-44f0-9d44-7985ea0847fd
@MichaelSimons
MichaelSimons marked this pull request as ready for review July 29, 2026 13:40
@MichaelSimons
MichaelSimons requested a review from MiYanni as a code owner July 29, 2026 13:40
@MichaelSimons
MichaelSimons requested review from Copilot and marcpopMSFT and removed request for MiYanni and Copilot July 29, 2026 13:40
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).
2 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

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

This PR refactors the internal Azure DevOps pipelines to use a unified SDK job matrix across PR, official, and complete-CG configurations, while adding an explicit “local” test execution mode to support the TestTemplatesCG scenario after the MSTest conversion.

Changes:

  • Added testExecutionMode (helix vs local) and testFilter support to the shared sdk-build.yml job template so specific test legs (notably TestTemplatesCG) can run directly on the agent instead of via Arcade/Helix queuing.
  • Updated the shared sdk-job-matrix.yml to support runTests and an additional Windows job parameter set list, enabling complete-CG builds to add TestTemplatesCG on top of the standard matrix.
  • Reworked .vsts-ci.yml to introduce forceCompleteCg and to standardize behavior: base SDL (including CG) runs on official builds, complete-CG mode adds the extra template acquisition test leg, and publish is skipped for complete-CG runs.

Reviewed changes

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

Show a summary per file
File Description
eng/pipelines/templates/jobs/sdk-job-matrix.yml Adds runTests plus an “additional Windows jobs” mechanism and refactors parameter forwarding to support job-level overrides.
eng/pipelines/templates/jobs/sdk-build.yml Introduces testExecutionMode + testFilter and adds a local dotnet test execution path with TRX publishing for MTP/MSTest scenarios.
eng/common/core-templates/job/helix-job-monitor.yml Pins the job monitor pool OS to Linux for consistency with pool selection/demands.
.vsts-pr.yml Clarifies which pipelines consume the PR YAML via header comments.
.vsts-ci.yml Adds queue-time flags (forceTestBuild, forceCompleteCg), unifies matrix usage, wires complete-CG mode to add TestTemplatesCG, and skips publish in complete-CG runs.

Comment thread .vsts-ci.yml Outdated

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This fix is already made in arcade and flowing in - see dotnet/arcade#17212

Co-authored-by: Copilot Autofix powered by AI <[email protected]>
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.

TestTemplatesCG fails in internal official scheduled build with MSB4057 (RunTests target missing)

3 participants