-
Notifications
You must be signed in to change notification settings - Fork 271
Skipping Build and Live tests using runtime variables #991
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Skipping Build and Live tests using runtime variables #991
Conversation
7b818de to
a235612
Compare
There was a problem hiding this 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 |
e4a4eb1 to
d8c55a8
Compare
d8c55a8 to
af522d0
Compare
af522d0 to
bd10045
Compare
|
Azure Pipelines successfully started running 1 pipeline(s). |
1 similar comment
|
Azure Pipelines successfully started running 1 pipeline(s). |
01be217 to
965b1d4
Compare
45c0216 to
8ed9fd9
Compare
eng/scripts/Set-SkipJobVariables.ps1
Outdated
| @@ -0,0 +1,60 @@ | |||
| . "$PSScriptRoot/../common/scripts/common.ps1" | |||
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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 }}, '{}'))02c2421 to
f102279
Compare
|
/azp run mcp - pullrequest |
|
Azure Pipelines failed to run 1 pipeline(s). |
3bd9b80 to
c74384b
Compare
c74384b to
1664109
Compare
What does this PR do?
GitHub issue number?
#935
Pre-merge Checklist
servers/Azure.Mcp.Server/CHANGELOG.mdand/orservers/Fabric.Mcp.Server/CHANGELOG.mdfor product changes (features, bug fixes, UI/UX, updated dependencies)servers/Azure.Mcp.Server/README.mdand/orservers/Fabric.Mcp.Server/README.mddocumentationeng/scripts/Process-PackageReadMe.ps1. See Package README/servers/Azure.Mcp.Server/docs/azmcp-commands.mdand/or/docs/fabric-commands.md.\eng\scripts\Update-AzCommandsMetadata.ps1to update tool metadata in azmcp-commands.md (required for CI)ToolDescriptionEvaluatorand obtained a score of0.4or more and a top 3 ranking for all related test prompts/servers/Azure.Mcp.Server/docs/e2eTestPrompts.mdcrypto mining, spam, data exfiltration, etc.)/azp run mcp - pullrequest - liveto run Live Test Pipeline