diff --git a/.azure-pipelines/SyncFromMainBranchConfig.json b/.azure-pipelines/SyncFromMainBranchConfig.json index 6627c5c23edd..18d45a79e534 100644 --- a/.azure-pipelines/SyncFromMainBranchConfig.json +++ b/.azure-pipelines/SyncFromMainBranchConfig.json @@ -3,6 +3,7 @@ ".ci-config.json", "tools", ".azure-pipelines", + ".github", "src/lib", "src/shared", "build.proj", diff --git a/.azure-pipelines/powershell-core.yml b/.azure-pipelines/powershell-core.yml index e05cdf2b0fbb..f0dd147499f8 100644 --- a/.azure-pipelines/powershell-core.yml +++ b/.azure-pipelines/powershell-core.yml @@ -57,6 +57,7 @@ jobs: configuration: ${{ variables.Configuration }} testFramework: ${{ variables.TestFramework }} powerShellPlatform: ${{ variables.PowerShellPlatform }} + IsGenerateBased: ${{ variables.IsGenerateBased }} - job: Test displayName: Test diff --git a/.azure-pipelines/sync-tools-folder.yml b/.azure-pipelines/sync-tools-folder.yml index 760e44a81c63..0c6867108785 100644 --- a/.azure-pipelines/sync-tools-folder.yml +++ b/.azure-pipelines/sync-tools-folder.yml @@ -11,6 +11,7 @@ trigger: paths: include: - .azure-pipelines + - .github - tools - src/lib diff --git a/.azure-pipelines/util/analyze-steps.yml b/.azure-pipelines/util/analyze-steps.yml index 99d80cba86d9..37142cd0189b 100644 --- a/.azure-pipelines/util/analyze-steps.yml +++ b/.azure-pipelines/util/analyze-steps.yml @@ -2,26 +2,12 @@ parameters: configuration: '' testFramework: '' powerShellPlatform: '' + IsGenerateBased: '' steps: - template: download-build-steps.yml parameters: artifactName: build-${{ parameters.testFramework }} -- task: NodeTool@0 - condition: eq(variables.IsGenerateBased, true) - displayName: Install autorest - inputs: - versionSpec: '14.17.1' - command: custom - verbose: false - customCommand: install autorest@latest -- task: PowerShell@2 - condition: eq(variables.IsGenerateBased, true) - displayName: Setup environment for autorest - inputs: - targetType: inline - script: "$env:NODE_OPTIONS=\"--max-old-space-size=65536\"" - pwsh: true - task: UseDotNet@2 displayName: 'Use .NET Core sdk 6.0.x' @@ -61,6 +47,7 @@ steps: arguments: 'build.proj /t:StaticAnalysis /p:Configuration=${{ parameters.configuration }};PullRequestNumber=$(System.PullRequest.PullRequestNumber)' env: OCTOKITPAT: $(OCTOKITPAT) + IsGenerateBased: ${{ parameters.IsGenerateBased }} - template: publish-artifacts-steps.yml parameters: diff --git a/.azure-pipelines/util/test-steps.yml b/.azure-pipelines/util/test-steps.yml index 2b7ae0b7f111..2b5ce8f9f436 100644 --- a/.azure-pipelines/util/test-steps.yml +++ b/.azure-pipelines/util/test-steps.yml @@ -9,21 +9,6 @@ steps: - template: download-build-steps.yml parameters: artifactName: build-${{ parameters.testFramework }} -- task: NodeTool@0 - condition: eq(variables.IsGenerateBased, true) - displayName: Install Autorest - inputs: - versionSpec: '14.17.1' - command: custom - verbose: false - customCommand: install autorest@latest -- task: PowerShell@2 - condition: eq(variables.IsGenerateBased, true) - displayName: Setup environment for Autorest - inputs: - targetType: inline - script: "$env:NODE_OPTIONS=\"--max-old-space-size=65536\"" - pwsh: true - task: UseDotNet@2 displayName: 'Use .NET SDK 6 for tests' diff --git a/.azure-pipelines/windows-powershell.yml b/.azure-pipelines/windows-powershell.yml index 50f721b91257..743e19d79ccc 100644 --- a/.azure-pipelines/windows-powershell.yml +++ b/.azure-pipelines/windows-powershell.yml @@ -52,11 +52,11 @@ jobs: configuration: ${{ variables.Configuration }} testFramework: ${{ variables.TestFramework }} powerShellPlatform: ${{ variables.PowerShellPlatform }} + IsGenerateBased: ${{ variables.IsGenerateBased }} - job: Test displayName: Test dependsOn: Build - condition: and(eq(variables.IsGenerateBased, false), succeeded()) timeoutInMinutes: 180 pool: ${{ variables.AgentPoolName }} diff --git a/tools/ExecuteCIStep.ps1 b/tools/ExecuteCIStep.ps1 index 6815fbd1076c..061083ab7f7f 100644 --- a/tools/ExecuteCIStep.ps1 +++ b/tools/ExecuteCIStep.ps1 @@ -254,6 +254,17 @@ If ($Build) $Template.Build.Details += $BuildDetail $DependencyStepList = $Template | Get-Member -MemberType NoteProperty | Select-Object -ExpandProperty Name | Where-Object { $_ -Ne "build" } + + # In generated based branch, the Accounts is cloned from latest main branch but the environment will be cleaned after build job. + # Also the analysis check and test is not necessary for Az.Accounts in these branches. + If ($Env:IsGenerateBased -eq "true") + { + ForEach ($phase In ($CIPlan | Get-Member -MemberType NoteProperty | Select-Object -ExpandProperty Name | Where-Object { $_ -Ne "build" })) + { + $CIPlan.$phase = $CIPlan.$phase | Where-Object { $_ -Ne "Accounts" } + } + ConvertTo-Json -Depth 10 -InputObject $CIPlan | Out-File -FilePath $CIPlanPath + } ForEach ($DependencyStep In $DependencyStepList) { diff --git a/tools/StaticAnalysis/CollectStaticAnalysisPipelineResult.ps1 b/tools/StaticAnalysis/CollectStaticAnalysisPipelineResult.ps1 index 81e1e86db479..598df9fbc39b 100644 --- a/tools/StaticAnalysis/CollectStaticAnalysisPipelineResult.ps1 +++ b/tools/StaticAnalysis/CollectStaticAnalysisPipelineResult.ps1 @@ -168,7 +168,7 @@ ForEach ($Step In $Steps) { $Content += "|$ErrorTypeEmoji|$($Issue.Target)|$($Issue.Description)|$($Issue.Remediation)|`n" } ElseIf ($PhaseName -Eq "help-example") { - $Content += "|$ErrorTypeEmoji|$($Issue.Target)|$($Issue.Example)|$($Issue.Line)|$($Issue.RuleName)|$($Issue.Description)|$($Issue.Extent)|$($Issue.Remediation)|`n" + $Content += "|$ErrorTypeEmoji|$($Issue.Cmdlet)|$($Issue.Example)|$($Issue.Line)|$($Issue.RuleName)|$($Issue.Description)|$($Issue.Extent)|$($Issue.Remediation)|`n" } ElseIf ($PhaseName -Eq "ux") { $Content += "|$ErrorTypeEmoji|$($Issue.Module)|$($Issue.ResourceType)|$($Issue.SubResourceType)|$($Issue.Command)|$($Issue.Description)|`n"