Skip to content

Skip Java test matrices for documentation-only PRs - #50302

Merged
vcolin7 merged 8 commits into
mainfrom
vcolin7/ci-doc-preflight-poc
Sep 1, 2026
Merged

Skip Java test matrices for documentation-only PRs#50302
vcolin7 merged 8 commits into
mainfrom
vcolin7/ci-doc-preflight-poc

Conversation

@vcolin7

@vcolin7 vcolin7 commented Aug 31, 2026

Copy link
Copy Markdown
Member

Description

  • Adds a deny-first PR change classifier for the unified Java pull request pipeline.
  • Suppresses Java test matrix generation only when every changed path has a known non-Java validation route.
  • Keeps Swagger/AutoRest and TypeSpec inputs, source and test resources, version/dependency inputs, engineering files, mixed changes, and unknown paths on the normal test path.
  • Keeps Build and Analyze enabled so their existing validation remains unchanged in this first rollout phase.
  • Supports a definition-level ForceFullValidation=true rollback switch.
  • Adds table-driven Pester coverage, including the real empty-matrix integration path.

Motivation

Documentation-only PRs currently select a fallback package and allocate test workers even though they cannot change Java behavior. Recent examples consumed 3–10 test workers and roughly 32–94 agent-minutes. This change removes only those test matrices while preserving the rest of PR validation.

Validation

Scope

This is Phase 1 only. The additional classification outputs are diagnostic/reserved for later work to route focused validation and potentially gate Build or Analyze after their unique checks are relocated.

@azure-pipelines

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

@vcolin7
vcolin7 changed the base branch from pipelinev3-vcolin7-ci-doc-preflight-poc to main August 31, 2026 19:58
Comment thread eng/scripts/Classify-PRChanges.ps1 Outdated
Comment thread eng/scripts/Classify-PRChanges.ps1 Outdated
Comment thread eng/scripts/Classify-PRChanges.ps1
Comment thread eng/scripts/Classify-PRChanges.ps1 Outdated
Comment thread eng/scripts/Classify-PRChanges.ps1
Comment thread eng/scripts/Classify-PRChanges.ps1
Copilot AI lite review requested due to automatic review settings September 1, 2026 01:03

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 introduces a deny-first PR change classifier to the unified Java PR pipeline so that documentation-only pull requests can avoid generating Java test matrices (and therefore avoid allocating test workers), while keeping Build and Analyze validation intact.

Changes:

  • Adds eng/scripts/Classify-PRChanges.ps1 to classify changed paths and (when safe) clear job-local PackageInfo to force an empty {} test matrix.
  • Wires the classifier into the PR matrix pre-generation path in eng/pipelines/templates/jobs/ci.yml.
  • Adds table-driven Pester coverage in eng/scripts/tests/Classify-PRChanges.tests.ps1, including the “empty matrix integration” path.

Reviewed changes

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

File Description
eng/scripts/tests/Classify-PRChanges.tests.ps1 Adds Pester tests validating docs-only vs functional classification and the matrix-emptying integration path.
eng/scripts/Classify-PRChanges.ps1 Implements deny-first path classification and the PackageInfo-clearing behavior used to suppress test matrix generation.
eng/pipelines/templates/jobs/ci.yml Invokes the classifier during PR matrix pre-generation to suppress test matrices only for docs-only change sets.
Suppressed comments (1)

eng/scripts/tests/Classify-PRChanges.tests.ps1:36

  • With the classifier no longer treating arbitrary cspell.* files as safe to skip tests, these paths should be in the "requires Java tests" set to preserve deny-first behavior (and to ensure sdk/cosmos/pipeline/** remains fully validated).
        @{ Path = 'sdk/example/example/src/test/resources/cspell.json' }

💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.

Comment thread eng/scripts/Classify-PRChanges.ps1 Outdated
Comment thread eng/scripts/tests/Classify-PRChanges.tests.ps1 Outdated
@vcolin7
vcolin7 enabled auto-merge (squash) September 1, 2026 06:39
@vcolin7
vcolin7 disabled auto-merge September 1, 2026 21:20
@vcolin7
vcolin7 merged commit 0ceba9a into main Sep 1, 2026
19 checks passed
@vcolin7
vcolin7 deleted the vcolin7/ci-doc-preflight-poc branch September 1, 2026 21:21
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.

4 participants