Skip to content

Conversation

@chidozieononiwu
Copy link
Member

@chidozieononiwu chidozieononiwu commented Oct 28, 2025

What does this PR do?

  • Skip Build and live tests run when PR changes include only certain files.

GitHub issue number?

#935

Pre-merge Checklist

  • Required for All PRs
    • Read contribution guidelines
    • PR title clearly describes the change
    • Commit history is clean with descriptive messages (cleanup guide)
    • Added comprehensive tests for new/modified functionality
    • Updated servers/Azure.Mcp.Server/CHANGELOG.md and/or servers/Fabric.Mcp.Server/CHANGELOG.md for product changes (features, bug fixes, UI/UX, updated dependencies)
  • For MCP tool changes:
    • One tool per PR: This PR adds or modifies only one MCP tool for faster review cycles
    • Updated servers/Azure.Mcp.Server/README.md and/or servers/Fabric.Mcp.Server/README.md documentation
    • Validate README.md changes using script at eng/scripts/Process-PackageReadMe.ps1. See Package README
    • Updated command list in /servers/Azure.Mcp.Server/docs/azmcp-commands.md and/or /docs/fabric-commands.md
    • Run .\eng\scripts\Update-AzCommandsMetadata.ps1 to update tool metadata in azmcp-commands.md (required for CI)
    • For new or modified tool descriptions, ran ToolDescriptionEvaluator and obtained a score of 0.4 or more and a top 3 ranking for all related test prompts
    • For new tools associated with Azure services or publicly available tools/APIs/products, add URL to documentation in the PR description
  • Extra steps for Azure MCP Server tool changes:
    • Updated test prompts in /servers/Azure.Mcp.Server/docs/e2eTestPrompts.md
    • 👉 For Community (non-Microsoft team member) PRs:
      • Security review: Reviewed code for security vulnerabilities, malicious code, or suspicious activities before running tests (crypto mining, spam, data exfiltration, etc.)
      • Manual tests run: added comment /azp run mcp - pullrequest - live to run Live Test Pipeline

@chidozieononiwu chidozieononiwu force-pushed the SkipJobsBasedOnFilesChanged branch 2 times, most recently from 7b818de to a235612 Compare October 28, 2025 18:54
@chidozieononiwu chidozieononiwu marked this pull request as ready for review October 28, 2025 20:58
@chidozieononiwu chidozieononiwu requested a review from a team as a code owner October 28, 2025 20:58
Copilot AI review requested due to automatic review settings October 28, 2025 20:58
@chidozieononiwu chidozieononiwu requested review from a team as code owners October 28, 2025 20:58
Copy link
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

This PR adds a mechanism to skip build and live test jobs in pull requests when only documentation or metadata files are changed. The script determines which files have changed and conditionally sets Azure DevOps pipeline variables to skip unnecessary build and test stages.

  • Introduces a PowerShell script to detect changes in skip-eligible files/directories
  • Integrates the skip logic into the pipeline initialization job
  • Updates build and live-test job conditions to respect the skip variables

Reviewed Changes

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

File Description
eng/scripts/Set-SkipJobVariables.ps1 New script that analyzes changed files and sets variables to skip build/test jobs for documentation-only changes
eng/pipelines/templates/jobs/initialize.yml Adds a PowerShell task to execute the skip logic during PR initialization
eng/pipelines/templates/jobs/build.yml Updates condition to skip build job based on SetPRSkipJobVariables output
eng/pipelines/templates/jobs/live-test.yml Updates condition to skip live test job based on SetPRSkipJobVariables output

@chidozieononiwu chidozieononiwu force-pushed the SkipJobsBasedOnFilesChanged branch from e4a4eb1 to d8c55a8 Compare October 28, 2025 21:00
@chidozieononiwu chidozieononiwu force-pushed the SkipJobsBasedOnFilesChanged branch from d8c55a8 to af522d0 Compare October 28, 2025 21:01
@chidozieononiwu chidozieononiwu changed the title Test skipping of Build and Live tests using runtime variables Skipping Build and Live tests using runtime variables Oct 28, 2025
@chidozieononiwu chidozieononiwu self-assigned this Oct 28, 2025
@chidozieononiwu chidozieononiwu force-pushed the SkipJobsBasedOnFilesChanged branch from af522d0 to bd10045 Compare October 28, 2025 22:30
@joshfree joshfree added this to the 2025-11 milestone Oct 29, 2025
@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

1 similar comment
@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@chidozieononiwu chidozieononiwu force-pushed the SkipJobsBasedOnFilesChanged branch from 01be217 to 965b1d4 Compare November 3, 2025 19:01
@chidozieononiwu chidozieononiwu force-pushed the SkipJobsBasedOnFilesChanged branch from 45c0216 to 8ed9fd9 Compare November 4, 2025 18:14
@@ -0,0 +1,60 @@
. "$PSScriptRoot/../common/scripts/common.ps1"
Copy link
Member

Choose a reason for hiding this comment

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

This should be integrated into New-BuildInfo.ps1. That script is responsible for forming the Build, Live Test and Smoke Test matrices. If we decide that there's no build or test matrix for a PR, it should be reflected there.

Copy link
Member

Choose a reason for hiding this comment

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

In New-BuildInfo.ps1, the function Get-PathsToTest is responsible for returning all of the areas that should be tested because of a change. We could say that Get-PathsToTest returning an empty array / null indicates that there is nothing to test. In a PR, if there's nothing to test, then there's no reason to build either.

So, changes in only skipped files/directories would produce no paths from Get-PathsToTest.
No paths to Test would cause the LiveTest, Build and smoke test matrices to be empty.
The matrix based jobs are already conditional on non-empty matrices:

condition: and(succeeded(), ne(${{ parameters.Matrix }}, '{}'))

@chidozieononiwu chidozieononiwu force-pushed the SkipJobsBasedOnFilesChanged branch 2 times, most recently from 02c2421 to f102279 Compare November 6, 2025 21:30
@chidozieononiwu
Copy link
Member Author

/azp run mcp - pullrequest

@azure-pipelines
Copy link

Azure Pipelines failed to run 1 pipeline(s).

@chidozieononiwu chidozieononiwu force-pushed the SkipJobsBasedOnFilesChanged branch 2 times, most recently from 3bd9b80 to c74384b Compare November 7, 2025 01:13
@chidozieononiwu chidozieononiwu force-pushed the SkipJobsBasedOnFilesChanged branch from c74384b to 1664109 Compare November 7, 2025 01:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: In Progress

Development

Successfully merging this pull request may close these issues.

4 participants