Skip to content

Commit 7b8f283

Browse files
authored
Merge main into Az.DesktopVirtualization-preview (#28256)
2 parents 9b7265d + ae1e29a commit 7b8f283

File tree

3,546 files changed

+209333
-79085
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

3,546 files changed

+209333
-79085
lines changed

.azure-pipelines/PipelineSteps/BatchGeneration/analyse-modules.ps1

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -62,11 +62,6 @@ foreach ($moduleName in $moduleGroup) {
6262
{
6363
$FailedTasks += "UXMetadata"
6464
}
65-
.("$toolsDirectory/ExecuteCIStep.ps1") -StaticAnalysisCmdletDiff @Parameters 2>>$ErrorLogPath
66-
If (($LASTEXITCODE -ne 0) -and ($LASTEXITCODE -ne $null))
67-
{
68-
$FailedTasks += "CmdletDiff"
69-
}
7065
If ($FailedTasks.Length -ne 0)
7166
{
7267
Write-Host "There are failed tasks: $FailedTasks"

.azure-pipelines/PipelineSteps/BatchGeneration/filter.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ $artifactsDir = Join-Path $RepoRoot 'artifacts'
1515

1616
$changedModulesDict = @{}
1717
$changedSubModulesDict = @{}
18-
if ($env:TEST_CHANGED_MODULES_ONLY -eq "True") {
18+
if ($env:TEST_CHANGED_MODULES_ONLY -eq 'true') {
1919
Write-Host "Run test on generated folder changed modules"
2020
# Only generated folder change should trigger the test
2121
for ($i = 0; $i -lt $ChangedFiles.Count; $i++) {

.azure-pipelines/PipelineSteps/BatchGeneration/notify-failed-job.ps1

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,10 @@ $notificationContent = $notificationTemplate -replace "{{ pipelineName }}", $pip
1515
-replace "{{ pipelineUrl }}", $pipelineUrl `
1616
-replace "{{ runUrl }}", $runUrl
1717

18+
$notificationReceivers = if ($env:NotificationReceiversOverride -and $env:NotificationReceiversOverride -ne 'none') { $env:NotificationReceiversOverride } else { $env:FailedJobNotificationReceivers }
19+
Write-Host "Notification receivers: $notificationReceivers"
20+
1821
Send-Teams `
19-
-to $env:FailedJobNotificationReceivers `
22+
-to $notificationReceivers `
2023
-title "Batch Generation Job Failed" `
2124
-content $notificationContent

.azure-pipelines/PipelineSteps/BatchGeneration/util.psm1

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,15 @@ function Get-BatchGenerationModuleMap {
33
[string]$srcPath
44
)
55
$skippedModules = $env:SKIPPED_MODULES -split ',' | ForEach-Object { $_.Trim() }
6+
$selectedTargetModules = @{}
7+
if ($env:SELECTED_TARGET_MODULES -ne "none") {
8+
$env:SELECTED_TARGET_MODULES -split ',' | ForEach-Object {
9+
$key = $_.Trim()
10+
if ($key -ne '') {
11+
$selectedTargetModules[$key] = $true
12+
}
13+
}
14+
}
615
$result = @{}
716
$modules = Get-ChildItem -Path $srcPath -Directory
817

@@ -11,6 +20,12 @@ function Get-BatchGenerationModuleMap {
1120
Write-Warning "Skipping module: $($module.Name) as it is in the skipped modules list."
1221
continue
1322
}
23+
24+
if ($selectedTargetModules.Count -gt 0 -and -not $selectedTargetModules.ContainsKey($module.Name)) {
25+
Write-Warning "Skipping module: $($module.Name) as it is not in the selected target modules list."
26+
continue
27+
}
28+
1429
$subModules = Get-ChildItem -Path $module.FullName -Directory | Where-Object {
1530
$_.Name -like '*.autorest'
1631
}

.azure-pipelines/batch-generation.yml

Lines changed: 41 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,21 @@
11
parameters:
22
- name: TestChangedModulesOnly
3-
displayName: 'Only run tests on modules that are changed by regeneration'
3+
type: boolean
4+
default: true
5+
# Selected modules to generate, build, analyze and test
6+
- name: SelectedTargetModules
47
type: string
5-
default: 'True'
8+
default: 'None'
9+
- name: NotificationReceiversOverride
10+
type: string
11+
default: 'None'
12+
# branch from when creating the generation branch
13+
- name: GenerationBaseBranch
14+
type: string
15+
default: 'main'
16+
- name: PrepareModulesOnGenerationBranch
17+
type: boolean
18+
default: false
619

720
variables:
821
IntermediateStepTimeoutInMinutes: 30
@@ -39,6 +52,22 @@ stages:
3952
pool: ${{ variables.WindowsAgentPoolName }}
4053
steps:
4154

55+
- task: PowerShell@2
56+
name: showVariables
57+
displayName: 'Show Variables'
58+
inputs:
59+
targetType: inline
60+
pwsh: true
61+
script: |
62+
Write-Host "Pipeline variable SkippedModules: $($env:SkippedModules)"
63+
Write-Host "Pipeline variable FailedJobNotificationReceivers: $($env:FailedJobNotificationReceivers)"
64+
65+
Write-Host "Parameter TestChangedModulesOnly: ${{ parameters.TestChangedModulesOnly }}"
66+
Write-Host "Parameter SelectedTargetModules: ${{ parameters.SelectedTargetModules }}"
67+
Write-Host "Parameter NotificationReceiversOverride: ${{ parameters.NotificationReceiversOverride }}"
68+
Write-Host "Parameter GenerationBaseBranch: ${{ parameters.GenerationBaseBranch }}"
69+
Write-Host "Parameter PrepareModulesOnGenerationBranch: ${{ parameters.PrepareModulesOnGenerationBranch }}"
70+
4271
# TODO: (Bernard) Uncomment the no checkout step after automatically install repo into agents
4372
# - checkout: none
4473
- checkout: self
@@ -59,7 +88,7 @@ stages:
5988
$token = "$(GitHubToken)"
6089
6190
$createBranchPath = Join-Path "$(Build.SourcesDirectory)" '.azure-pipelines' 'PipelineSteps' 'BatchGeneration' 'create-branch.ps1'
62-
& $createBranchPath -Owner 'Azure' -Repo 'azure-powershell' -BaseBranch "$(GenerationBaseBranch)" -NewBranch $generationBranch -Token $token
91+
& $createBranchPath -Owner 'Azure' -Repo 'azure-powershell' -BaseBranch "${{ parameters.GenerationBaseBranch }}" -NewBranch $generationBranch -Token $token
6392
Write-Host "##vso[task.setvariable variable=GenerationBranch;isOutput=true]$generationBranch"
6493
6594
- task: PowerShell@2
@@ -82,10 +111,18 @@ stages:
82111
targetType: inline
83112
pwsh: true
84113
script: |
114+
if ($env:PREPARE_MODULES_ON_GENERATION_BRANCH -eq 'true') {
115+
Write-Host "Checkout to GenerationBranch: $(checkout.GenerationBranch)"
116+
git fetch origin "$(checkout.GenerationBranch)"
117+
git checkout "$(checkout.GenerationBranch)"
118+
}
119+
85120
$prepareModulesPath = Join-Path "$(Build.SourcesDirectory)" '.azure-pipelines' 'PipelineSteps' 'BatchGeneration' 'prepare.ps1'
86121
& $prepareModulesPath -RepoRoot "$(Build.SourcesDirectory)" -MaxParallelJobs "${{ variables.MaxParallelGenerateJobs }}"
87122
env:
88123
SKIPPED_MODULES: $(SkippedModules)
124+
SELECTED_TARGET_MODULES: ${{ parameters.SelectedTargetModules }}
125+
PREPARE_MODULES_ON_GENERATION_BRANCH: ${{ parameters.PrepareModulesOnGenerationBranch }}
89126

90127
- task: PublishPipelineArtifact@1
91128
displayName: 'Upload generated targets'
@@ -515,3 +552,4 @@ stages:
515552
env:
516553
TEAMS_URL: $(TEAMS_URL)
517554
FailedJobNotificationReceivers: $(FailedJobNotificationReceivers)
555+
NotificationReceiversOverride: ${{ parameters.NotificationReceiversOverride }}

.azure-pipelines/sync-aliases.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,20 @@ jobs:
3434
dotnet tool install powershell --version 7.4.*
3535
displayName: Install PowerShell 7.4.x
3636
37+
- pwsh: |
38+
if (-not (Get-PackageProvider -Name NuGet -ErrorAction SilentlyContinue)) {
39+
Install-PackageProvider -Name NuGet -Force
40+
}
41+
Install-Package -Name YamlDotNet -RequiredVersion $(YamlDotNetVersion) -ProviderName NuGet -Force -ErrorAction Stop
42+
displayName: Install YamlDotNet NuGet Package
43+
retryCountOnTaskFailure: 5
44+
3745
- pwsh: |
3846
dotnet tool run pwsh -NoLogo -NoProfile -NonInteractive -File ./tools/Github/ParseServiceContactsList.ps1 -AccessToken $env:SYSTEM_ACCESSTOKEN
3947
env:
4048
SYSTEM_ACCESSTOKEN: $(System.AccessToken)
4149
displayName: Update resourceManagement.yml file locally
50+
condition: succeeded()
4251
4352
- pwsh: |
4453
$hasChanges = git diff --name-only .github/policies

.azure-pipelines/test-coverage.yml

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,10 @@ parameters:
77
displayName: Test Framework
88
type: string
99
default: net8.0
10-
- name: testPoolName
11-
displayName: Test Pool Name
12-
type: string
13-
default: pool-windows-2019
14-
- name: testPoolVMImage
15-
displayName: Test Pool VM Image
16-
type: string
17-
default: ' '
10+
- name: updateBaseline
11+
displayName: Update Test Coverage Baseline?
12+
type: boolean
13+
default: false
1814

1915
variables:
2016
EnableTestCoverage: true
@@ -51,9 +47,7 @@ jobs:
5147
- job: TestCoverage
5248
dependsOn: Build
5349
timeoutInMinutes: 600
54-
pool:
55-
name: ${{ parameters.testPoolName }}
56-
vmImage: ${{ parameters.testPoolVMImage }}
50+
pool: pool-windows-2019
5751

5852
steps:
5953
- task: UseDotNet@2
@@ -85,7 +79,7 @@ jobs:
8579

8680
- task: PowerShell@2
8781
displayName: Test Autorest-Based Cmdlets
88-
condition: succeeded()
82+
condition: succeededOrFailed()
8983
inputs:
9084
pwsh: true
9185
targetType: inline
@@ -103,18 +97,20 @@ jobs:
10397
10498
- task: PowerShell@2
10599
displayName: Analyze Test Coverage
106-
condition: succeeded()
100+
condition: succeededOrFailed()
107101
inputs:
108102
pwsh: true
109103
targetType: filePath
110104
filePath: ./tools/TestFx/Coverage/AnalyzeTestCoverage.ps1
111-
arguments: -CalcBaseline
105+
arguments: '-CalcBaseline:$${{ parameters.updateBaseline }}'
112106

113107
- template: util/get-github-pat-steps.yml
108+
parameters:
109+
execCondition: and(succeeded(), ${{ parameters.updateBaseline }})
114110

115111
- task: PowerShell@2
116112
displayName: Update Test Coverage Baseline
117-
condition: succeeded()
113+
condition: and(succeeded(), ${{ parameters.updateBaseline }})
118114
inputs:
119115
pwsh: true
120116
targetType: inline

.azure-pipelines/util/get-github-pat-steps.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,17 @@
1+
parameters:
2+
- name: execCondition
3+
type: string
4+
default: succeeded()
5+
16
steps:
27
- task: AzurePowerShell@5
8+
displayName: Get GitHub PAT from Key Vault
9+
condition: ${{ parameters.execCondition }}
310
inputs:
411
pwsh: true
12+
azurePowerShellVersion: 'LatestVersion'
513
azureSubscription: '$(AzureSubscription)'
614
ScriptType: 'InlineScript'
715
Inline: |
816
$GithubToken = Get-AzKeyVaultSecret -VaultName $(GithubPATKeyVaultName) -Name $(GithubPATKeyVaultAccount) -AsPlainText
917
Write-Host "##vso[task.setvariable variable=GithubToken;issecret=true]$GithubToken"
10-
azurePowerShellVersion: 'LatestVersion'
11-
displayName: Get Github PAT from Key Vault

.github/policies/resourceManagement.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4071,6 +4071,25 @@ configuration:
40714071
- xgithubtriage
40724072
replyTemplate: Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc ${mentionees}.
40734073
assignMentionees: False
4074+
- if:
4075+
- or:
4076+
- labelAdded:
4077+
label: Service Attention
4078+
- labelAdded:
4079+
label: Storage Action
4080+
- hasLabel:
4081+
label: Service Attention
4082+
- hasLabel:
4083+
label: Storage Action
4084+
then:
4085+
- mentionUsers:
4086+
mentionees:
4087+
- blueww
4088+
- sshankMSFT
4089+
- golddove
4090+
- S-J-M
4091+
replyTemplate: Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc ${mentionees}.
4092+
assignMentionees: False
40744093
- if:
40754094
- or:
40764095
- labelAdded:

NuGet.Config

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@
2828

2929

3030

31+
32+
33+
34+
3135

3236

3337

0 commit comments

Comments
 (0)