diff --git a/.gitignore b/.gitignore index 61bbb8d8b251..01be8561c4ec 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ # Default Assets restore directory .assets +test-proxy.log *.class @@ -118,4 +119,4 @@ stress-test-resources.json stress-test-addons* # Temp typespec files -TempTypeSpecFiles/ \ No newline at end of file +TempTypeSpecFiles/ diff --git a/.vscode/cspell.json b/.vscode/cspell.json index 0bd6a639cdd4..32f0621d9435 100644 --- a/.vscode/cspell.json +++ b/.vscode/cspell.json @@ -16,6 +16,7 @@ "**/sdk/**/target/**", "**/session-records/**", "**/sdk/**/**/assets.json", + "**/sdk/**/*-matrix.json", "**/chromedriver", ".gitignore", "*.jar", diff --git a/eng/CredScanSuppression.json b/eng/CredScanSuppression.json index 8c20f554ccc0..e592df534d02 100644 --- a/eng/CredScanSuppression.json +++ b/eng/CredScanSuppression.json @@ -35,9 +35,16 @@ ], "_justification": "Javadoc in azure resourcemanagerhybrid" }, + { + "file": [ + "test-proxy.log", + ], + "_justification": "Transient test file that is locked by test-proxy and should not be scanned" + }, { "file": [ "eng/common/testproxy/dotnet-devcert.pfx", + "sdk/core/azure-core-test/target/classes/keystore.jks", "sdk/cosmos/azure-cosmos-tests/src/test/resources/server.jks", "sdk/cosmos/azure-cosmos-tests/src/test/resources/client.jks", "sdk/identity/azure-identity/src/test/resources/cert-chain.pem", @@ -64,6 +71,9 @@ "file": [ "sdk/communication/azure-communication-common-perf/src/main/java/com.azure.communication.common.perf/FakeCredentialInTest.java", "sdk/keyvault/azure-security-keyvault-certificates/src/test/java/com/azure/security/keyvault/certificates/FakeCredentialInTest.java", + "sdk/keyvault/microsoft-azure-keyvault/src/test/resources/session-records/createCertificatePemForCertificateOperationsTest.json", + "sdk/keyvault/microsoft-azure-keyvault/src/test/resources/session-records/createSelfSignedCertificatePemForCertificateOperationsTest.json", + "sdk/resourcemanagerhybrid/azure-resourcemanager/src/test/resources/session-records/AzureResourceManagerTests.testContainerRegistry.json", "sdk/spring/spring-cloud-azure-autoconfigure/src/test/java/com/azure/spring/cloud/autoconfigure/FakeCredentialInTest.java", "sdk/spring/spring-cloud-azure-service/src/test/java/com/azure/spring/cloud/service/implementation/storage/FakeCredentialInTest.java", "sdk/storage/azure-storage-blob/src/test/java/com/azure/storage/blob/FakeCredentialInTest.java", diff --git a/eng/pipelines/aggregate-reports.yml b/eng/pipelines/aggregate-reports.yml index d3715620b952..e96822458d55 100644 --- a/eng/pipelines/aggregate-reports.yml +++ b/eng/pipelines/aggregate-reports.yml @@ -117,10 +117,11 @@ stages: displayName: 'Copy BOM report to artifact staging' condition: succeededOrFailed() - - publish: $(Build.ArtifactStagingDirectory) - condition: succeededOrFailed() - displayName: 'Publish Report Artifacts' - artifact: reports + - template: /eng/common/pipelines/templates/steps/publish-1es-artifact.yml + parameters: + DisplayName: 'Publish Report Artifacts' + ArtifactPath: '$(Build.ArtifactStagingDirectory)' + ArtifactName: 'reports' - template: /eng/pipelines/templates/steps/upload-repository-on-failure.yml @@ -166,8 +167,9 @@ stages: timeoutInMinutes: 120 pool: - name: azsdk-pool-mms-win-2022-general - vmImage: windows-2022 + name: $(WINDOWSPOOL) + vmImage: $(WINDOWSVMIMAGE) + os: windows steps: - template: /eng/common/pipelines/templates/steps/policheck.yml diff --git a/eng/pipelines/bompreparation.yml b/eng/pipelines/bompreparation.yml index a5a2f6dfecf8..5d5ad2c27dc8 100644 --- a/eng/pipelines/bompreparation.yml +++ b/eng/pipelines/bompreparation.yml @@ -19,6 +19,8 @@ stages: Copy-Item eng/scripts/bompom.html $(Build.ArtifactStagingDirectory)/staging displayName: 'Analyze and generate patches' - - publish: $(Build.ArtifactStagingDirectory) - displayName: 'Publish Report Artifacts' - artifact: patchreport \ No newline at end of file + - template: /eng/common/pipelines/templates/steps/publish-1es-artifact.yml + parameters: + DisplayName: 'Publish Report Artifacts' + ArtifactPath: '$(Build.ArtifactStagingDirectory)' + ArtifactName: 'patchreport' diff --git a/eng/pipelines/code-quality-reports.yml b/eng/pipelines/code-quality-reports.yml index 46fec4acbdbe..5c4c0cce333f 100644 --- a/eng/pipelines/code-quality-reports.yml +++ b/eng/pipelines/code-quality-reports.yml @@ -7,7 +7,9 @@ jobs: - template: /eng/pipelines/templates/variables/globals.yml pool: - name: azsdk-pool-mms-ubuntu-2004-general + name: $(LINUXPOOL) + vmImage: $(LINUXVMIMAGE) + os: linux steps: # Skip sparse checkout for the `azure-sdk-for--pr` private mirrored repositories @@ -105,16 +107,27 @@ jobs: - task: PowerShell@2 inputs: filePath: $(System.DefaultWorkingDirectory)/eng/pipelines/scripts/Get-Linting-Reports.ps1 - arguments: -OutputDirectory $(Build.ArtifactStagingDirectory)/linting-reports + arguments: -StagingDirectory $(Build.ArtifactStagingDirectory) pwsh: true workingDirectory: $(Pipeline.Workspace) displayName: 'Generate Linting Reports' condition: and(always(), ne(variables['LintingGoals'], '')) - - publish: $(Build.ArtifactStagingDirectory)/linting-reports.zip - displayName: 'Publish Linting Reports' - artifact: linting-reports-$(System.StageName)-$(System.JobName)-$(System.JobAttempt) - condition: and(always(), ne(variables['LintingGoals'], '')) + - pwsh: | + $artifactZip = "$(Build.ArtifactStagingDirectory)/linting-reports.zip" + $destinationDir = "$(Build.ArtifactStagingDirectory)/zipped-linting-reports" + if (Test-Path $artifactZip) { + New-Item -ItemType Directory -Path "$destinationDir" + Move-Item -Path $artifactZip -Destination "$destinationDir" + } + displayName: Move linting report zip to individual directory for artifact upload + condition: succeededOrFailed() + + - template: /eng/common/pipelines/templates/steps/publish-1es-artifact.yml + parameters: + DisplayName: 'Publish Linting Reports' + ArtifactPath: '$(Build.ArtifactStagingDirectory)/zipped-linting-reports' + ArtifactName: 'linting-reports' - pwsh: | if ((Get-ChildItem -Path $(Build.ArtifactStagingDirectory)/linting-reports -Directory | Measure-Object).Count -gt 0) { diff --git a/eng/pipelines/docindex.yml b/eng/pipelines/docindex.yml index 5b69beaaa6e1..7201749f76b2 100644 --- a/eng/pipelines/docindex.yml +++ b/eng/pipelines/docindex.yml @@ -27,6 +27,8 @@ jobs: Repositories: - Name: $(DocRepoOwner)/$(DocRepoName) WorkingDirectory: $(DocRepoLocation) + - Name: azure-sdk/$(DocRepoName) + WorkingDirectory: $(DailyDocRepoLocation) # Pull and build the docker image. - template: /eng/common/pipelines/templates/steps/docker-pull-image.yml parameters: @@ -94,17 +96,6 @@ jobs: - template: /eng/common/pipelines/templates/steps/set-daily-docs-branch-name.yml parameters: DailyBranchVariableName: DailyDocsBranchName - - template: /eng/common/pipelines/templates/steps/sparse-checkout.yml - parameters: - SkipCheckoutNone: true - Paths: - - package.json - - metadata/ - - docs-ref-mapping/reference-unified.yml - - docs-ref-services/ - Repositories: - - Name: azure-sdk/$(DocRepoName) - WorkingDirectory: $(DailyDocRepoLocation) # Docs daily updates is supposed to download packages from public feed repository, so we have to specify additional repositories in a POM or the profile. # Here is maven documentation: https://maven.apache.org/guides/mini/guide-multiple-repositories.html diff --git a/eng/pipelines/latest-jdk.yml b/eng/pipelines/latest-jdk.yml index bac808656dbd..bc8d812db0ae 100644 --- a/eng/pipelines/latest-jdk.yml +++ b/eng/pipelines/latest-jdk.yml @@ -9,82 +9,94 @@ pr: - eng/pipelines/latest-jdk.yml - eng/scrips/Install-Latest-JDK.ps1 -variables: - - template: /eng/pipelines/templates/variables/globals.yml - -stages: - - stage: LatestJdk - displayName: Latest JDK - - jobs: - - job: RunLatestJdk - displayName: Run Latest JDK - timeoutInMinutes: 180 - - pool: - name: 'azsdk-pool-mms-ubuntu-2004-general' - vmImage: 'MMSUbuntu20.04' - - steps: - # Skip sparse checkout for the `azure-sdk-for--pr` private mirrored repositories - # as we require the GitHub service connection to be loaded. - - ${{ if not(contains(variables['Build.DefinitionName'], 'java-pr')) }}: - - template: /eng/common/pipelines/templates/steps/sparse-checkout.yml +parameters: + - name: Artifacts + type: object + default: + - name: latest-jdk # fake artifact name + groupId: run # fake group id + +extends: + template: /eng/pipelines/templates/stages/1es-redirect.yml + parameters: + UseOfficial: false + stages: + - stage: LatestJdk + variables: + - template: /eng/pipelines/templates/variables/globals.yml + - template: /eng/pipelines/templates/variables/image.yml + - name: ArtifactsJson + value: '${{ convertToJson(parameters.Artifacts) }}' + + displayName: Latest JDK + + jobs: + - job: RunLatestJdk + displayName: Run Latest JDK + timeoutInMinutes: 180 + + pool: + name: $(LINUXPOOL) + image: $(LINUXVMIMAGE) + os: linux + + steps: + # Skip sparse checkout for the `azure-sdk-for--pr` private mirrored repositories + # as we require the GitHub service connection to be loaded. + - ${{ if not(contains(variables['Build.DefinitionName'], 'java-pr')) }}: + - template: /eng/common/pipelines/templates/steps/sparse-checkout.yml + parameters: + Paths: + - '**/*.xml' + + - task: UsePythonVersion@0 + displayName: 'Use Python $(PythonVersion)' + inputs: + versionSpec: $(PythonVersion) + + - template: /eng/pipelines/templates/steps/generate-project-list-and-cache-maven-repository.yml + parameters: + JobType: 'LatestJdk' + + - task: PythonScript@0 + displayName: 'Generate FromSource POM and directories for sparse checkout' + inputs: + scriptPath: 'eng/scripts/generate_from_source_pom.py' + arguments: '--match-any-version --set-skip-linting-projects SkipLintingProjects --artifacts-list com.azure:azure-core' + workingDirectory: '$(System.DefaultWorkingDirectory)' + + - template: /eng/pipelines/templates/steps/sparse-checkout-repo-initialized.yml + parameters: + SkipCheckoutNone: true + Paths: $(SparseCheckoutDirectories) + + - template: /eng/pipelines/templates/steps/install-reporting-tools.yml + + - pwsh: | + Write-Host "##vso[task.setvariable variable=IsLatestNonLtsJdk;]true" + + - template: /eng/pipelines/templates/steps/install-latest-jdk.yml parameters: - Paths: - - '**/*.xml' - - - task: UsePythonVersion@0 - displayName: 'Use Python $(PythonVersion)' - inputs: - versionSpec: $(PythonVersion) - - - template: /eng/pipelines/templates/steps/generate-project-list-and-cache-maven-repository.yml - parameters: - JobType: 'LatestJdk' - Artifacts: - - name: latest-jdk # fake artifact name - groupId: run # fake group id - - - task: PythonScript@0 - displayName: 'Generate FromSource POM and directories for sparse checkout' - inputs: - scriptPath: 'eng/scripts/generate_from_source_pom.py' - arguments: '--match-any-version --set-skip-linting-projects SkipLintingProjects --artifacts-list com.azure:azure-core' - workingDirectory: '$(System.DefaultWorkingDirectory)' - - - template: /eng/common/pipelines/templates/steps/sparse-checkout.yml - parameters: - SkipCheckoutNone: true - Paths: $(SparseCheckoutDirectories) - - - template: /eng/pipelines/templates/steps/install-reporting-tools.yml - - - pwsh: | - Write-Host "##vso[task.setvariable variable=IsLatestNonLtsJdk;]true" - - - template: /eng/pipelines/templates/steps/install-latest-jdk.yml - parameters: - LatestJdkFeatureVersion: $(LatestNonLtsJdkFeatureVersion) - - - task: Maven@3 - displayName: 'Run All Libraries Latest JDK' - inputs: - mavenPomFile: ClientFromSourcePom.xml - options: '$(DefaultOptions) -T 1C -Dgpg.skip' - mavenOptions: '$(MemoryOptions) $(LoggingOptions)' - javaHomeOption: 'JDKVersion' - jdkVersionOption: $(LatestNonLtsJavaVersion) - jdkArchitectureOption: 'x64' - publishJUnitResults: false - goals: 'clean install' - continueOnError: true - - - task: PublishTestResults@2 - condition: always() - inputs: - testResultsFormat: 'JUnit' - testResultsFiles: '**/TEST-*.xml' - searchFolder: '$(System.DefaultWorkingDirectory)/sdk' - mergeTestResults: true - testRunTitle: '$(Agent.JobName)_attempt_$(System.JobAttempt)' + LatestJdkFeatureVersion: $(LatestNonLtsJdkFeatureVersion) + + - task: Maven@3 + displayName: 'Run All Libraries Latest JDK' + inputs: + mavenPomFile: ClientFromSourcePom.xml + options: '$(DefaultOptions) -T 1C -Dgpg.skip' + mavenOptions: '$(MemoryOptions) $(LoggingOptions)' + javaHomeOption: 'JDKVersion' + jdkVersionOption: $(LatestNonLtsJavaVersion) + jdkArchitectureOption: 'x64' + publishJUnitResults: false + goals: 'clean install' + continueOnError: true + + - task: PublishTestResults@2 + condition: always() + inputs: + testResultsFormat: 'JUnit' + testResultsFiles: '**/TEST-*.xml' + searchFolder: '$(System.DefaultWorkingDirectory)/sdk' + mergeTestResults: true + testRunTitle: '$(Agent.JobName)_attempt_$(System.JobAttempt)' diff --git a/eng/pipelines/partner-release.yml b/eng/pipelines/partner-release.yml index f696d6504a60..1d542b3e6c16 100644 --- a/eng/pipelines/partner-release.yml +++ b/eng/pipelines/partner-release.yml @@ -26,8 +26,9 @@ variables: jobs: - job: Signing pool: - name: azsdk-pool-mms-win-2022-general - vmImage: windows-2022 + name: $(WINDOWSPOOL) + vmImage: $(WINDOWSVMIMAGE) + os: windows steps: - checkout: azure-sdk-build-tools path: azure-sdk-build-tools @@ -50,8 +51,9 @@ jobs: - job: Release dependsOn: Signing pool: - name: azsdk-pool-mms-win-2022-general - vmImage: windows-2022 + name: $(WINDOWSPOOL) + vmImage: $(WINDOWSVMIMAGE) + os: windows steps: - checkout: self path: azure-sdk-for-java diff --git a/eng/pipelines/scripts/Get-Heap-Dump-Hprofs.ps1 b/eng/pipelines/scripts/Get-Heap-Dump-Hprofs.ps1 new file mode 100644 index 000000000000..638cfad369dc --- /dev/null +++ b/eng/pipelines/scripts/Get-Heap-Dump-Hprofs.ps1 @@ -0,0 +1,32 @@ +<# +.SYNOPSIS +Captures any .hprof files in the build directory and moves them to a staging directory for artifact publishing. + +.DESCRIPTION +This script is used to capture any .hprof files in the build directory and move them to a staging directory for +artifact publishing. It also sets a pipeline variable to indicate whether any .hprof files were found. + +.PARAMETER StagingDirectory +The directory where the .hprof files will be moved to. + +.PARAMETER OomArtifactName +The name of the artifact to be created. +#> + +param( + [Parameter(Mandatory = $true)] + [string]$StagingDirectory, + + [Parameter(Mandatory = $true)] + [string]$OomArtifactName +) + +$hrpofs = Get-ChildItem -Path . -Recurse -Filter *.hprof -File + +if ($hrpofs.Count -gt 0) { + if (-not (Test-Path "$StagingDirectory/troubleshooting")) { + New-Item -ItemType Directory -Path "$StagingDirectory/troubleshooting" | Out-Null + } + Compress-Archive -Path $hrpofs -DestinationPath "$StagingDirectory/troubleshooting/$OomArtifactName.zip" + Write-Host "##vso[task.setvariable variable=HAS_TROUBLESHOOTING]true" +} diff --git a/eng/pipelines/scripts/Get-Linting-Reports.ps1 b/eng/pipelines/scripts/Get-Linting-Reports.ps1 index e642e9c68b88..1e68d67c9096 100644 --- a/eng/pipelines/scripts/Get-Linting-Reports.ps1 +++ b/eng/pipelines/scripts/Get-Linting-Reports.ps1 @@ -19,8 +19,8 @@ For Checkstyle the XML report will have the file name, line number, column numbe error reported. For Spotbugs the XML will have the file name, line number, linting error message, and linting error reported, Spotbugs doesn't report the column number. -.PARAMETER OutputDirectory -Where the linting report retrieval and processing will be output. +.PARAMETER StagingDirectory +The directory where the linting reports will be output. .PARAMETER SdkDirectory An optional SDK directory, such as core, that scopes the linting report searching and processing to the specific SDK @@ -29,7 +29,7 @@ directory. If this isn't passed all SDK directories will be searched and process param( [Parameter(Mandatory = $true)] - [string]$OutputDirectory, + [string]$StagingDirectory, [Parameter(Mandatory = $false)] [string]$SdkDirectory @@ -106,7 +106,7 @@ function WriteSpotbugsProcessedReport($SpotbugsXmlReport, $ReportOutputFolder) { Set-Location -ErrorAction Stop -LiteralPath (Join-Path $PSScriptRoot "../../../") # Always create the output directory -$OutputDirectory = $ExecutionContext.SessionState.Path.GetUnresolvedProviderPathFromPSPath($OutputDirectory) +$OutputDirectory = $ExecutionContext.SessionState.Path.GetUnresolvedProviderPathFromPSPath("$StagingDirectory/linting-report") New-Item -Path $OutputDirectory -ItemType Directory | Out-Null $path = "sdk/*/" @@ -144,4 +144,9 @@ foreach ($targetFolder in (Get-ChildItem -Path $path -Filter "target" -Directory } } -[System.IO.Compression.ZipFile]::CreateFromDirectory($OutputDirectory, $OutputDirectory + ".zip") +if (-not (Test-Path "$StagingDirectory/troubleshooting")) { + New-Item -ItemType Directory -Path "$StagingDirectory/troubleshooting" | Out-Null +} + +Compress-Archive -Path $OutputDirectory -DestinationPath "$StagingDirectory/troubleshooting/linting-report.zip" +Write-Host "##vso[task.setvariable variable=HAS_TROUBLESHOOTING]true" diff --git a/eng/pipelines/scripts/Get-Test-Logs.ps1 b/eng/pipelines/scripts/Get-Test-Logs.ps1 new file mode 100644 index 000000000000..53d2effe4aa4 --- /dev/null +++ b/eng/pipelines/scripts/Get-Test-Logs.ps1 @@ -0,0 +1,32 @@ +<# +.SYNOPSIS +Captures any test.log files in the build directory and moves them to a staging directory for artifact publishing. + +.DESCRIPTION +This script is used to capture any test.log files in the build directory and move them to a staging directory for +artifact publishing. It also sets a pipeline variable to indicate whether any test.log files were found. + +.PARAMETER StagingDirectory +The directory where the test.log files will be moved to. + +.PARAMETER TestLogsArtifactName +The name of the artifact to be created. +#> + +param( + [Parameter(Mandatory = $true)] + [string]$StagingDirectory, + + [Parameter(Mandatory = $true)] + [string]$TestLogsArtifactName +) + +$testLogs = Get-ChildItem -Path . -Recurse -Filter test.log -File -Depth 4 + +if ($testLogs.Count -gt 0) { + if (-not (Test-Path "$StagingDirectory/troubleshooting")) { + New-Item -ItemType Directory -Path "$StagingDirectory/troubleshooting" | Out-Null + } + Write-Host "##vso[task.setvariable variable=HAS_TROUBLESHOOTING]true" + Compress-Archive -Path $testLogs -DestinationPath "$StagingDirectory/troubleshooting/$TestLogsArtifactName.zip" +} diff --git a/eng/pipelines/scripts/Invoke-Sparse-Checkout.ps1 b/eng/pipelines/scripts/Invoke-Sparse-Checkout.ps1 new file mode 100644 index 000000000000..db43a1fe2155 --- /dev/null +++ b/eng/pipelines/scripts/Invoke-Sparse-Checkout.ps1 @@ -0,0 +1,104 @@ +<# +.SYNOPSIS +Invokes sparse checkout on the specified repositories. + +.DESCRIPTION +Invokes sparse checkout on the specified repositories. + +This script is special to Java as it uses layered sparse checkout to reduce the amount of code to checkout. +The first run of sparse checkout is inlined into YAML as there is a chicken and egg problem where the script +to perform sparse checkout won't be available until after the checkout step has completed. + +This script is used to reduce the size of YAML files as this is only called when the initial checkout has +already been completed. + +.PARAMETER PathsJson +JSON representation of the paths to checkout. + +.PARAMETER RepositoriesJson +JSON representation of the repositories to checkout from. +#> + +param( + [Parameter(Mandatory = $true)] + [string]$PathsJson, + + [Parameter(Mandatory = $true)] + [string]$RepositoriesJson +) + +# Setting $PSNativeCommandArgumentPassing to 'Legacy' to use PowerShell +# 7.2 behavior for command argument passing. Newer behaviors will result +# in errors from git.exe. +$PSNativeCommandArgumentPassing = 'Legacy' + +function SparseCheckout([Array]$paths, [Hashtable]$repository) +{ + $dir = $repository.WorkingDirectory + if (!$dir) { + $dir = "./$($repository.Name)" + } + New-Item $dir -ItemType Directory -Force | Out-Null + Push-Location $dir + + if (Test-Path .git/info/sparse-checkout) { + $hasInitialized = $true + Write-Host "Repository $($repository.Name) has already been initialized. Skipping this step." + } else { + Write-Host "Repository $($repository.Name) is being initialized." + + if ($repository.Commitish -match '^refs/pull/\d+/merge$') { + Write-Host "git clone --no-checkout --filter=tree:0 -c remote.origin.fetch='+$($repository.Commitish):refs/remotes/origin/$($repository.Commitish)' https://github.com/$($repository.Name) ." + git clone --no-checkout --filter=tree:0 -c remote.origin.fetch=''+$($repository.Commitish):refs/remotes/origin/$($repository.Commitish)'' https://github.com/$($repository.Name) . + } else { + Write-Host "git clone --no-checkout --filter=tree:0 https://github.com/$($repository.Name) ." + git clone --no-checkout --filter=tree:0 https://github.com/$($repository.Name) . + } + + # Turn off git GC for sparse checkout. Note: The devops checkout task does this by default + Write-Host "git config gc.auto 0" + git config gc.auto 0 + + Write-Host "git sparse-checkout init" + git sparse-checkout init + + # Set non-cone mode otherwise path filters will not work in git >= 2.37.0 + # See https://github.blog/2022-06-27-highlights-from-git-2-37/#tidbits + Write-Host "git sparse-checkout set --no-cone '/*' '!/*/' '/eng'" + git sparse-checkout set --no-cone '/*' '!/*/' '/eng' + } + + # Prevent wildcard expansion in Invoke-Expression (e.g. for checkout path '/*') + $quotedPaths = $paths | ForEach-Object { "'$_'" } + $gitsparsecmd = "git sparse-checkout add $quotedPaths" + Write-Host $gitsparsecmd + Invoke-Expression -Command $gitsparsecmd + + Write-Host "Set sparse checkout paths to:" + Get-Content .git/info/sparse-checkout + + # sparse-checkout commands after initial checkout will auto-checkout again + if (!$hasInitialized) { + # Remove refs/heads/ prefix from branch names + $commitish = $repository.Commitish -replace '^refs/heads/', '' + + # use -- to prevent git from interpreting the commitish as a path + Write-Host "git -c advice.detachedHead=false checkout $commitish --" + + # This will use the default branch if repo.Commitish is empty + git -c advice.detachedHead=false checkout $commitish -- + } else { + Write-Host "Skipping checkout as repo has already been initialized" + } + + Pop-Location +} + +# Paths may be sourced as a yaml object literal OR a dynamically generated variable json string. +# If the latter, convertToJson will wrap the 'string' in quotes, so remove them. +$paths = $PathsJson.Trim('"') | ConvertFrom-Json +# Replace windows backslash paths, as Azure Pipelines default directories are sometimes formatted like 'D:\a\1\s' +$repositories = $RepositoriesJson -replace '\\', '/' | ConvertFrom-Json -AsHashtable +foreach ($repo in $repositories) { + SparseCheckout $paths $repo +} diff --git a/eng/pipelines/scripts/Set-Dev-Versioning.ps1 b/eng/pipelines/scripts/Set-Dev-Versioning.ps1 new file mode 100644 index 000000000000..fde1b25de967 --- /dev/null +++ b/eng/pipelines/scripts/Set-Dev-Versioning.ps1 @@ -0,0 +1,37 @@ +<# +.SYNOPSIS +Sets the dev version for the SDKs and updates the repository with the new version. + +.DESCRIPTION +Sets the dev version for the SDKs and updates the repository with the new version. + +The dev version is based on the date and the build number. The dev version is then published to the Azure Artifacts feed. + +.PARAMETER BuildNumber +The build number to use for the dev version. + +.PARAMETER SdkType +The type of SDK to set the dev version for. +#> + +param( + [Parameter(Mandatory = $true)] + [string]$BuildNumber, + + [Parameter(Mandatory = $true)] + [string]$SdkType +) + +$artifacts = $env:ARTIFACTSJSON | ConvertFrom-Json +python3 --version + +# Append dev package version suffix for each artifact +foreach ($artifact in $artifacts) { + python3 "$PSScriptRoot/../../versioning/set_versions.py" --build-type $SDKType --build-qualifier "alpha.$BuildNumber" --artifact-id $artifact.name --group-id $artifact.groupId +} + +# Set zero-dev-version for packages +python3 "$PSScriptRoot/../../versioning/set_versions.py" --set-dev-zero-version --build-type $SDKType --build-qualifier "alpha.$BuildNumber" + +# Apply version settings to repository +python3 "$PSScriptRoot/../../versioning/update_versions.py" --update-type library --build-type $SDKType --sr diff --git a/eng/pipelines/scripts/generate-project-list.ps1 b/eng/pipelines/scripts/generate-project-list.ps1 new file mode 100644 index 000000000000..72dded99fd8c --- /dev/null +++ b/eng/pipelines/scripts/generate-project-list.ps1 @@ -0,0 +1,42 @@ +$projectList = @() +$artifactsList = @() +$additionalModulesList = @() + +if ($env:ARTIFACTSJSON -and $env:ARTIFACTSJSON -notlike '*ArtifactsJson*') { + $artifacts = $env:ARTIFACTSJSON | ConvertFrom-Json + foreach ($artifact in $artifacts) { + $projectList += "$($artifact.groupId):$($artifact.name)" + $artifactsList += "$($artifact.groupId):$($artifact.name)" + } +} + +# Check if empty or still a literal devops variable reference $() +if ($env:ADDITIONALMODULESJSON -and $env:ADDITIONALMODULESJSON -notlike '*AdditionalModulesJson*') { + $additionalModules = $env:ADDITIONALMODULESJSON | ConvertFrom-Json + foreach ($artifact in $additionalModules) { + $projectList += "$($artifact.groupId):$($artifact.name)" + $additionalModulesList += "$($artifact.groupId):$($artifact.name)" + } +} + +$projects = $projectList -join ',' +if (!$projects) { + throw "parameters.Artifacts cannot be empty" +} + +$artifactsString = $artifactsList -join ',' +Write-Host "ArtifactsList = $artifactsString" +Write-Host "##vso[task.setvariable variable=ArtifactsList;]$artifactsString" + +$additionalModulesString = $additionalModulesList -join ',' +Write-Host "AdditionalModulesList = $additionalModulesString" +Write-Host "##vso[task.setvariable variable=AdditionalModulesList;]$additionalModulesString" + +Write-Host "ProjectList = $projects" +Write-Host "##vso[task.setvariable variable=ProjectList;]$projects" + +$sha256 = new-object -TypeName System.Security.Cryptography.SHA256Managed +$utf8 = new-object -TypeName System.Text.UTF8Encoding + +$projectListSha256 = [Convert]::ToBase64String($sha256.ComputeHash($utf8.GetBytes($projects))) +Write-Host "##vso[task.setvariable variable=ProjectListSha256;]$projectListSha256" diff --git a/eng/pipelines/templates/jobs/build-validate-pom.yml b/eng/pipelines/templates/jobs/build-validate-pom.yml index 07d80b3463a0..01f5021e04b9 100644 --- a/eng/pipelines/templates/jobs/build-validate-pom.yml +++ b/eng/pipelines/templates/jobs/build-validate-pom.yml @@ -13,12 +13,18 @@ jobs: - job: 'BuildAndValidate' displayName: 'Build and Validate' - variables: - - template: /eng/pipelines/templates/variables/globals.yml + templateContext: + outputs: + - output: pipelineArtifact + displayName: 'Capture repo state for analysis' + targetPath: '$(System.DefaultWorkingDirectory)' + artifactName: 'repository' + sbomEnabled: false pool: - name: azsdk-pool-mms-ubuntu-2004-general - vmImage: MMSUbuntu20.04 + name: $(LINUXPOOL) + image: $(LINUXVMIMAGE) + os: linux strategy: matrix: @@ -54,7 +60,6 @@ jobs: - template: /eng/pipelines/templates/steps/generate-project-list-and-cache-maven-repository.yml parameters: JobType: 'Build and Validate' - Artifacts: ${{ parameters.Artifacts }} # We `install` the code quality reports tooling into our local m2 cache separately from building the Maven project # reports. This means it is available as part of that, but also so that this is not documented in the project report. @@ -85,11 +90,7 @@ jobs: -Artifacts ('${{ replace(convertToJson(parameters.Artifacts), '''', '`''') }}' | ConvertFrom-Json) -InformationAction Continue - - publish: $(Build.ArtifactStagingDirectory) - displayName: 'Publish Artifacts $(ArtifactName)' - artifact: '$(ArtifactName)' - - - publish: $(System.DefaultWorkingDirectory) - condition: and(eq(variables['CaptureRepositoryOnFailure'], 'true'), failed()) - displayName: 'Capture repo state for analysis' - artifact: repository + - template: /eng/common/pipelines/templates/steps/publish-1es-artifact.yml + parameters: + ArtifactPath: '$(Build.ArtifactStagingDirectory)' + ArtifactName: '$(ArtifactName)' diff --git a/eng/pipelines/templates/jobs/ci.tests.yml b/eng/pipelines/templates/jobs/ci.tests.yml index 8096ae2e2382..a24390f7c99e 100644 --- a/eng/pipelines/templates/jobs/ci.tests.yml +++ b/eng/pipelines/templates/jobs/ci.tests.yml @@ -8,23 +8,17 @@ parameters: - name: TestPipeline type: boolean default: false - - name: Artifacts - type: object - default: [] - - name: AdditionalModules - type: object - default: [] - name: PreTestSteps type: object default: [] - name: Matrix - type: object + type: string - name: CloudConfig type: object default: {} - name: DependsOn - type: string - default: '' + type: object + default: [] - name: UsePlatformContainer type: boolean default: false @@ -46,18 +40,28 @@ parameters: - name: AdditionalLintingOptions type: string default: '' + - name: OSName + type: string jobs: - - job: 'Test' - dependsOn: ${{ parameters.DependsOn }} - condition: and(succeeded(), ne(variables['Skip.Test'], 'true')) + - job: + displayName: 'Test' + dependsOn: + - ${{ parameters.DependsOn }} + condition: and(succeeded(), ne(variables['Skip.Test'], 'true'), ne(${{ parameters.Matrix }}, '{}')) strategy: matrix: $[ ${{ parameters.Matrix }} ] pool: + # 1es pipeline templates converts `image` to demands: ImageOverride under the hood + # which is incompatible with image selection in the default non-1es hosted pools + ${{ if eq(parameters.OSName, 'macOS') }}: + vmImage: $(OSVmImage) + ${{ else }}: + image: $(OSVmImage) name: $(Pool) - vmImage: $(OSVmImage) + os: ${{ parameters.OSName }} ${{ if eq(parameters.UsePlatformContainer, 'true') }}: # Add a default so the job doesn't fail when the matrix is empty @@ -66,14 +70,30 @@ jobs: variables: - template: /eng/pipelines/templates/variables/globals.yml + templateContext: + outputParentDirectory: '$(System.DefaultWorkingDirectory)' + outputs: + # Troubleshooting artifacts are creating in the staging directory under the folder 'troubleshooting'. + # This will contain things such as heap dumps hprofs if testing hit OutOfMemory errors, log files captured + # during testing if tests failed, and linting reports. + - output: pipelineArtifact + artifactName: troubleshooting-$(System.StageName)-$(System.JobName) + targetPath: $(System.DefaultWorkingDirectory)/troubleshooting + displayName: 'Capture troubleshooting artifacts' + condition: and(not(succeeded()), eq(variables['HAS_TROUBLESHOOTING'], 'true')) + sbomEnabled: false + + - output: pipelineArtifact + artifactName: 'repository-$(System.JobName)' + targetPath: '$(System.DefaultWorkingDirectory)' + displayName: 'Capture repo state for analysis' + condition: or(eq(variables['CaptureRepositoryOnFailure'], 'true'), and(failed(), eq(variables['Build.Reason'],'Schedule'))) + sbomEnabled: false + steps: - template: /eng/pipelines/templates/steps/initialize-test-environment.yml parameters: - Artifacts: ${{ parameters.Artifacts }} - AdditionalModules: ${{ parameters.AdditionalModules }} - ServiceDirectory: ${{ parameters.ServiceDirectory }} CheckoutRecordings: true - SDKType: ${{ parameters.SDKType }} - template: /eng/common/testproxy/test-proxy-tool.yml parameters: @@ -117,14 +137,14 @@ jobs: - template: /eng/pipelines/templates/steps/build-and-test.yml parameters: - SDKType: ${{ parameters.SDKType }} - ServiceDirectory: ${{ parameters.ServiceDirectory }} ParallelTestPlayback: 'true' TestGoals: ${{ parameters.TestGoals }} TestOptions: ${{ parameters.TestOptions }} TestParallelization: ${{ parameters.TestParallelization }} BuildParallelization: ${{ parameters.BuildParallelization }} - - template: /eng/pipelines/templates/steps/upload-repository-on-failure.yml + - template: /eng/pipelines/templates/steps/clean-maven-local-cache.yml - - template: /eng/common/testproxy/publish-proxy-logs.yml + # Shut down proxy to prevent file locks on the log file for auto-injected credscan + # steps on windows + - template: /eng/common/testproxy/test-proxy-tool-shutdown.yml diff --git a/eng/pipelines/templates/jobs/ci.versions.tests.yml b/eng/pipelines/templates/jobs/ci.versions.tests.yml index 5fc0caeb8ab8..c822d5e69e6a 100644 --- a/eng/pipelines/templates/jobs/ci.versions.tests.yml +++ b/eng/pipelines/templates/jobs/ci.versions.tests.yml @@ -2,18 +2,12 @@ parameters: - name: SDKType type: string default: client - - name: ServiceDirectory - type: string - default: 'not-specified' # Set a default that breaks in obvious ways. - - name: TestPipeline - type: boolean - default: false - name: Artifacts type: object default: [] - - name: AdditionalModules - type: object - default: [] + - name: TestPipeline + type: boolean + default: false - name: PreTestSteps type: object default: [] @@ -43,12 +37,40 @@ jobs: - job: condition: ne(variables['Skip.Test'], 'true') - pool: - name: 'azsdk-pool-mms-ubuntu-2004-general' - vmImage: 'MMSUbuntu20.04' - variables: - template: /eng/pipelines/templates/variables/globals.yml + - template: /eng/pipelines/templates/variables/image.yml + # Convert artifact parameter objects to json and set them as variables to be used in + # pipeline jobs/stages. By setting these as a variable once we save thousands of lines + # of yaml in extreme cases. This helps us stay under the devops max yaml size limits. + - name: ArtifactsJson + value: '${{ convertToJson(parameters.Artifacts) }}' + + pool: + name: $(LINUXPOOL) + image: $(LINUXVMIMAGE) + os: linux + + templateContext: + outputParentDirectory: '$(System.DefaultWorkingDirectory)' + outputs: + - output: pipelineArtifact + artifactName: 'repository-$(System.JobName)' + targetPath: '$(System.DefaultWorkingDirectory)' + displayName: 'Capture repo state for analysis' + condition: or(eq(variables['CaptureRepositoryOnFailure'], 'true'), and(failed(), eq(variables['Build.Reason'],'Schedule'))) + sbomEnabled: false + + - ${{ each versionOverride in parameters.VersionOverrides }}: + # Troubleshooting artifacts are creating in the staging directory under the folder 'troubleshooting'. + # This will contain things such as heap dumps hprofs if testing hit OutOfMemory errors, log files captured + # during testing if tests failed, and linting reports. + - output: pipelineArtifact + artifactName: 'troubleshooting-vo-${{ versionOverride }}-troubleshooting-$(System.StageName)-$(System.JobName)' + targetPath: $(System.DefaultWorkingDirectory)/troubleshooting + displayName: 'Capture troubleshooting artifacts for version override ${{ versionOverride }}' + condition: and(not(succeeded()), eq(variables['HAS_TROUBLESHOOTING'], 'true')) + sbomEnabled: false steps: - pwsh: | @@ -58,12 +80,8 @@ jobs: - template: /eng/pipelines/templates/steps/initialize-test-environment.yml parameters: - Artifacts: ${{ parameters.Artifacts }} - AdditionalModules: ${{ parameters.AdditionalModules }} - ServiceDirectory: ${{ parameters.ServiceDirectory }} CheckoutRecordings: true - SDKType: ${{ parameters.SDKType }} - OSVmImage: 'MMSUbuntu20.04' + OS: $(LINUXVMIMAGE) - template: /eng/common/testproxy/test-proxy-tool.yml parameters: @@ -90,8 +108,6 @@ jobs: - ${{ each versionOverride in parameters.VersionOverrides }}: - template: /eng/pipelines/templates/steps/build-and-test.yml parameters: - SDKType: ${{ parameters.SDKType }} - ServiceDirectory: ${{ parameters.ServiceDirectory }} ParallelTestPlayback: 'true' TestGoals: ${{ parameters.TestGoals }} TestOptions: ${{ parameters.TestOptions }} @@ -104,6 +120,4 @@ jobs: Write-Host "##vso[task.setvariable variable=FirstTestOverrideRan]true" displayName: "Reset version override changes" - - template: /eng/pipelines/templates/steps/upload-repository-on-failure.yml - - - template: /eng/common/testproxy/publish-proxy-logs.yml + - template: /eng/pipelines/templates/steps/clean-maven-local-cache.yml diff --git a/eng/pipelines/templates/jobs/ci.yml b/eng/pipelines/templates/jobs/ci.yml index 06d86d4cd4d6..3e85fce0299c 100644 --- a/eng/pipelines/templates/jobs/ci.yml +++ b/eng/pipelines/templates/jobs/ci.yml @@ -14,9 +14,6 @@ parameters: - name: ReleaseArtifacts type: object default: [] - - name: AdditionalModules - type: object - default: [] - name: PreTestSteps type: object default: [] @@ -69,7 +66,32 @@ jobs: Codeql.SkipTaskAutoInjection: false pool: - name: azsdk-pool-mms-ubuntu-2004-general + name: $(LINUXPOOL) + image: $(LINUXVMIMAGE) + os: linux + + templateContext: + outputParentDirectory: '$(System.DefaultWorkingDirectory)' + outputs: + - output: pipelineArtifact + artifactName: '$(ArtifactName)' + targetPath: $(Build.ArtifactStagingDirectory) + # Troubleshooting artifacts are creating in the staging directory under the folder 'troubleshooting'. + # This will contain things such as heap dumps hprofs if testing hit OutOfMemory errors, log files captured + # during testing if tests failed, and linting reports. + - output: pipelineArtifact + artifactName: troubleshooting-$(System.StageName)-$(System.JobName) + targetPath: $(System.DefaultWorkingDirectory)/troubleshooting + displayName: 'Capture troubleshooting artifacts' + condition: and(not(succeeded()), eq(variables['HAS_TROUBLESHOOTING'], 'true')) + sbomEnabled: false + + - output: pipelineArtifact + artifactName: 'repository-$(System.JobName)' + targetPath: '$(System.DefaultWorkingDirectory)' + displayName: 'Capture repo state for analysis' + condition: or(eq(variables['CaptureRepositoryOnFailure'], 'true'), and(failed(), eq(variables['Build.Reason'],'Schedule'))) + sbomEnabled: false steps: # Skip sparse checkout for the `azure-sdk-for--pr` private mirrored repositories @@ -85,8 +107,6 @@ jobs: - template: /eng/pipelines/templates/steps/generate-project-list-and-cache-maven-repository.yml parameters: - Artifacts: ${{parameters.Artifacts}} - AdditionalModules: ${{parameters.AdditionalModules}} JobType: 'Build' - task: UsePythonVersion@0 @@ -108,7 +128,7 @@ jobs: # Skip sparse checkout for the `azure-sdk-for--pr` private mirrored repositories # as we require the GitHub service connection to be loaded. - ${{ if not(contains(variables['Build.DefinitionName'], 'java-pr')) }}: - - template: /eng/common/pipelines/templates/steps/sparse-checkout.yml + - template: /eng/pipelines/templates/steps/sparse-checkout-repo-initialized.yml parameters: Paths: $(SparseCheckoutDirectories) SkipCheckoutNone: true @@ -130,22 +150,16 @@ jobs: parameters: ServiceDirectory: ${{parameters.ServiceDirectory}} - - pwsh: | - $artifacts = '${{ convertToJson(parameters.Artifacts) }}' | ConvertFrom-Json - python3 --version - - # Append dev package version suffix for each artifact - foreach ($artifact in $artifacts) { - python3 eng/versioning/set_versions.py --build-type ${{parameters.SDKType}} --build-qualifier alpha.$(Build.BuildNumber) --artifact-id $artifact.name --group-id $artifact.groupId - } - - # Set zero-dev-version for packages - python3 eng/versioning/set_versions.py --set-dev-zero-version --build-type ${{parameters.SDKType}} --build-qualifier alpha.$(Build.BuildNumber) - - # Apply version settings to repository - python3 eng/versioning/update_versions.py --update-type library --build-type ${{parameters.SDKType}} --sr - condition: and(succeeded(), eq(variables['SetDevVersion'],'true')) + - task: PowerShell@2 displayName: Setup Dev versioning + inputs: + pwsh: true + filePath: eng/pipelines/scripts/Set-Dev-Versioning.ps1 + arguments: > + -BuildNumber $(Build.BuildNumber) + -SdkType ${{parameters.SDKType}} + env: + ARTIFACTSJSON: $(ArtifactsJson) - ${{if ne(parameters.ServiceDirectory, '')}}: - task: Powershell@2 @@ -184,7 +198,7 @@ jobs: filePath: eng/scripts/Verify-Required-Maven-Artifacts.ps1 arguments: > -BuildOutputDirectory $(System.DefaultWorkingDirectory)/build - -ArtifactsList ('${{ convertToJson(parameters.Artifacts) }}' | ConvertFrom-Json | Select-Object name, groupId) + -ArtifactsList ('$(ArtifactsJson)' | ConvertFrom-Json | Select-Object name, groupId) -InformationAction Continue - task: PowerShell@2 @@ -203,35 +217,39 @@ jobs: parameters: Artifacts: ${{parameters.ReleaseArtifacts}} - - template: /eng/common/pipelines/templates/steps/publish-artifact.yml - parameters: - ArtifactPath: $(Build.ArtifactStagingDirectory) - ArtifactName: '$(ArtifactName)' - - - ${{if eq(variables['System.TeamProject'], 'internal') }}: - - task: AzureArtifacts.manifest-generator-task.manifest-generator-task.ManifestGeneratorTask@0 - displayName: 'Generate SBOM' - condition: succeededOrFailed() - inputs: - BuildDropPath: $(Build.ArtifactStagingDirectory) - - - template: /eng/common/pipelines/templates/steps/publish-artifact.yml - parameters: - ArtifactPath: '$(Build.ArtifactStagingDirectory)/_manifest' - ArtifactName: 'manifest' - - template: /eng/common/pipelines/templates/steps/detect-api-changes.yml parameters: Artifacts: ${{parameters.Artifacts}} - - template: /eng/pipelines/templates/steps/upload-repository-on-failure.yml + - template: /eng/pipelines/templates/steps/clean-maven-local-cache.yml - job: 'Analyze' condition: and(succeeded(), ne(variables['Skip.Analyze'], 'true')) pool: - name: azsdk-pool-mms-ubuntu-2004-general - vmImage: MMSUbuntu20.04 + name: $(LINUXPOOL) + image: $(LINUXVMIMAGE) + os: linux + + templateContext: + outputParentDirectory: '$(System.DefaultWorkingDirectory)' + outputs: + - output: pipelineArtifact + artifactName: 'repository-$(System.JobName)' + targetPath: '$(System.DefaultWorkingDirectory)' + displayName: 'Capture repo state for analysis' + condition: or(eq(variables['CaptureRepositoryOnFailure'], 'true'), and(failed(), eq(variables['Build.Reason'],'Schedule'))) + sbomEnabled: false + + # Troubleshooting artifacts are creating in the staging directory under the folder 'troubleshooting'. + # This will contain things such as heap dumps hprofs if testing hit OutOfMemory errors, log files captured + # during testing if tests failed, and linting reports. + - output: pipelineArtifact + artifactName: troubleshooting-$(System.StageName)-$(System.JobName) + targetPath: $(System.DefaultWorkingDirectory)/troubleshooting + displayName: 'Capture troubleshooting artifacts' + condition: and(not(succeeded()), eq(variables['HAS_TROUBLESHOOTING'], 'true')) + sbomEnabled: false steps: - task: UsePythonVersion@0 @@ -261,8 +279,6 @@ jobs: - template: /eng/pipelines/templates/steps/generate-project-list-and-cache-maven-repository.yml parameters: - Artifacts: ${{ parameters.Artifacts }} - AdditionalModules: ${{ parameters.AdditionalModules }} JobType: 'Analyze' - task: PowerShell@2 @@ -277,7 +293,7 @@ jobs: # Skip sparse checkout for the `azure-sdk-for--pr` private mirrored repositories # as we require the GitHub service connection to be loaded. - ${{ if not(contains(variables['Build.DefinitionName'], 'java-pr')) }}: - - template: /eng/common/pipelines/templates/steps/sparse-checkout.yml + - template: /eng/pipelines/templates/steps/sparse-checkout-repo-initialized.yml parameters: Paths: $(SparseCheckoutDirectories) SkipCheckoutNone: true @@ -357,68 +373,16 @@ jobs: RunLinting: true SDKType: ${{ parameters.SDKType }} - - template: /eng/pipelines/templates/steps/upload-repository-on-failure.yml + - template: /eng/pipelines/templates/steps/clean-maven-local-cache.yml - template: /eng/common/pipelines/templates/steps/eng-common-workflow-enforcer.yml - - job: Compliance - variables: - - template: /eng/pipelines/templates/variables/globals.yml - - pool: - name: azsdk-pool-mms-win-2022-general - vmImage: windows-2022 - - steps: - # Skip sparse checkout for the `azure-sdk-for--pr` private mirrored repositories - # as we require the GitHub service connection to be loaded. - - ${{ if not(contains(variables['Build.DefinitionName'], 'java-pr')) }}: - - template: /eng/common/pipelines/templates/steps/sparse-checkout.yml - parameters: - Paths: - - '**/*.xml' - - # For PullRequests CredScan will be run against the files changed in the PR. - # For non-pull requests CredScan - - ${{if eq(variables['Build.Reason'], 'PullRequest')}}: - - task: PowerShell@2 - displayName: 'Determine files changed in PR for sparse-checkout' - inputs: - pwsh: true - filePath: eng/pipelines/scripts/Set-CredScanCheckoutDirectories.ps1 - - ${{else}}: - - template: /eng/pipelines/templates/steps/generate-project-list-and-cache-maven-repository.yml - parameters: - Artifacts: ${{ parameters.Artifacts }} - AdditionalModules: ${{ parameters.AdditionalModules }} - JobType: 'Compliance' - UseCache: false - - - task: PowerShell@2 - displayName: Generate directories variable for sparse checkout - inputs: - pwsh: true - filePath: $(Build.SourcesDirectory)/eng/scripts/Generate-ServiceDirectories-From-Project-List.ps1 - arguments: > - -SourcesDirectory $(Build.SourcesDirectory) - -ProjectList $(ProjectList) - - # Skip sparse checkout for the `azure-sdk-for--pr` private mirrored repositories - # as we require the GitHub service connection to be loaded. - - ${{ if not(contains(variables['Build.DefinitionName'], 'java-pr')) }}: - - template: /eng/common/pipelines/templates/steps/sparse-checkout.yml - parameters: - SkipCheckoutNone: true - Paths: $(SparseCheckoutDirectories) - - - template: /eng/common/pipelines/templates/steps/credscan.yml - parameters: - ServiceDirectory: ${{ parameters.ServiceDirectory }} - BaselineFilePath: $(Build.SourcesDirectory)\eng\java.gdnbaselines - - - template: /eng/common/pipelines/templates/jobs/archetype-sdk-tests-generate.yml + - template: /eng/common/pipelines/templates/jobs/generate-job-matrix.yml parameters: JobTemplatePath: /eng/pipelines/templates/jobs/ci.tests.yml + OsVmImage: $(LINUXVMIMAGE) + Pool: $(LINUXPOOL) + Os: linux MatrixConfigs: ${{ parameters.MatrixConfigs }} MatrixFilters: ${{ parameters.MatrixFilters }} MatrixReplace: ${{ parameters.MatrixReplace }} @@ -428,8 +392,6 @@ jobs: SDKType: ${{ parameters.SDKType }} ServiceDirectory: ${{ parameters.ServiceDirectory }} TestPipeline: ${{ parameters.TestPipeline }} - Artifacts: ${{ parameters.Artifacts }} - AdditionalModules: ${{ parameters.AdditionalModules }} PreTestSteps: ${{ parameters.PreTestSteps }} PreBuildSteps: ${{ parameters.PreBuildSteps }} TestGoals: ${{ parameters.TestGoals }} diff --git a/eng/pipelines/templates/jobs/live.tests.yml b/eng/pipelines/templates/jobs/live.tests.yml index 912801af8aa8..d7c9009131b1 100644 --- a/eng/pipelines/templates/jobs/live.tests.yml +++ b/eng/pipelines/templates/jobs/live.tests.yml @@ -1,8 +1,6 @@ parameters: ServiceDirectory: '' TestResourceDirectories: - Artifacts: [] - AdditionalModules: [] EnvVars: {} MaxParallel: 0 PreSteps: [] @@ -23,6 +21,7 @@ parameters: TestParallelization: '1' TestVersionSupport: $(TestVersionSupport) UseHttpFaultInjector: false + OSName: jobs: - job: @@ -33,27 +32,49 @@ jobs: matrix: $[ ${{ parameters.Matrix }} ] variables: - - template: /eng/pipelines/templates/variables/globals.yml - name: ArmTemplateParameters value: '@{}' timeoutInMinutes: ${{ parameters.TimeoutInMinutes }} pool: + # 1es pipeline templates converts `image` to demands: ImageOverride under the hood + # which is incompatible with image selection in the default non-1es hosted pools + ${{ if eq(parameters.OSName, 'macOS') }}: + vmImage: $(OSVmImage) + ${{ else }}: + image: $(OSVmImage) name: $(Pool) - vmImage: $(OSVmImage) + os: ${{ parameters.OSName }} ${{ if eq(parameters.UsePlatformContainer, 'true') }}: # Add a default so the job doesn't fail when the matrix is empty container: $[ variables['Container'] ] + templateContext: + outputParentDirectory: '$(System.DefaultWorkingDirectory)' + outputs: + # Troubleshooting artifacts are creating in the staging directory under the folder 'troubleshooting'. + # This will contain things such as heap dumps hprofs if testing hit OutOfMemory errors, log files captured + # during testing if tests failed, and linting reports. + - output: pipelineArtifact + artifactName: troubleshooting-$(System.StageName)-$(System.JobName) + targetPath: $(System.DefaultWorkingDirectory)/troubleshooting + displayName: 'Capture troubleshooting artifacts' + condition: and(not(succeeded()), eq(variables['HAS_TROUBLESHOOTING'], 'true')) + sbomEnabled: false + + - output: pipelineArtifact + artifactName: 'repository-$(System.JobName)' + targetPath: '$(System.DefaultWorkingDirectory)' + displayName: 'Capture repo state for analysis' + condition: or(eq(variables['CaptureRepositoryOnFailure'], 'true'), and(failed(), eq(variables['Build.Reason'],'Schedule'))) + sbomEnabled: false + steps: - template: /eng/pipelines/templates/steps/initialize-test-environment.yml parameters: - Artifacts: ${{ parameters.Artifacts }} - AdditionalModules: ${{ parameters.AdditionalModules }} - ServiceDirectory: ${{ parameters.ServiceDirectory }} - SDKType: ${{ parameters.SDKType }} + OS: ${{ parameters.OSName }} # macOS has known issues running HTTP fault injector, change this once # https://github.com/Azure/azure-sdk-tools/pull/6216 is resolved @@ -100,8 +121,6 @@ jobs: - template: /eng/pipelines/templates/steps/build-and-test.yml parameters: - SDKType: ${{ parameters.SDKType }} - ServiceDirectory: ${{ parameters.ServiceDirectory }} ParallelTestPlayback: 'false' BuildParallelization: ${{ parameters.BuildParallelization }} IsLiveTest: true @@ -115,7 +134,7 @@ jobs: ${{ each var in parameters.EnvVars }}: ${{ var.key }}: ${{ var.value }} - - template: /eng/pipelines/templates/steps/upload-repository-on-failure.yml + - template: /eng/pipelines/templates/steps/clean-maven-local-cache.yml # macOS has known issues running HTTP fault injector, change this once # https://github.com/Azure/azure-sdk-tools/pull/6216 is resolved diff --git a/eng/pipelines/templates/jobs/native.live.tests.yml b/eng/pipelines/templates/jobs/native.live.tests.yml index d081a9522b78..1660e94d174e 100644 --- a/eng/pipelines/templates/jobs/native.live.tests.yml +++ b/eng/pipelines/templates/jobs/native.live.tests.yml @@ -1,27 +1,69 @@ parameters: - ServiceDirectory: '' - TestResourceDirectories: - Artifacts: [] - AdditionalModules: [] - EnvVars: {} - MaxParallel: 0 - PreSteps: [] - PostSteps: [] - TimeoutInMinutes: 60 - TestMode: 'LIVE' - TestResultsFiles: '' - CloudConfig: {} - ArmTemplateParameters: '@{}' - Location: '' - Matrix: '' - DependsOn: '' - UsePlatformContainer: false - DisableAzureResourceCreation: false - BuildParallelization: '2C' - TestGoals: $(TestGoals) - TestOptions: $(TestOptions) - TestParallelization: '1' - TestVersionSupport: $(TestVersionSupport) + - name: ServiceDirectory + type: string + default: '' + - name: TestResourceDirectories + type: object + default: null + - name: EnvVars + type: object + default: {} + - name: MaxParallel + type: number + default: 0 + - name: PreSteps + type: object + default: [] + - name: PostSteps + type: object + default: [] + - name: TimeoutInMinutes + type: number + default: 60 + - name: TestMode + type: string + default: 'LIVE' + - name: TestResultsFiles + type: string + default: '' + - name: CloudConfig + type: object + default: {} + - name: ArmTemplateParameters + type: string + default: '@{}' + - name: Location + type: string + default: '' + - name: Matrix + type: string + default: '' + - name: DependsOn + type: string + default: '' + - name: UsePlatformContainer + type: boolean + default: false + - name: DisableAzureResourceCreation + type: boolean + default: false + - name: BuildParallelization + type: string + default: '2C' + - name: TestGoals + type: string + default: $(TestGoals) + - name: TestOptions + type: string + default: $(TestOptions) + - name: TestParallelization + type: string + default: '1' + - name: TestVersionSupport + type: string + default: $(TestVersionSupport) + - name: OSName + type: string jobs: - job: @@ -32,27 +74,42 @@ jobs: matrix: $[ ${{ parameters.Matrix }} ] variables: - - template: /eng/pipelines/templates/variables/globals.yml - name: ArmTemplateParameters value: '@{}' timeoutInMinutes: ${{ parameters.TimeoutInMinutes }} pool: + # 1es pipeline templates converts `image` to demands: ImageOverride under the hood + # which is incompatible with image selection in the default non-1es hosted pools + ${{ if eq(parameters.OSName, 'macOS') }}: + vmImage: $(OSVmImage) + ${{ else }}: + image: $(OSVmImage) name: $(Pool) - vmImage: $(OSVmImage) + os: ${{ parameters.OSName }} ${{ if eq(parameters.UsePlatformContainer, 'true') }}: # Add a default so the job doesn't fail when the matrix is empty container: $[ variables['Container'] ] + templateContext: + outputParentDirectory: '$(System.DefaultWorkingDirectory)' + outputs: + # Troubleshooting artifacts are creating in the staging directory under the folder 'troubleshooting'. + # This will contain things such as heap dumps hprofs if testing hit OutOfMemory errors, log files captured + # during testing if tests failed, and linting reports. + - output: pipelineArtifact + artifactName: troubleshooting-$(System.StageName)-$(System.JobName) + targetPath: $(System.DefaultWorkingDirectory)/troubleshooting + displayName: 'Capture troubleshooting artifacts' + condition: and(not(succeeded()), eq(variables['HAS_TROUBLESHOOTING'], 'true')) + sbomEnabled: false + steps: - template: /eng/pipelines/templates/steps/initialize-test-environment.yml parameters: - Artifacts: ${{ parameters.Artifacts }} - AdditionalModules: ${{ parameters.AdditionalModules }} - ServiceDirectory: ${{ parameters.ServiceDirectory }} - SDKType: ${{ parameters.SDKType }} + OS: ${{ parameters.OSName }} - template: /eng/pipelines/templates/steps/install-reporting-tools.yml parameters: @@ -91,8 +148,6 @@ jobs: - template: /eng/pipelines/templates/steps/build-and-test-native.yml parameters: - SDKType: ${{ parameters.SDKType }} - ServiceDirectory: ${{ parameters.ServiceDirectory }} ParallelTestPlayback: 'false' BuildParallelization: ${{ parameters.BuildParallelization }} IsLiveTest: true diff --git a/eng/pipelines/templates/stages/1es-redirect.yml b/eng/pipelines/templates/stages/1es-redirect.yml new file mode 100644 index 000000000000..e10ad86b5f28 --- /dev/null +++ b/eng/pipelines/templates/stages/1es-redirect.yml @@ -0,0 +1,60 @@ +resources: + repositories: + - repository: 1ESPipelineTemplates + type: git + name: 1ESPipelineTemplates/1ESPipelineTemplates + ref: refs/tags/release + - repository: azure-sdk-build-tools + type: git + name: internal/azure-sdk-build-tools + ref: refs/tags/azure-sdk-build-tools_20230829.1 + +parameters: +- name: stages + type: stageList + default: [] +- name: UseOfficial + type: boolean + default: true + +extends: + ${{ if and(parameters.UseOfficial, eq(variables['System.TeamProject'], 'internal')) }}: + template: v1/1ES.Official.PipelineTemplate.yml@1ESPipelineTemplates + ${{ else }}: + template: v1/1ES.Unofficial.PipelineTemplate.yml@1ESPipelineTemplates + parameters: + settings: + skipBuildTagsForGitHubPullRequests: true + sdl: + sourceAnalysisPool: + name: azsdk-pool-mms-win-2022-general + image: azsdk-pool-mms-win-2022-1espt + os: windows + sourceRepositoriesToScan: + exclude: + - repository: azure-sdk-build-tools + # TODO: migrate analyze spot bugs configuration here from steps/run-and-validate-linting.yml + spotBugs: + enabled: false + binskim: + # Exclude imported azure-sdk-build-tools gpg/azcopy binaries + # See https://dev.azure.com/securitytools/SecurityIntegration/_wiki/wikis/Guardian/1378/Glob-Format + analyzeTargetGlob: +:file|**/*.jar;+:file|**/*.exe;-:f|**/tools/gpg/**/*.dll;-:f|**/tools/gpg/**/*.exe;-:f|**/tools/azcopy/**/*.exe;-:f|**/tools/azcopy/**/*.dll + eslint: + enabled: false + justificationForDisabling: 'ESLint injected task has failures because it uses an old version of mkdirp. We should not fail for tools not controlled by the repo. See: https://dev.azure.com/azure-sdk/internal/_build/results?buildId=3499746' + codeql: + compiled: + enabled: false + justificationForDisabling: CodeQL times our pipelines out by running for 2+ hours before being force canceled. + psscriptanalyzer: + compiled: true + break: true + policy: M365 + credscan: + suppressionsFile: $(Build.SourcesDirectory)/eng/CredScanSuppression.json + scanFolder: $(Build.SourcesDirectory)/credscan.tsv + toolVersion: 2.3.12.23 + baselineFiles: $(Build.SourcesDirectory)/eng/java.gdnbaselines + + stages: ${{ parameters.stages }} diff --git a/eng/pipelines/templates/stages/archetype-java-release-batch.yml b/eng/pipelines/templates/stages/archetype-java-release-batch.yml index 9b2f1c0006db..c1fd2111d3a7 100644 --- a/eng/pipelines/templates/stages/archetype-java-release-batch.yml +++ b/eng/pipelines/templates/stages/archetype-java-release-batch.yml @@ -41,14 +41,17 @@ stages: timeoutInMinutes: 20 variables: - template: /eng/pipelines/templates/variables/globals.yml + - template: /eng/pipelines/templates/variables/image.yml pool: name: azsdk-pool-mms-ubuntu-2004-general - vmImage: MMSUbuntu20.04 + image: azsdk-pool-mms-ubuntu-2004-1espt + os: linux strategy: runOnce: deploy: steps: - checkout: none + - template: /eng/pipelines/templates/steps/download-credscan-suppressions.yml - download: current displayName: 'Download Artifact: ${{parameters.ArtifactName}}' @@ -59,9 +62,10 @@ stages: Artifacts: ${{parameters.Artifacts}} ArtifactDirectory: $(Pipeline.Workspace)/${{parameters.ArtifactName}} - - publish: $(Pipeline.Workspace)/${{parameters.ArtifactName}} - artifact: ${{parameters.ArtifactName}}-signed - displayName: 'Store signed packages in ${{parameters.ArtifactName}}-signed artifact' + - template: /eng/common/pipelines/templates/steps/publish-1es-artifact.yml + parameters: + ArtifactPath: '$(Pipeline.Workspace)/${{parameters.ArtifactName}}' + ArtifactName: '${{parameters.ArtifactName}}-signed' # We generate two interdependent stages for each artifact listed in the ci.yml file, creates the release # in GitHub. The Release stage publishes to Maven Central. Both stages require approval since they @@ -73,15 +77,21 @@ stages: displayName: 'Releasing: ${{ length(parameters.Artifacts) }} libraries' dependsOn: Signing condition: and(succeeded(), ne(variables['SetDevVersion'], 'true'), ne(variables['Skip.Release'], 'true'), ne(variables['Build.Repository.Name'], 'Azure/azure-sdk-for-java-pr')) + variables: + - template: /eng/pipelines/templates/variables/globals.yml + # Convert artifact parameter objects to json and set them as variables to be used in + # pipeline jobs/stages. By setting these as a variable once we save thousands of lines + # of yaml in extreme cases. This helps us stay under the devops max yaml size limits. + - name: ArtifactsJson + value: '${{ convertToJson(parameters.Artifacts) }}' jobs: - job: VerifyReleaseVersion displayName: "Verify release versions" condition: ne(variables['Skip.VersionVerification'], 'true') - variables: - - template: /eng/pipelines/templates/variables/globals.yml pool: name: azsdk-pool-mms-ubuntu-2004-general - vmImage: MMSUbuntu20.04 + image: azsdk-pool-mms-ubuntu-2004-1espt + os: linux steps: - template: /eng/common/pipelines/templates/steps/sparse-checkout.yml @@ -91,7 +101,7 @@ stages: - '**/*.xml' - '!sdk/**/test-recordings' - '!sdk/**/session-records' - + - download: current displayName: 'Download Artifact: ${{parameters.ArtifactName}}' artifact: ${{parameters.ArtifactName}}-signed @@ -108,7 +118,7 @@ stages: # Do all the verifications for all the artifacts after the sparse-checkout - pwsh: | - $ArtifactsList = $('${{ convertToJson(parameters.Artifacts) }}' | ConvertFrom-Json | Select-Object name, groupId) + $ArtifactsList = $('$(ArtifactsJson)' | ConvertFrom-Json | Select-Object name, groupId) $ArtifactsList | Format-Table -Property GroupId, Name | Out-String | Write-Host python --version foreach($artifact in $ArtifactsList) { @@ -120,7 +130,7 @@ stages: # need to list dependencies in the POM. The flattened POM is generated and won't comply with our versioning # validation, so omit uberJars from the artifacts list to verify. - pwsh: | - $ArtifactsList = $('${{ convertToJson(parameters.Artifacts) }}' | ConvertFrom-Json | Select-Object name, groupId, uberJar | Where-Object -Not "uberJar") + $ArtifactsList = $('$(ArtifactsJson)' | ConvertFrom-Json | Select-Object name, groupId, uberJar | Where-Object -Not "uberJar") $ArtifactsList | Format-Table -Property GroupId, Name | Out-String | Write-Host foreach($artifact in $ArtifactsList) { $(Build.SourcesDirectory)/eng/versioning/scan_for_unreleased_dependencies.ps1 $($artifact.groupId) $($artifact.name) $(Build.SourcesDirectory)/sdk/${{parameters.ServiceDirectory}} @@ -151,18 +161,17 @@ stages: filePath: $(Build.SourcesDirectory)/eng/versioning/verify_release_set.ps1 arguments: > -ServiceDirectory $(Build.SourcesDirectory)/sdk/${{parameters.ServiceDirectory}} - -ArtifactsList ('${{ convertToJson(parameters.Artifacts) }}' | ConvertFrom-Json | Select-Object name, groupId, uberJar) + -ArtifactsList ('$(ArtifactsJson)' | ConvertFrom-Json | Select-Object name, groupId, uberJar) - deployment: TagRepository displayName: "Create release tag" condition: and(succeeded(), ne(variables['Skip.TagRepository'], 'true')) environment: ${{ parameters.Environment }} dependsOn: VerifyReleaseVersion - variables: - - template: /eng/pipelines/templates/variables/globals.yml pool: name: azsdk-pool-mms-win-2022-general - vmImage: windows-2022 + image: azsdk-pool-mms-win-2022-1espt + os: windows strategy: runOnce: deploy: @@ -188,11 +197,10 @@ stages: timeoutInMinutes: 120 environment: ${{ parameters.Environment }} dependsOn: TagRepository - variables: - - template: /eng/pipelines/templates/variables/globals.yml pool: name: azsdk-pool-mms-win-2022-general - vmImage: windows-2022 + image: azsdk-pool-mms-win-2022-1espt + os: windows strategy: runOnce: deploy: @@ -206,6 +214,7 @@ stages: - Name: Azure/azure-sdk-for-java Commitish: $(Build.SourceVersion) WorkingDirectory: $(Pipeline.Workspace)/azure-sdk-for-java + - template: /eng/pipelines/templates/steps/download-credscan-suppressions.yml - download: current displayName: 'Download Artifacts' artifact: ${{parameters.ArtifactName}}-signed @@ -218,7 +227,7 @@ stages: Target: EsrpRelease BuildToolsPath: $(Pipeline.Workspace)/azure-sdk-build-tools JavaRepoRoot: $(Pipeline.Workspace)/azure-sdk-for-java - - template: /eng/common/pipelines/templates/steps/publish-artifact.yml + - template: /eng/common/pipelines/templates/steps/publish-1es-artifact.yml parameters: ArtifactName: ${{parameters.ArtifactName}}-esrp-$(System.JobAttempt) ArtifactPath: $(Pipeline.Workspace)/EsrpPackages @@ -229,7 +238,7 @@ stages: Target: MavenCentral BuildToolsPath: $(Pipeline.Workspace)/azure-sdk-build-tools JavaRepoRoot: $(Pipeline.Workspace)/azure-sdk-for-java - - template: /eng/common/pipelines/templates/steps/publish-artifact.yml + - template: /eng/common/pipelines/templates/steps/publish-1es-artifact.yml parameters: ArtifactName: ${{parameters.ArtifactName}}-mavencentral-$(System.JobAttempt) ArtifactPath: $(Pipeline.Workspace)/${{parameters.ArtifactName}}-signed @@ -243,7 +252,7 @@ stages: Target: JavaDevFeed BuildToolsPath: $(Pipeline.Workspace)/azure-sdk-build-tools JavaRepoRoot: $(Pipeline.Workspace)/azure-sdk-for-java - - template: /eng/common/pipelines/templates/steps/publish-artifact.yml + - template: /eng/common/pipelines/templates/steps/publish-1es-artifact.yml parameters: ArtifactName: ${{parameters.ArtifactName}}-javadevfeed-$(System.JobAttempt) ArtifactPath: $(Pipeline.Workspace)/${{parameters.ArtifactName}}-signed @@ -253,11 +262,10 @@ stages: condition: and(succeeded(), ne(variables['Skip.UpdatePackageVersion'], 'true')) environment: ${{ parameters.Environment }} dependsOn: PublishPackage - variables: - - template: /eng/pipelines/templates/variables/globals.yml pool: name: azsdk-pool-mms-win-2022-general - vmImage: windows-2022 + image: azsdk-pool-mms-win-2022-1espt + os: windows strategy: runOnce: deploy: @@ -280,7 +288,7 @@ stages: # Apply the version increment to each library, which only updates the version_client.txt file, # and then call to update_versions will then apply all of the updates. - pwsh: | - $ArtifactsList = $('${{ convertToJson(parameters.Artifacts) }}' | ConvertFrom-Json | Select-Object name, groupId) + $ArtifactsList = $('$(ArtifactsJson)' | ConvertFrom-Json | Select-Object name, groupId) $ArtifactsList | Format-Table -Property GroupId, Name | Out-String | Write-Host python --version foreach($artifact in $ArtifactsList) { @@ -308,10 +316,10 @@ stages: pool: name: azsdk-pool-mms-ubuntu-2004-general - vmImage: MMSUbuntu20.04 + image: azsdk-pool-mms-ubuntu-2004-1espt + os: linux variables: - - template: /eng/pipelines/templates/variables/globals.yml - name: DocValidationImageId value: azuresdkimages.azurecr.io/javarefautocr:latest @@ -361,11 +369,10 @@ stages: condition: and(succeeded(), ne(variables['Skip.PublishDocs'], 'true')) environment: ${{ parameters.Environment }} dependsOn: PublishPackage - variables: - - template: /eng/pipelines/templates/variables/globals.yml pool: name: azsdk-pool-mms-win-2022-general - vmImage: windows-2022 + image: azsdk-pool-mms-win-2022-1espt + os: windows strategy: runOnce: deploy: @@ -393,18 +400,29 @@ stages: - ${{if ne(parameters.EnableIntegrationStage, false)}}: - stage: Integration dependsOn: Signing + variables: + - template: /eng/pipelines/templates/variables/globals.yml + - template: /eng/pipelines/templates/variables/image.yml jobs: - job: PublishPackages condition: or(eq(variables['SetDevVersion'], 'true'), and(eq(variables['Build.Reason'],'Schedule'), eq(variables['System.TeamProject'], 'internal'))) displayName: Publish package to daily feed variables: - - template: /eng/pipelines/templates/variables/globals.yml - name: RepositoryUrl value: https://pkgs.dev.azure.com/azure-sdk/internal/_packaging/azure-sdk-for-java-pr/maven/v1 + templateContext: + outputs: + - ${{ each artifact in parameters.Artifacts }}: + - ${{if ne(artifact.skipPublishDevFeed, 'true')}}: + - output: pipelineArtifact + artifactName: integration-${{parameters.ArtifactName}}-${{artifact.name}}-javadevfeed + targetPath: $(Pipeline.Workspace)/${{parameters.ArtifactName}}-signed + pool: name: azsdk-pool-mms-win-2022-general - vmImage: windows-2022 + image: azsdk-pool-mms-win-2022-1espt + os: windows steps: - checkout: azure-sdk-build-tools path: azure-sdk-build-tools @@ -444,19 +462,15 @@ stages: RepositoryUrl: $(RepositoryUrl) Target: JavaDevFeed JavaRepoRoot: $(Pipeline.Workspace)/azure-sdk-for-java - - template: /eng/common/pipelines/templates/steps/publish-artifact.yml - parameters: - ArtifactName: integration-${{parameters.ArtifactName}}-${{artifact.name}}-javadevfeed-$(System.JobAttempt) - ArtifactPath: $(Pipeline.Workspace)/${{parameters.ArtifactName}}-signed - job: PublishDocsToNightlyBranch dependsOn: PublishPackages condition: or(eq(variables['SetDevVersion'], 'true'), and(eq(variables['Build.Reason'],'Schedule'), eq(variables['System.TeamProject'], 'internal'))) pool: name: azsdk-pool-mms-ubuntu-2004-general - vmImage: MMSUbuntu20.04 + image: azsdk-pool-mms-ubuntu-2004-1espt + os: linux variables: - - template: /eng/pipelines/templates/variables/globals.yml - name: DocValidationImageId value: azuresdkimages.azurecr.io/javarefautocr:latest steps: diff --git a/eng/pipelines/templates/stages/archetype-java-release-patch.yml b/eng/pipelines/templates/stages/archetype-java-release-patch.yml index 229d30a16344..7546d4775af0 100644 --- a/eng/pipelines/templates/stages/archetype-java-release-patch.yml +++ b/eng/pipelines/templates/stages/archetype-java-release-patch.yml @@ -38,12 +38,14 @@ stages: - template: /eng/pipelines/templates/variables/globals.yml pool: name: azsdk-pool-mms-ubuntu-2004-general - vmImage: MMSUbuntu20.04 + image: azsdk-pool-mms-ubuntu-2004-1espt + os: linux strategy: runOnce: deploy: steps: - checkout: none + - template: /eng/pipelines/templates/steps/download-credscan-suppressions.yml - download: current displayName: 'Download Artifact: ${{parameters.ArtifactName}}' @@ -54,9 +56,10 @@ stages: Artifacts: ${{parameters.Artifacts}} ArtifactDirectory: $(Pipeline.Workspace)/${{parameters.ArtifactName}} - - publish: $(Pipeline.Workspace)/${{parameters.ArtifactName}} - artifact: ${{parameters.ArtifactName}}-signed - displayName: 'Store signed packages in ${{parameters.ArtifactName}}-signed artifact' + - template: /eng/common/pipelines/templates/steps/publish-1es-artifact.yml + parameters: + ArtifactPath: '$(Pipeline.Workspace)/${{parameters.ArtifactName}}' + ArtifactName: '${{parameters.ArtifactName}}-signed' # We generate two interdependent stages for each artifact listed in the ci.yml file, creates the release # in GitHub. The Release stage publishes to Maven Central. Both stages require approval since they @@ -77,7 +80,8 @@ stages: - template: /eng/pipelines/templates/variables/globals.yml pool: name: azsdk-pool-mms-win-2022-general - vmImage: windows-2022 + image: azsdk-pool-mms-win-2022-1espt + os: windows strategy: runOnce: deploy: @@ -108,7 +112,8 @@ stages: - template: /eng/pipelines/templates/variables/globals.yml pool: name: azsdk-pool-mms-win-2022-general - vmImage: windows-2022 + image: azsdk-pool-mms-win-2022-1espt + os: windows strategy: runOnce: deploy: @@ -134,7 +139,7 @@ stages: Target: EsrpRelease BuildToolsPath: $(Pipeline.Workspace)/azure-sdk-build-tools JavaRepoRoot: $(Pipeline.Workspace)/azure-sdk-for-java - - template: /eng/common/pipelines/templates/steps/publish-artifact.yml + - template: /eng/common/pipelines/templates/steps/publish-1es-artifact.yml parameters: ArtifactName: ${{parameters.ArtifactName}}-esrp-$(System.JobAttempt) ArtifactPath: $(Pipeline.Workspace)/EsrpPackages @@ -145,7 +150,7 @@ stages: Target: MavenCentral BuildToolsPath: $(Pipeline.Workspace)/azure-sdk-build-tools JavaRepoRoot: $(Pipeline.Workspace)/azure-sdk-for-java - - template: /eng/common/pipelines/templates/steps/publish-artifact.yml + - template: /eng/common/pipelines/templates/steps/publish-1es-artifact.yml parameters: ArtifactName: ${{parameters.ArtifactName}}-mavencentral-$(System.JobAttempt) ArtifactPath: $(Pipeline.Workspace)/${{parameters.ArtifactName}}-signed @@ -159,7 +164,7 @@ stages: Target: JavaDevFeed BuildToolsPath: $(Pipeline.Workspace)/azure-sdk-build-tools JavaRepoRoot: $(Pipeline.Workspace)/azure-sdk-for-java - - template: /eng/common/pipelines/templates/steps/publish-artifact.yml + - template: /eng/common/pipelines/templates/steps/publish-1es-artifact.yml parameters: ArtifactName: ${{parameters.ArtifactName}}-javadevfeed-$(System.JobAttempt) ArtifactPath: $(Pipeline.Workspace)/${{parameters.ArtifactName}}-signed @@ -171,9 +176,12 @@ stages: dependsOn: PublishPackage variables: - template: /eng/pipelines/templates/variables/globals.yml + - name: ArtifactsJson + value: '${{ convertToJson(parameters.Artifacts) }}' pool: name: azsdk-pool-mms-win-2022-general - vmImage: windows-2022 + image: azsdk-pool-mms-win-2022-1espt + os: windows strategy: runOnce: deploy: @@ -196,7 +204,7 @@ stages: # Apply the version increment to each library, which only updates the version_client.txt file, # and then call to update_versions will then apply all of the updates. - pwsh: | - $ArtifactsList = $('${{ convertToJson(parameters.Artifacts) }}' | ConvertFrom-Json | Select-Object name, groupId) + $ArtifactsList = $('$(ArtifactsJson)' | ConvertFrom-Json | Select-Object name, groupId) $ArtifactsList | Format-Table -Property GroupId, Name | Out-String | Write-Host python --version foreach($artifact in $ArtifactsList) { @@ -225,7 +233,8 @@ stages: pool: name: azsdk-pool-mms-ubuntu-2004-general - vmImage: MMSUbuntu20.04 + image: azsdk-pool-mms-ubuntu-2004-1espt + os: linux variables: - template: /eng/pipelines/templates/variables/globals.yml @@ -284,7 +293,8 @@ stages: - template: /eng/pipelines/templates/variables/globals.yml pool: name: azsdk-pool-mms-win-2022-general - vmImage: windows-2022 + image: azsdk-pool-mms-win-2022-1espt + os: windows strategy: runOnce: deploy: diff --git a/eng/pipelines/templates/stages/archetype-java-release-pom-only.yml b/eng/pipelines/templates/stages/archetype-java-release-pom-only.yml index 3ff256ae66d3..bb19e357b773 100644 --- a/eng/pipelines/templates/stages/archetype-java-release-pom-only.yml +++ b/eng/pipelines/templates/stages/archetype-java-release-pom-only.yml @@ -20,12 +20,14 @@ stages: - template: ../variables/globals.yml pool: name: azsdk-pool-mms-ubuntu-2004-general - vmImage: MMSUbuntu20.04 + image: azsdk-pool-mms-ubuntu-2004-1espt + os: linux strategy: runOnce: deploy: steps: - checkout: none + - template: /eng/pipelines/templates/steps/download-credscan-suppressions.yml - download: current displayName: 'Download Artifact: ${{parameters.ArtifactName}}' @@ -36,9 +38,10 @@ stages: Artifacts: ${{parameters.Artifacts}} ArtifactDirectory: $(Pipeline.Workspace)/${{parameters.ArtifactName}} - - publish: $(Pipeline.Workspace)/${{parameters.ArtifactName}} - artifact: ${{parameters.ArtifactName}}-signed - displayName: 'Store signed packages in ${{parameters.ArtifactName}}-signed artifact' + - template: /eng/common/pipelines/templates/steps/publish-1es-artifact.yml + parameters: + ArtifactPath: '$(Pipeline.Workspace)/${{parameters.ArtifactName}}' + ArtifactName: '${{parameters.ArtifactName}}-signed' # We generate two interdepdent stages for each artifact listed in the ci.yml file, creates the release # in GitHub. The Release stage publishes to Maven Central. Both stages require approval since they @@ -60,7 +63,8 @@ stages: - template: ../variables/globals.yml pool: name: azsdk-pool-mms-win-2022-general - vmImage: windows-2022 + image: azsdk-pool-mms-win-2022-1espt + os: windows strategy: runOnce: deploy: @@ -87,7 +91,8 @@ stages: - template: ../variables/globals.yml pool: name: azsdk-pool-mms-win-2022-general - vmImage: windows-2022 + image: azsdk-pool-mms-win-2022-1espt + os: windows strategy: runOnce: deploy: @@ -115,7 +120,7 @@ stages: Target: EsrpRelease BuildToolsPath: $(Pipeline.Workspace)/azure-sdk-build-tools JavaRepoRoot: $(Pipeline.Workspace)/azure-sdk-for-java - - template: /eng/common/pipelines/templates/steps/publish-artifact.yml + - template: /eng/common/pipelines/templates/steps/publish-1es-artifact.yml parameters: ArtifactName: ${{parameters.ArtifactName}}-${{artifact.name}}-esrp-$(System.JobAttempt) ArtifactPath: $(Pipeline.Workspace)/EsrpPackages @@ -131,7 +136,7 @@ stages: Target: JavaDevFeed BuildToolsPath: $(Pipeline.Workspace)/azure-sdk-build-tools JavaRepoRoot: $(Pipeline.Workspace)/azure-sdk-for-java - - template: /eng/common/pipelines/templates/steps/publish-artifact.yml + - template: /eng/common/pipelines/templates/steps/publish-1es-artifact.yml parameters: ArtifactName: ${{parameters.ArtifactName}}-${{artifact.name}}-javadevfeed-$(System.JobAttempt) ArtifactPath: $(Pipeline.Workspace)/${{parameters.ArtifactName}}-signed diff --git a/eng/pipelines/templates/stages/archetype-java-release.yml b/eng/pipelines/templates/stages/archetype-java-release.yml index 0ee8e13ab342..c20c6324a209 100644 --- a/eng/pipelines/templates/stages/archetype-java-release.yml +++ b/eng/pipelines/templates/stages/archetype-java-release.yml @@ -38,12 +38,14 @@ stages: - template: /eng/pipelines/templates/variables/globals.yml pool: name: azsdk-pool-mms-ubuntu-2004-general - vmImage: MMSUbuntu20.04 + image: azsdk-pool-mms-ubuntu-2004-1espt + os: linux strategy: runOnce: deploy: steps: - checkout: none + - template: /eng/pipelines/templates/steps/download-credscan-suppressions.yml - download: current displayName: 'Download Artifact: ${{parameters.ArtifactName}}' @@ -54,9 +56,10 @@ stages: Artifacts: ${{parameters.Artifacts}} ArtifactDirectory: $(Pipeline.Workspace)/${{parameters.ArtifactName}} - - publish: $(Pipeline.Workspace)/${{parameters.ArtifactName}} - artifact: ${{parameters.ArtifactName}}-signed - displayName: 'Store signed packages in ${{parameters.ArtifactName}}-signed artifact' + - template: /eng/common/pipelines/templates/steps/publish-1es-artifact.yml + parameters: + ArtifactPath: '$(Pipeline.Workspace)/${{parameters.ArtifactName}}' + ArtifactName: '${{parameters.ArtifactName}}-signed' # We generate two interdependent stages for each artifact listed in the ci.yml file, creates the release # in GitHub. The Release stage publishes to Maven Central. Both stages require approval since they @@ -77,7 +80,8 @@ stages: - template: /eng/pipelines/templates/variables/globals.yml pool: name: azsdk-pool-mms-ubuntu-2004-general - vmImage: MMSUbuntu20.04 + image: azsdk-pool-mms-ubuntu-2004-1espt + os: linux steps: - template: /eng/common/pipelines/templates/steps/sparse-checkout.yml @@ -146,7 +150,8 @@ stages: - template: /eng/pipelines/templates/variables/globals.yml pool: name: azsdk-pool-mms-win-2022-general - vmImage: windows-2022 + image: azsdk-pool-mms-win-2022-1espt + os: windows strategy: runOnce: deploy: @@ -173,7 +178,8 @@ stages: - template: /eng/pipelines/templates/variables/globals.yml pool: name: azsdk-pool-mms-win-2022-general - vmImage: windows-2022 + image: azsdk-pool-mms-win-2022-1espt + os: windows strategy: runOnce: deploy: @@ -202,7 +208,7 @@ stages: Target: EsrpRelease BuildToolsPath: $(Pipeline.Workspace)/azure-sdk-build-tools JavaRepoRoot: $(Pipeline.Workspace)/azure-sdk-for-java - - template: /eng/common/pipelines/templates/steps/publish-artifact.yml + - template: /eng/common/pipelines/templates/steps/publish-1es-artifact.yml parameters: ArtifactName: ${{parameters.ArtifactName}}-${{artifact.name}}-esrp-$(System.JobAttempt) ArtifactPath: $(Pipeline.Workspace)/EsrpPackages @@ -215,7 +221,7 @@ stages: Target: MavenCentral BuildToolsPath: $(Pipeline.Workspace)/azure-sdk-build-tools JavaRepoRoot: $(Pipeline.Workspace)/azure-sdk-for-java - - template: /eng/common/pipelines/templates/steps/publish-artifact.yml + - template: /eng/common/pipelines/templates/steps/publish-1es-artifact.yml parameters: ArtifactName: ${{parameters.ArtifactName}}-${{artifact.name}}-mavencentral-$(System.JobAttempt) ArtifactPath: $(Pipeline.Workspace)/${{parameters.ArtifactName}}-signed @@ -231,7 +237,7 @@ stages: Target: JavaDevFeed BuildToolsPath: $(Pipeline.Workspace)/azure-sdk-build-tools JavaRepoRoot: $(Pipeline.Workspace)/azure-sdk-for-java - - template: /eng/common/pipelines/templates/steps/publish-artifact.yml + - template: /eng/common/pipelines/templates/steps/publish-1es-artifact.yml parameters: ArtifactName: ${{parameters.ArtifactName}}-${{artifact.name}}-javadevfeed-$(System.JobAttempt) ArtifactPath: $(Pipeline.Workspace)/${{parameters.ArtifactName}}-signed @@ -245,7 +251,8 @@ stages: pool: name: azsdk-pool-mms-ubuntu-2004-general - vmImage: MMSUbuntu20.04 + image: azsdk-pool-mms-ubuntu-2004-1espt + os: linux variables: - template: /eng/pipelines/templates/variables/globals.yml @@ -299,7 +306,8 @@ stages: - template: /eng/pipelines/templates/variables/globals.yml pool: name: azsdk-pool-mms-win-2022-general - vmImage: windows-2022 + image: azsdk-pool-mms-win-2022-1espt + os: windows strategy: runOnce: deploy: @@ -333,7 +341,8 @@ stages: - template: /eng/pipelines/templates/variables/globals.yml pool: name: azsdk-pool-mms-win-2022-general - vmImage: windows-2022 + image: azsdk-pool-mms-win-2022-1espt + os: windows strategy: runOnce: deploy: @@ -384,7 +393,8 @@ stages: pool: name: azsdk-pool-mms-win-2022-general - vmImage: windows-2022 + image: azsdk-pool-mms-win-2022-1espt + os: windows steps: - checkout: azure-sdk-build-tools path: azure-sdk-build-tools @@ -424,7 +434,7 @@ stages: RepositoryUrl: $(RepositoryUrl) Target: JavaDevFeed JavaRepoRoot: $(Pipeline.Workspace)/azure-sdk-for-java - - template: /eng/common/pipelines/templates/steps/publish-artifact.yml + - template: /eng/common/pipelines/templates/steps/publish-1es-artifact.yml parameters: ArtifactName: integration-${{parameters.ArtifactName}}-${{artifact.name}}-javadevfeed-$(System.JobAttempt) ArtifactPath: $(Pipeline.Workspace)/${{parameters.ArtifactName}}-signed @@ -434,7 +444,8 @@ stages: condition: or(eq(variables['SetDevVersion'], 'true'), and(eq(variables['Build.Reason'],'Schedule'), eq(variables['System.TeamProject'], 'internal'))) pool: name: azsdk-pool-mms-ubuntu-2004-general - vmImage: MMSUbuntu20.04 + image: azsdk-pool-mms-ubuntu-2004-1espt + os: linux variables: - template: /eng/pipelines/templates/variables/globals.yml - name: DocValidationImageId diff --git a/eng/pipelines/templates/stages/archetype-sdk-client-patch.yml b/eng/pipelines/templates/stages/archetype-sdk-client-patch.yml index 9c4d4cba9932..d44bc3a2759d 100644 --- a/eng/pipelines/templates/stages/archetype-sdk-client-patch.yml +++ b/eng/pipelines/templates/stages/archetype-sdk-client-patch.yml @@ -1,10 +1,3 @@ -resources: - repositories: - - repository: azure-sdk-build-tools - type: git - name: internal/azure-sdk-build-tools - ref: refs/tags/azure-sdk-build-tools_20230829.1 - parameters: - name: Artifacts type: object @@ -34,290 +27,296 @@ parameters: type: boolean default: false -stages: - - stage: Build - jobs: - - job: 'Build' - - variables: - - template: /eng/pipelines/templates/variables/globals.yml - - name: ArtifactName - value: 'packages' - - pool: - name: azsdk-pool-mms-ubuntu-2004-general - - steps: - # Skip sparse checkout for the `azure-sdk-for--pr` private mirrored repositories as we require the GitHub - # service connection to be loaded. - - ${{ if not(contains(variables['Build.DefinitionName'], 'java-pr')) }}: - - template: /eng/common/pipelines/templates/steps/sparse-checkout.yml - parameters: - Paths: - - '**/*.xml' - - '**/*.md' - - '!sdk/**/test-recordings/*' - - '!sdk/**/session-records/*' - - - template: /eng/pipelines/templates/steps/generate-project-list-and-cache-maven-repository.yml - parameters: - Artifacts: ${{parameters.Artifacts}} - AdditionalModules: ${{parameters.AdditionalModules}} - JobType: 'Build' - - - template: /eng/common/pipelines/templates/steps/set-test-pipeline-version.yml - parameters: - PackageNames: "azure-sdk-template,azure-sdk-template-two,azure-sdk-template-three" - ServiceDirectory: "template" - TestPipeline: ${{parameters.TestPipeline}} - - - task: UsePythonVersion@0 - displayName: 'Use Python $(PythonVersion)' - inputs: - versionSpec: $(PythonVersion) - - - task: PythonScript@0 - displayName: 'Set versions for source build' - inputs: - scriptPath: 'eng/versioning/set_versions.py' - arguments: '--build-type client --pst --project-list $(ProjectList)' - - - task: PythonScript@0 - displayName: 'Update versions for source build' - inputs: - scriptPath: 'eng/versioning/update_versions.py' - arguments: '--update-type library --build-type client --sr' - - - task: PythonScript@0 - displayName: 'Generate FromSource POM and directories for sparse checkout' - inputs: - scriptPath: 'eng/scripts/generate_from_source_pom.py' - arguments: '--artifacts-list $(ArtifactsList) --additional-modules-list $(AdditionalModulesList)' - workingDirectory: '$(System.DefaultWorkingDirectory)' - - - template: /eng/common/pipelines/templates/steps/sparse-checkout.yml - parameters: - Paths: $(SparseCheckoutDirectories) - SkipCheckoutNone: true - - - script: | - python -m pip install markdown2 BeautifulSoup4 - displayName: 'pip install markdown2 and BeautifulSoup4' - - # Save the Package Properties - # - # ServiceDirectories variable is a plain, comma separated list of ServiceDirectories that is output by the - # generate_from_source_pom script above. - - pwsh: | - $ServiceDirs = '$(ServiceDirectories)' - foreach($ServiceDir in $ServiceDirs.Split(',')) { - $(Build.SourcesDirectory)/eng/common/scripts/Save-Package-Properties.ps1 -ServiceDirectory $ServiceDir -OutDirectory $(Build.ArtifactStagingDirectory)/PackageInfo - } - workingDirectory: $(Pipeline.Workspace) - displayName: "Save Package Properties" - - # Why is this necessary? Normal build and release jobs don't install reporting tools prior to building however - # they're still able to find the build tools through the root aggregate pom file. The ClientFromSourcePom only - # contains what is necessary for the list of libraries and needs to have them installed explicitly otherwise the - # checkstyle plugin will fail to find com.azure:sdk-build-tools which is a dependency. It does this in spite of - # the fact that we're not running actually running checkstyle, it loads it to skip it...well done. - - template: ../steps/install-reporting-tools.yml - parameters: - JdkVersion: ${{ parameters.JavaBuildVersion }} - - - task: Maven@3 - displayName: 'Build From Source and Package, JDK Version: ${{ parameters.JavadocSafeJavaBuildVersion }}' - inputs: - mavenPomFile: ClientFromSourcePom.xml - goals: 'deploy' - options: '$(DefaultOptions) -T ${{parameters.BuildParallelization}} -DskipTests -Dgenerate-overview -Dspotbugs.skip=true -Dcheckstyle.skip=true -Drevapi.skip=true -Dspotless.apply.skip=true -pl $(ProjectList) -am -DaltDeploymentRepository=id::default::file://$(System.DefaultWorkingDirectory)/build' # We include template-module, so we ensure it always builds in CI. - mavenOptions: '$(MemoryOptions) $(LoggingOptions)' - javaHomeOption: 'JDKVersion' - jdkVersionOption: ${{ parameters.JavadocSafeJavaBuildVersion }} - jdkArchitectureOption: 'x64' - publishJUnitResults: false - - - task: PowerShell@2 - displayName: 'Verify Required Maven Artifacts' - inputs: - pwsh: true - workingDirectory: $(Agent.BuildDirectory) - filePath: eng/scripts/Verify-Required-Maven-Artifacts.ps1 - arguments: > - -BuildOutputDirectory $(System.DefaultWorkingDirectory)/build - -ArtifactsList ('${{ convertToJson(parameters.Artifacts) }}' | ConvertFrom-Json | Select-Object name, groupId) - -InformationAction Continue - - - task: PowerShell@2 - displayName: 'Copy artifacts to staging' - inputs: - pwsh: true - workingDirectory: $(Agent.BuildDirectory) - filePath: eng/scripts/Stage-MavenPackageArtifacts.ps1 - arguments: > - -SourceDirectory $(System.DefaultWorkingDirectory)/build - -TargetDirectory $(Build.ArtifactStagingDirectory) - -Artifacts ('${{ replace(convertToJson(parameters.Artifacts), '''', '`''') }}' | ConvertFrom-Json | Where-Object -Not skipPublishPackage) - -InformationAction Continue - - - template: /eng/common/pipelines/templates/steps/publish-artifact.yml - parameters: - ArtifactPath: $(Build.ArtifactStagingDirectory) - ArtifactName: '$(ArtifactName)' - - - task: AzureArtifacts.manifest-generator-task.manifest-generator-task.ManifestGeneratorTask@0 - displayName: 'Generate SBOM' - condition: succeededOrFailed() - inputs: - BuildDropPath: $(Build.ArtifactStagingDirectory) - - - template: /eng/common/pipelines/templates/steps/publish-artifact.yml - parameters: - ArtifactPath: '$(Build.ArtifactStagingDirectory)/_manifest' - ArtifactName: 'manifest' - - - template: ../steps/upload-repository-on-failure.yml - - - job: 'AnalyzeAndVerify' - condition: and(succeeded(), ne(variables['Skip.Analyze'], 'true')) - - variables: - - template: /eng/pipelines/templates/variables/globals.yml - - pool: - name: azsdk-pool-mms-ubuntu-2004-general - vmImage: MMSUbuntu20.04 - - steps: - - task: UsePythonVersion@0 - displayName: 'Use Python $(PythonVersion)' - inputs: - versionSpec: $(PythonVersion) - - - template: /eng/common/pipelines/templates/steps/sparse-checkout.yml - parameters: - Paths: - - '**/*.xml' - - '**/*.md' - - '.vscode/cspell.json' - - '!sdk/**/test-recordings/*' - - '!sdk/**/session-records/*' - - - template: /eng/pipelines/templates/steps/generate-project-list-and-cache-maven-repository.yml +extends: + template: /eng/pipelines/templates/stages/1es-redirect.yml + parameters: + stages: + - stage: Build + jobs: + - job: 'Build' + + variables: + - template: /eng/pipelines/templates/variables/globals.yml + - name: ArtifactName + value: 'packages' + - name: ArtifactsJson + value: '${{ convertToJson(parameters.Artifacts) }}' + - name: ArtifactsJsonEscaped + value: "${{ replace(convertToJson(parameters.Artifacts), '''', '`''') }}" + - name: AdditionalModulesJson + value: '${{ convertToJson(parameters.AdditionalModules) }}' + + pool: + name: azsdk-pool-mms-ubuntu-2004-general + image: azsdk-pool-mms-ubuntu-2004-1espt + os: linux + + steps: + # Skip sparse checkout for the `azure-sdk-for--pr` private mirrored repositories as we require the GitHub + # service connection to be loaded. + - ${{ if not(contains(variables['Build.DefinitionName'], 'java-pr')) }}: + - template: /eng/common/pipelines/templates/steps/sparse-checkout.yml + parameters: + Paths: + - '**/*.xml' + - '**/*.md' + - '!sdk/**/test-recordings/*' + - '!sdk/**/session-records/*' + + - template: /eng/pipelines/templates/steps/generate-project-list-and-cache-maven-repository.yml + parameters: + JobType: 'Build' + + - template: /eng/common/pipelines/templates/steps/set-test-pipeline-version.yml + parameters: + PackageNames: "azure-sdk-template,azure-sdk-template-two,azure-sdk-template-three" + ServiceDirectory: "template" + TestPipeline: ${{parameters.TestPipeline}} + + - task: UsePythonVersion@0 + displayName: 'Use Python $(PythonVersion)' + inputs: + versionSpec: $(PythonVersion) + + - task: PythonScript@0 + displayName: 'Set versions for source build' + inputs: + scriptPath: 'eng/versioning/set_versions.py' + arguments: '--build-type client --pst --project-list $(ProjectList)' + + - task: PythonScript@0 + displayName: 'Update versions for source build' + inputs: + scriptPath: 'eng/versioning/update_versions.py' + arguments: '--update-type library --build-type client --sr' + + - task: PythonScript@0 + displayName: 'Generate FromSource POM and directories for sparse checkout' + inputs: + scriptPath: 'eng/scripts/generate_from_source_pom.py' + arguments: '--artifacts-list $(ArtifactsList) --additional-modules-list $(AdditionalModulesList)' + workingDirectory: '$(System.DefaultWorkingDirectory)' + + - template: /eng/pipelines/templates/steps/sparse-checkout-repo-initialized.yml + parameters: + Paths: $(SparseCheckoutDirectories) + SkipCheckoutNone: true + + - script: | + python -m pip install markdown2 BeautifulSoup4 + displayName: 'pip install markdown2 and BeautifulSoup4' + + # Save the Package Properties + # + # ServiceDirectories variable is a plain, comma separated list of ServiceDirectories that is output by the + # generate_from_source_pom script above. + - pwsh: | + $ServiceDirs = '$(ServiceDirectories)' + foreach($ServiceDir in $ServiceDirs.Split(',')) { + $(Build.SourcesDirectory)/eng/common/scripts/Save-Package-Properties.ps1 -ServiceDirectory $ServiceDir -OutDirectory $(Build.ArtifactStagingDirectory)/PackageInfo + } + workingDirectory: $(Pipeline.Workspace) + displayName: "Save Package Properties" + + # Why is this necessary? Normal build and release jobs don't install reporting tools prior to building however + # they're still able to find the build tools through the root aggregate pom file. The ClientFromSourcePom only + # contains what is necessary for the list of libraries and needs to have them installed explicitly otherwise the + # checkstyle plugin will fail to find com.azure:sdk-build-tools which is a dependency. It does this in spite of + # the fact that we're not running actually running checkstyle, it loads it to skip it...well done. + - template: ../steps/install-reporting-tools.yml + parameters: + JdkVersion: ${{ parameters.JavaBuildVersion }} + + - task: Maven@3 + displayName: 'Build From Source and Package, JDK Version: ${{ parameters.JavadocSafeJavaBuildVersion }}' + inputs: + mavenPomFile: ClientFromSourcePom.xml + goals: 'deploy' + options: '$(DefaultOptions) -T ${{parameters.BuildParallelization}} -DskipTests -Dgenerate-overview -Dspotbugs.skip=true -Dcheckstyle.skip=true -Drevapi.skip=true -Dspotless.apply.skip=true -pl $(ProjectList) -am -DaltDeploymentRepository=id::default::file://$(System.DefaultWorkingDirectory)/build' # We include template-module, so we ensure it always builds in CI. + mavenOptions: '$(MemoryOptions) $(LoggingOptions)' + javaHomeOption: 'JDKVersion' + jdkVersionOption: ${{ parameters.JavadocSafeJavaBuildVersion }} + jdkArchitectureOption: 'x64' + publishJUnitResults: false + + - task: PowerShell@2 + displayName: 'Verify Required Maven Artifacts' + inputs: + pwsh: true + workingDirectory: $(Agent.BuildDirectory) + filePath: eng/scripts/Verify-Required-Maven-Artifacts.ps1 + arguments: > + -BuildOutputDirectory $(System.DefaultWorkingDirectory)/build + -ArtifactsList ('$(ArtifactsJson)' | ConvertFrom-Json | Select-Object name, groupId) + -InformationAction Continue + + - task: PowerShell@2 + displayName: 'Copy artifacts to staging' + inputs: + pwsh: true + workingDirectory: $(Agent.BuildDirectory) + filePath: eng/scripts/Stage-MavenPackageArtifacts.ps1 + arguments: > + -SourceDirectory $(System.DefaultWorkingDirectory)/build + -TargetDirectory $(Build.ArtifactStagingDirectory) + -Artifacts ('$(ArtifactsJsonEscaped)' | ConvertFrom-Json | Where-Object -Not skipPublishPackage) + -InformationAction Continue + + - template: /eng/common/pipelines/templates/steps/publish-1es-artifact.yml + parameters: + ArtifactPath: $(Build.ArtifactStagingDirectory) + ArtifactName: '$(ArtifactName)' + + - template: /eng/common/pipelines/templates/steps/publish-1es-artifact.yml + parameters: + ArtifactPath: '$(Build.ArtifactStagingDirectory)/_manifest' + ArtifactName: 'manifest' + + - template: /eng/pipelines/templates/steps/clean-maven-local-cache.yml + + - job: 'AnalyzeAndVerify' + condition: and(succeeded(), ne(variables['Skip.Analyze'], 'true')) + + variables: + - template: /eng/pipelines/templates/variables/globals.yml + - name: ArtifactsJson + value: '${{ convertToJson(parameters.Artifacts) }}' + - name: AdditionalModulesJson + value: '${{ convertToJson(parameters.AdditionalModules) }}' + + pool: + name: azsdk-pool-mms-ubuntu-2004-general + image: azsdk-pool-mms-ubuntu-2004-1espt + os: linux + + steps: + - task: UsePythonVersion@0 + displayName: 'Use Python $(PythonVersion)' + inputs: + versionSpec: $(PythonVersion) + + - template: /eng/common/pipelines/templates/steps/sparse-checkout.yml + parameters: + Paths: + - '**/*.xml' + - '**/*.md' + - '.vscode/cspell.json' + - '!sdk/**/test-recordings/*' + - '!sdk/**/session-records/*' + + - template: /eng/pipelines/templates/steps/generate-project-list-and-cache-maven-repository.yml + parameters: + JobType: 'AnalyzeAndVerify' + UseCache: false + + - template: /eng/common/pipelines/templates/steps/set-test-pipeline-version.yml + parameters: + PackageNames: "azure-sdk-template,azure-sdk-template-two,azure-sdk-template-three" + ServiceDirectory: "template" + TestPipeline: ${{parameters.TestPipeline}} + + - task: PythonScript@0 + displayName: 'Set versions for source build' + inputs: + scriptPath: 'eng/versioning/set_versions.py' + arguments: '--build-type client --pst --project-list $(ProjectList)' + + - task: PythonScript@0 + displayName: 'Update versions for source build' + inputs: + scriptPath: 'eng/versioning/update_versions.py' + arguments: '--update-type library --build-type client --sr' + + - task: PythonScript@0 + displayName: 'Generate FromSource POM and directories for sparse checkout' + inputs: + scriptPath: 'eng/scripts/generate_from_source_pom.py' + arguments: '--artifacts-list $(ArtifactsList) --additional-modules-list $(AdditionalModulesList)' + workingDirectory: '$(System.DefaultWorkingDirectory)' + + - template: /eng/pipelines/templates/steps/sparse-checkout-repo-initialized.yml + parameters: + Paths: $(SparseCheckoutDirectories) + SkipCheckoutNone: true + + - template: /eng/common/pipelines/templates/steps/check-spelling.yml + parameters: + CspellConfigPath: .vscode/cspell.json + + - task: PowerShell@2 + displayName: 'Verify versions in POM files' + inputs: + pwsh: true + workingDirectory: $(Agent.BuildDirectory) + filePath: eng/versioning/pom_file_version_scanner.ps1 + arguments: -Debug:$$(IsDebug) + + # Do all the verifications for all the artifacts after the sparse-checkout. + - pwsh: | + $ArtifactsList = $('$(ArtifactsJson)' | ConvertFrom-Json | Select-Object name, groupId) + $ArtifactsList | Format-Table -Property GroupId, Name | Out-String | Write-Host + python --version + foreach($artifact in $ArtifactsList) { + python eng/versioning/set_versions.py --build-type ${{parameters.SDKType}} --vv --ai $($artifact.name) --gi $($artifact.groupId) + } + displayName: 'Verify artifact versions for release' + + # Uber JARs release a flattened POM, as dependencies are incorporated into the JAR circumnavigating the need to + # list dependencies in the POM. The flattened POM is generated and won't comply with our versioning validation, + # so omit uberJars from the artifacts list to verify. + # + # Note: This is different from the Batch release verification step because the ServiceDirectory, for this + # pipeline, is attached to each Artifact. It needs to be in the query, so it can be passed into the script. + - pwsh: | + $ArtifactsList = $('$(ArtifactsJson)' | ConvertFrom-Json | Select-Object name, groupId, ServiceDirectory, uberJar | Where-Object -Not "uberJar") + $ArtifactsList | Format-Table -Property GroupId, Name, ServiceDirectory | Out-String | Write-Host + foreach($artifact in $ArtifactsList) { + $(Build.SourcesDirectory)/eng/versioning/scan_for_unreleased_dependencies.ps1 $($artifact.groupId) $($artifact.name) $(Build.SourcesDirectory)/sdk/$($artifact.ServiceDirectory) + } + displayName: "Verify no unreleased dependencies or beta dependencies for GA libraries" + + - template: /eng/common/pipelines/templates/steps/verify-readme.yml + parameters: + # For the moment, ServiceDirectories is JSON which may change to a comma delimited list instead of what's + # going on below + ScanPaths: $(ServiceDirectoriesFullPath) + + - template: /eng/common/pipelines/templates/steps/verify-samples.yml + parameters: + ServiceDirectories: $(ServiceDirectories) + + # Use BasePathLength of 38 instead of the default 49 as some released files fail when the number is higher. + - template: /eng/common/pipelines/templates/steps/verify-path-length.yml + parameters: + SourceDirectory: $(Build.SourcesDirectory) + BasePathLength: 38 + + # Verify changelog, the way it currently works would require a complete overhaul in order to be able to deal + # with multiple artifacts and multiple service directories. Even ignoring this, there's still the fact that each + # artifact's metadata can cause this step to be skipped, so we still need to loop over this. + - ${{if ne(parameters.SDKType, 'data')}}: + - ${{ each artifact in parameters.Artifacts }}: + - ${{if ne(artifact.skipVerifyChangelog, 'true')}}: + - template: /eng/common/pipelines/templates/steps/verify-changelog.yml + parameters: + PackageName: ${{artifact.name}} + ServiceName: ${{artifact.ServiceDirectory}} + # Note: For the patch release pipeline there's no point in verifying the non-release changelog since + # the only time this pipeline should run is for a patch release. + ForRelease: true + + - template: /eng/common/pipelines/templates/steps/eng-common-workflow-enforcer.yml + + # This pipeline should never get kicked off outside an internal, manual run. Put the checks here so the pipeline never + # gets to the signing/release portions unless this is the case. + - ${{if and(in(variables['Build.Reason'], 'Manual', ''), eq(variables['System.TeamProject'], 'internal'))}}: + - template: archetype-java-release-patch.yml parameters: + DependsOn: + - Build + SDKType: ${{ parameters.SDKType }} Artifacts: ${{ parameters.Artifacts }} - AdditionalModules: ${{ parameters.AdditionalModules }} - JobType: 'AnalyzeAndVerify' - UseCache: false - - - template: /eng/common/pipelines/templates/steps/set-test-pipeline-version.yml - parameters: - PackageNames: "azure-sdk-template,azure-sdk-template-two,azure-sdk-template-three" - ServiceDirectory: "template" - TestPipeline: ${{parameters.TestPipeline}} - - - task: PythonScript@0 - displayName: 'Set versions for source build' - inputs: - scriptPath: 'eng/versioning/set_versions.py' - arguments: '--build-type client --pst --project-list $(ProjectList)' - - - task: PythonScript@0 - displayName: 'Update versions for source build' - inputs: - scriptPath: 'eng/versioning/update_versions.py' - arguments: '--update-type library --build-type client --sr' - - - task: PythonScript@0 - displayName: 'Generate FromSource POM and directories for sparse checkout' - inputs: - scriptPath: 'eng/scripts/generate_from_source_pom.py' - arguments: '--artifacts-list $(ArtifactsList) --additional-modules-list $(AdditionalModulesList)' - workingDirectory: '$(System.DefaultWorkingDirectory)' - - - template: /eng/common/pipelines/templates/steps/sparse-checkout.yml - parameters: - Paths: $(SparseCheckoutDirectories) - SkipCheckoutNone: true - - - template: /eng/common/pipelines/templates/steps/check-spelling.yml - parameters: - CspellConfigPath: .vscode/cspell.json - - - task: PowerShell@2 - displayName: 'Verify versions in POM files' - inputs: - pwsh: true - workingDirectory: $(Agent.BuildDirectory) - filePath: eng/versioning/pom_file_version_scanner.ps1 - arguments: -Debug:$$(IsDebug) - - # Do all the verifications for all the artifacts after the sparse-checkout. - - pwsh: | - $ArtifactsList = $('${{ convertToJson(parameters.Artifacts) }}' | ConvertFrom-Json | Select-Object name, groupId) - $ArtifactsList | Format-Table -Property GroupId, Name | Out-String | Write-Host - python --version - foreach($artifact in $ArtifactsList) { - python eng/versioning/set_versions.py --build-type ${{parameters.SDKType}} --vv --ai $($artifact.name) --gi $($artifact.groupId) - } - displayName: 'Verify artifact versions for release' - - # Uber JARs release a flattened POM, as dependencies are incorporated into the JAR circumnavigating the need to - # list dependencies in the POM. The flattened POM is generated and won't comply with our versioning validation, - # so omit uberJars from the artifacts list to verify. - # - # Note: This is different from the Batch release verification step because the ServiceDirectory, for this - # pipeline, is attached to each Artifact. It needs to be in the query, so it can be passed into the script. - - pwsh: | - $ArtifactsList = $('${{ convertToJson(parameters.Artifacts) }}' | ConvertFrom-Json | Select-Object name, groupId, ServiceDirectory, uberJar | Where-Object -Not "uberJar") - $ArtifactsList | Format-Table -Property GroupId, Name, ServiceDirectory | Out-String | Write-Host - foreach($artifact in $ArtifactsList) { - $(Build.SourcesDirectory)/eng/versioning/scan_for_unreleased_dependencies.ps1 $($artifact.groupId) $($artifact.name) $(Build.SourcesDirectory)/sdk/$($artifact.ServiceDirectory) - } - displayName: "Verify no unreleased dependencies or beta dependencies for GA libraries" - - - template: /eng/common/pipelines/templates/steps/verify-readme.yml - parameters: - # For the moment, ServiceDirectories is JSON which may change to a comma delimited list instead of what's - # going on below - ScanPaths: $(ServiceDirectoriesFullPath) - - - template: /eng/common/pipelines/templates/steps/verify-samples.yml - parameters: - ServiceDirectories: $(ServiceDirectories) - - # Use BasePathLength of 38 instead of the default 49 as some released files fail when the number is higher. - - template: /eng/common/pipelines/templates/steps/verify-path-length.yml - parameters: - SourceDirectory: $(Build.SourcesDirectory) - BasePathLength: 38 - - # Verify changelog, the way it currently works would require a complete overhaul in order to be able to deal - # with multiple artifacts and multiple service directories. Even ignoring this, there's still the fact that each - # artifact's metadata can cause this step to be skipped, so we still need to loop over this. - - ${{if ne(parameters.SDKType, 'data')}}: - - ${{ each artifact in parameters.Artifacts }}: - - ${{if ne(artifact.skipVerifyChangelog, 'true')}}: - - template: /eng/common/pipelines/templates/steps/verify-changelog.yml - parameters: - PackageName: ${{artifact.name}} - ServiceName: ${{artifact.ServiceDirectory}} - # Note: For the patch release pipeline there's no point in verifying the non-release changelog since - # the only time this pipeline should run is for a patch release. - ForRelease: true - - - template: /eng/common/pipelines/templates/steps/eng-common-workflow-enforcer.yml - - # This pipeline should never get kicked off outside an internal, manual run. Put the checks here so the pipeline never - # gets to the signing/release portions unless this is the case. - - ${{if and(in(variables['Build.Reason'], 'Manual', ''), eq(variables['System.TeamProject'], 'internal'))}}: - - template: archetype-java-release-patch.yml - parameters: - DependsOn: - - Build - SDKType: ${{ parameters.SDKType }} - Artifacts: ${{ parameters.Artifacts }} - TestPipeline: ${{ parameters.TestPipeline }} - ArtifactName: packages - TargetDocRepoName: ${{ parameters.TargetDocRepoName }} - UseEsrpRelease: ${{ parameters.UseEsrpRelease }} + TestPipeline: ${{ parameters.TestPipeline }} + ArtifactName: packages + TargetDocRepoName: ${{ parameters.TargetDocRepoName }} + UseEsrpRelease: ${{ parameters.UseEsrpRelease }} diff --git a/eng/pipelines/templates/stages/archetype-sdk-client.yml b/eng/pipelines/templates/stages/archetype-sdk-client.yml index 939951bd4cd6..b4842866cd5b 100644 --- a/eng/pipelines/templates/stages/archetype-sdk-client.yml +++ b/eng/pipelines/templates/stages/archetype-sdk-client.yml @@ -1,171 +1,174 @@ -resources: - repositories: - - repository: azure-sdk-build-tools - type: git - name: internal/azure-sdk-build-tools - ref: refs/tags/azure-sdk-build-tools_20230829.1 - parameters: -- name: Artifacts - type: object - default: [] -- name: TestPipeline - type: boolean - default: false -- name: AdditionalModules - type: object - default: [] -- name: SDKType - type: string - default: client -- name: ServiceDirectory - type: string - default: not-specified -- name: TargetDocRepoName - type: string - default: azure-docs-sdk-java -- name: MatrixConfigs - type: object - default: - - Name: Java_ci_test_base - Path: eng/pipelines/templates/stages/platform-matrix.json - Selection: sparse - NonSparseParameters: Agent - GenerateVMJobs: true -- name: AdditionalMatrixConfigs - type: object - default: [] -- name: MatrixFilters - type: object - default: [] -- name: MatrixReplace - type: object - default: [] -- name: PreBuildSteps - type: object - default: [] -- name: AdditionalLintingOptions - type: string - default: '' -- name: AdditionalStagesAfterBuild - type: object - default: [] -- name: EnableBatchRelease - type: boolean - default: false -- name: UseEsrpRelease - type: boolean - default: true -- name: JavaBuildVersion - type: string - default: $(JavaBuildVersion) -- name: JavadocSafeJavaBuildVersion - type: string - default: $(JavadocSafeJavaBuildVersion) -- name: LiveTestStages - type: stageList - default: [] -- name: ReleaseDependsOnLiveTests - type: string - default: not-specified -- name: IgnoreVerifyTypeSpecCodeGenerationError - type: boolean - default: false - -variables: - - template: /eng/pipelines/templates/variables/globals.yml + - name: Artifacts + type: object + default: [] + - name: TestPipeline + type: boolean + default: false + - name: AdditionalModules + type: object + default: [] + - name: SDKType + type: string + default: client + - name: ServiceDirectory + type: string + default: not-specified + - name: TargetDocRepoName + type: string + default: azure-docs-sdk-java + - name: MatrixConfigs + type: object + default: + - Name: Java_ci_test_base + Path: eng/pipelines/templates/stages/platform-matrix.json + Selection: sparse + NonSparseParameters: Agent + GenerateVMJobs: true + - name: AdditionalMatrixConfigs + type: object + default: [] + - name: MatrixFilters + type: object + default: [] + - name: MatrixReplace + type: object + default: [] + - name: PreBuildSteps + type: object + default: [] + - name: AdditionalLintingOptions + type: string + default: '' + - name: AdditionalStagesAfterBuild + type: object + default: [] + - name: EnableBatchRelease + type: boolean + default: false + - name: UseEsrpRelease + type: boolean + default: true + - name: JavaBuildVersion + type: string + default: $(JavaBuildVersion) + - name: JavadocSafeJavaBuildVersion + type: string + default: $(JavadocSafeJavaBuildVersion) + - name: LiveTestStages + type: stageList + default: [] + - name: ReleaseDependsOnLiveTests + type: string + default: not-specified + - name: IgnoreVerifyTypeSpecCodeGenerationError + type: boolean + default: false -stages: - - stage: Build - jobs: - - template: /eng/pipelines/templates/jobs/ci.yml - parameters: - ServiceDirectory: ${{ parameters.ServiceDirectory }} - TestPipeline: ${{ parameters.TestPipeline }} - SDKType: ${{ parameters.SDKType }} - Artifacts: ${{ parameters.Artifacts }} - IgnoreVerifyTypeSpecCodeGenerationError: ${{ parameters.IgnoreVerifyTypeSpecCodeGenerationError }} - ReleaseArtifacts: - - ${{ if and(eq(variables['System.TeamProject'], 'internal'), eq(variables['Build.Reason'], 'Manual')) }}: - - ${{ each artifact in parameters.Artifacts }}: - - ${{ if ne(artifact.releaseInBatch, 'false') }}: - - ${{ artifact }} - - ${{ else }}: - - ${{ parameters.Artifacts }} - AdditionalModules: ${{ parameters.AdditionalModules }} - MatrixConfigs: - - ${{ each config in parameters.MatrixConfigs }}: - - ${{ config }} - - ${{ each config in parameters.AdditionalMatrixConfigs }}: - - ${{ config }} - MatrixFilters: - - ${{ each filter in parameters.MatrixFilters }}: - - ${{ filter }} - # Skip TestFromSource jobs for SDKType data - - ${{ if eq(parameters.SDKType, 'data') }}: - - TestFromSource=^(?!true).* - MatrixReplace: - - ${{ each replacement in parameters.MatrixReplace }}: - - ${{ replacement }} +extends: + template: /eng/pipelines/templates/stages/1es-redirect.yml + parameters: + stages: + - stage: Build + variables: + - template: /eng/pipelines/templates/variables/globals.yml + - template: /eng/pipelines/templates/variables/image.yml + # Convert artifact parameter objects to json and set them as variables to be used in + # pipeline jobs/stages. By setting these as a variable once we save thousands of lines + # of yaml in extreme cases. This helps us stay under the devops max yaml size limits. + - name: ArtifactsJson + value: '${{ convertToJson(parameters.Artifacts) }}' + - name: AdditionalModulesJson + value: '${{ convertToJson(parameters.AdditionalModules) }}' + jobs: + - template: /eng/pipelines/templates/jobs/ci.yml + parameters: + ServiceDirectory: ${{ parameters.ServiceDirectory }} + TestPipeline: ${{ parameters.TestPipeline }} + SDKType: ${{ parameters.SDKType }} + Artifacts: ${{ parameters.Artifacts }} + IgnoreVerifyTypeSpecCodeGenerationError: ${{ parameters.IgnoreVerifyTypeSpecCodeGenerationError }} + ReleaseArtifacts: + - ${{ if and(eq(variables['System.TeamProject'], 'internal'), eq(variables['Build.Reason'], 'Manual')) }}: + - ${{ each artifact in parameters.Artifacts }}: + - ${{ if ne(artifact.releaseInBatch, 'false') }}: + - ${{ artifact }} + - ${{ else }}: + - ${{ parameters.Artifacts }} + MatrixConfigs: + - ${{ each config in parameters.MatrixConfigs }}: + - ${{ config }} + - ${{ each config in parameters.AdditionalMatrixConfigs }}: + - ${{ config }} + MatrixFilters: + - ${{ each filter in parameters.MatrixFilters }}: + - ${{ filter }} + # Skip TestFromSource jobs for SDKType data + - ${{ if eq(parameters.SDKType, 'data') }}: + - TestFromSource=^(?!true).* + MatrixReplace: + - ${{ each replacement in parameters.MatrixReplace }}: + - ${{ replacement }} - - AZURE_TEST.*=.*/ - - ${{ if eq(parameters.SDKType, 'data') }}: - - JavaTestVersion=(.*1)\.\d{2}(.*)/$1.11$2 - PreBuildSteps: ${{ parameters.PreBuildSteps }} - AdditionalLintingOptions: ${{ parameters.AdditionalLintingOptions }} - ${{ if eq(parameters.SDKType, 'data') }}: - TestGoals: 'verify' - TestOptions: '-am' - JavaBuildVersion: '1.11' - ${{ else }}: - JavaBuildVersion: ${{ parameters.JavaBuildVersion }} + - AZURE_TEST.*=.*/ + - ${{ if eq(parameters.SDKType, 'data') }}: + - JavaTestVersion=(.*1)\.\d{2}(.*)/$1.11$2 + PreBuildSteps: ${{ parameters.PreBuildSteps }} + AdditionalLintingOptions: ${{ parameters.AdditionalLintingOptions }} + ${{ if eq(parameters.SDKType, 'data') }}: + TestGoals: 'verify' + TestOptions: '-am' + JavaBuildVersion: '1.11' + ${{ else }}: + JavaBuildVersion: ${{ parameters.JavaBuildVersion }} - - ${{ parameters.AdditionalStagesAfterBuild }} + - ${{ if parameters.AdditionalStagesAfterBuild }}: + - ${{ parameters.AdditionalStagesAfterBuild }} - - ${{ if and(eq(variables['System.TeamProject'], 'internal'), ne(variables['Build.Reason'],'IndividualCI')) }}: - - ${{ parameters.LiveTestStages }} + - ${{ if and(eq(variables['System.TeamProject'], 'internal'), ne(variables['Build.Reason'],'IndividualCI')) }}: + - ${{ parameters.LiveTestStages }} - # The Prerelease and Release stages are conditioned on whether we are building a pull request and the branch. - # The tests-weekly check needs to be done so we don't create signing/release tasks for manual weekly-test runs - - ${{if and(ne(variables['Build.Reason'], 'PullRequest'), eq(variables['System.TeamProject'], 'internal'), not(contains(variables['Build.DefinitionName'], 'tests-weekly'))) }}: - - ${{ if eq(parameters.EnableBatchRelease, 'true') }}: - - template: archetype-java-release-batch.yml - parameters: - DependsOn: - - Build - # Only depend on live test stages if the build depends on live tests and the build reason is manual. - # This prevents check-in builds and scheduled builds from having a requirement on live test stages. - - ${{ if and(eq(parameters.ReleaseDependsOnLiveTests, 'true'), eq(variables['Build.Reason'],'Manual')) }}: - - ${{ each liveTestStage in parameters.LiveTestStages }}: - - ${{ liveTestStage.stage }} - ServiceDirectory: ${{ parameters.ServiceDirectory }} - SDKType: ${{ parameters.SDKType }} - # By default, the Artifacts list will contain everything as we won't skip an artifact unless it, - # specifically, has releaseInBatch set to false. releaseInBatch should only be set libraries, - # not ready for release, in service directories that have batch release enabled. The if statement - # below, looking for releaseInBatch not equal false has to be set this way because if the library's - # metadata in the ci.yml doesn't have this variable then it defaults to being released. - Artifacts: - - ${{ each artifact in parameters.Artifacts }}: - - ${{ if ne(artifact.releaseInBatch, 'false') }}: - - ${{ artifact }} - TestPipeline: ${{ parameters.TestPipeline }} - ArtifactName: packages - TargetDocRepoName: ${{ parameters.TargetDocRepoName }} - UseEsrpRelease: ${{ parameters.UseEsrpRelease }} - # This where the MavenBreakGlassApprovers is set for the release tasks. - ${{ if and(in(variables['Build.Reason'], 'Manual', ''), eq(parameters.ReleaseDependsOnLiveTests, 'false')) }}: - Environment: 'MavenBreakGlassApprovers' - - ${{ else }}: - - template: archetype-java-release.yml - parameters: - DependsOn: - - Build - ServiceDirectory: ${{ parameters.ServiceDirectory }} - SDKType: ${{ parameters.SDKType }} - Artifacts: ${{ parameters.Artifacts }} - TestPipeline: ${{ parameters.TestPipeline }} - ArtifactName: packages - TargetDocRepoName: ${{ parameters.TargetDocRepoName }} - UseEsrpRelease: ${{ parameters.UseEsrpRelease }} + # The Prerelease and Release stages are conditioned on whether we are building a pull request and the branch. + # The tests-weekly check needs to be done so we don't create signing/release tasks for manual weekly-test runs + - ${{if and(ne(variables['Build.Reason'], 'PullRequest'), eq(variables['System.TeamProject'], 'internal'), not(contains(variables['Build.DefinitionName'], 'tests-weekly'))) }}: + - ${{ if eq(parameters.EnableBatchRelease, 'true') }}: + - template: archetype-java-release-batch.yml + parameters: + DependsOn: + - Build + # Only depend on live test stages if the build depends on live tests and the build reason is manual. + # This prevents check-in builds and scheduled builds from having a requirement on live test stages. + - ${{ if and(eq(parameters.ReleaseDependsOnLiveTests, 'true'), eq(variables['Build.Reason'],'Manual')) }}: + - ${{ each liveTestStage in parameters.LiveTestStages }}: + - ${{ liveTestStage.stage }} + ServiceDirectory: ${{ parameters.ServiceDirectory }} + SDKType: ${{ parameters.SDKType }} + # By default, the Artifacts list will contain everything as we won't skip an artifact unless it, + # specifically, has releaseInBatch set to false. releaseInBatch should only be set libraries, + # not ready for release, in service directories that have batch release enabled. The if statement + # below, looking for releaseInBatch not equal false has to be set this way because if the library's + # metadata in the ci.yml doesn't have this variable then it defaults to being released. + Artifacts: + - ${{ each artifact in parameters.Artifacts }}: + - ${{ if ne(artifact.releaseInBatch, 'false') }}: + - ${{ artifact }} + TestPipeline: ${{ parameters.TestPipeline }} + ArtifactName: packages + TargetDocRepoName: ${{ parameters.TargetDocRepoName }} + UseEsrpRelease: ${{ parameters.UseEsrpRelease }} + # This where the MavenBreakGlassApprovers is set for the release tasks. + ${{ if and(in(variables['Build.Reason'], 'Manual', ''), eq(parameters.ReleaseDependsOnLiveTests, 'false')) }}: + Environment: 'MavenBreakGlassApprovers' + - ${{ else }}: + - template: archetype-java-release.yml + parameters: + DependsOn: + - Build + ServiceDirectory: ${{ parameters.ServiceDirectory }} + SDKType: ${{ parameters.SDKType }} + Artifacts: ${{ parameters.Artifacts }} + TestPipeline: ${{ parameters.TestPipeline }} + ArtifactName: packages + TargetDocRepoName: ${{ parameters.TargetDocRepoName }} + UseEsrpRelease: ${{ parameters.UseEsrpRelease }} diff --git a/eng/pipelines/templates/stages/archetype-sdk-native-tests.yml b/eng/pipelines/templates/stages/archetype-sdk-native-tests.yml index 20cf37fe7246..8bdc02615114 100644 --- a/eng/pipelines/templates/stages/archetype-sdk-native-tests.yml +++ b/eng/pipelines/templates/stages/archetype-sdk-native-tests.yml @@ -38,9 +38,6 @@ parameters: - name: MaxParallel type: number default: 0 - - name: BuildInParallel - type: boolean - default: true - name: TimeoutInMinutes type: number default: 60 @@ -105,14 +102,27 @@ parameters: type: string default: $(TestOptions) -stages: - - ${{ each cloud in parameters.CloudConfig }}: - - ${{ if or(contains(parameters.Clouds, cloud.key), and(contains(variables['Build.DefinitionName'], 'tests-weekly'), contains(parameters.SupportedClouds, cloud.key))) }}: - - ${{ if not(contains(parameters.UnsupportedClouds, cloud.key)) }}: +extends: + template: /eng/pipelines/templates/stages/1es-redirect.yml + parameters: + stages: + - ${{ each cloud in parameters.CloudConfig }}: + - ${{ if or(contains(parameters.Clouds, cloud.key), and(contains(variables['Build.DefinitionName'], 'tests-weekly'), contains(parameters.SupportedClouds, cloud.key))) }}: + - ${{ if not(contains(parameters.UnsupportedClouds, cloud.key)) }}: - stage: ${{ cloud.key }}_${{ parameters.TestName }} dependsOn: [] + variables: + - template: /eng/pipelines/templates/variables/globals.yml + - template: /eng/pipelines/templates/variables/image.yml + # Convert artifact parameter objects to json and set them as variables to be used in + # pipeline jobs/stages. By setting these as a variable once we save thousands of lines + # of yaml in extreme cases. This helps us stay under the devops max yaml size limits. + - name: ArtifactsJson + value: '${{ convertToJson(parameters.Artifacts) }}' + - name: AdditionalModulesJson + value: '${{ convertToJson(parameters.AdditionalModules) }}' jobs: - - template: /eng/common/pipelines/templates/jobs/archetype-sdk-tests-generate.yml + - template: /eng/common/pipelines/templates/jobs/generate-job-matrix.yml parameters: SparseCheckoutPaths: - "sdk/${{ parameters.ServiceDirectory }}/**/*.json" @@ -128,16 +138,12 @@ stages: - ${{ parameters.PostSteps }} EnvVars: ${{ parameters.EnvVars }} MaxParallel: ${{ parameters.MaxParallel }} - BuildInParallel: ${{ parameters.BuildInParallel }} TimeoutInMinutes: ${{ parameters.TimeoutInMinutes }} Location: ${{ parameters.Location }} ServiceDirectory: ${{ parameters.ServiceDirectory }} TestResourceDirectories: ${{ parameters.TestResourceDirectories }} - TestSetupSteps: ${{ parameters.TestSetupSteps }} TestMode: ${{ parameters.TestMode }} TestVersionSupport: ${{ parameters.TestVersionSupport }} - Artifacts: ${{ parameters.Artifacts }} - AdditionalModules: ${{ parameters.AdditionalModules }} TestResultsFiles: ${{ parameters.TestResultsFiles }} DisableAzureResourceCreation: ${{ parameters.DisableAzureResourceCreation }} TestGoals: ${{ parameters.TestGoals }} diff --git a/eng/pipelines/templates/stages/archetype-sdk-pom-only.yml b/eng/pipelines/templates/stages/archetype-sdk-pom-only.yml index a130bd9ffc73..3300ecc99ed6 100644 --- a/eng/pipelines/templates/stages/archetype-sdk-pom-only.yml +++ b/eng/pipelines/templates/stages/archetype-sdk-pom-only.yml @@ -1,10 +1,3 @@ -resources: - repositories: - - repository: azure-sdk-build-tools - type: git - name: internal/azure-sdk-build-tools - ref: refs/tags/azure-sdk-build-tools_20230829.1 - parameters: - name: Artifacts type: object @@ -28,38 +21,46 @@ parameters: type: string default: azure-docs-sdk-java -stages: - - stage: Build - jobs: - - template: /eng/pipelines/templates/jobs/build-validate-pom.yml - parameters: - ServiceDirectory: ${{parameters.ServiceDirectory}} - SDKType: ${{parameters.SDKType}} - Artifacts: - - ${{ if and(eq(variables['System.TeamProject'], 'internal'), eq(variables['Build.Reason'], 'Manual')) }}: - - ${{ each artifact in parameters.Artifacts }}: - - ${{ if ne(artifact.releaseInBatch, 'false') }}: - - ${{ artifact }} - - ${{ else }}: - - ${{ parameters.Artifacts }} +extends: + template: /eng/pipelines/templates/stages/1es-redirect.yml + parameters: + stages: + - stage: Build + variables: + - template: /eng/pipelines/templates/variables/globals.yml + - template: /eng/pipelines/templates/variables/image.yml + - name: ArtifactsJson + value: '${{ convertToJson(parameters.Artifacts) }}' + jobs: + - template: /eng/pipelines/templates/jobs/build-validate-pom.yml + parameters: + ServiceDirectory: ${{parameters.ServiceDirectory}} + SDKType: ${{parameters.SDKType}} + Artifacts: + - ${{ if and(eq(variables['System.TeamProject'], 'internal'), eq(variables['Build.Reason'], 'Manual')) }}: + - ${{ each artifact in parameters.Artifacts }}: + - ${{ if ne(artifact.releaseInBatch, 'false') }}: + - ${{ artifact }} + - ${{ else }}: + - ${{ parameters.Artifacts }} - # The Prerelease and Release stages are conditioned on whether we are building a pull request and the branch. - - ${{if and(ne(variables['Build.Reason'], 'PullRequest'), eq(variables['System.TeamProject'], 'internal'))}}: - - template: archetype-java-release-pom-only.yml - parameters: - DependsOn: Build - ServiceDirectory: ${{parameters.ServiceDirectory}} - RunIntegrationStage: false - SDKType: ${{parameters.SDKType}} - Artifacts: - - ${{ if and(eq(variables['System.TeamProject'], 'internal'), eq(variables['Build.Reason'], 'Manual')) }}: - - ${{ each artifact in parameters.Artifacts }}: - - ${{ if ne(artifact.releaseInBatch, 'false') }}: - - ${{ artifact }} - - ${{ else }}: - - ${{ parameters.Artifacts }} - ArtifactName: packages - TargetDocRepoOwner: ${{parameters.TargetDocRepoOwner}} - TargetDocRepoName: ${{parameters.TargetDocRepoName}} - EnableIntegrationStage: false + # The Prerelease and Release stages are conditioned on whether we are building a pull request and the branch. + - ${{if and(ne(variables['Build.Reason'], 'PullRequest'), eq(variables['System.TeamProject'], 'internal'))}}: + - template: archetype-java-release-pom-only.yml + parameters: + DependsOn: Build + ServiceDirectory: ${{parameters.ServiceDirectory}} + RunIntegrationStage: false + SDKType: ${{parameters.SDKType}} + Artifacts: + - ${{ if and(eq(variables['System.TeamProject'], 'internal'), eq(variables['Build.Reason'], 'Manual')) }}: + - ${{ each artifact in parameters.Artifacts }}: + - ${{ if ne(artifact.releaseInBatch, 'false') }}: + - ${{ artifact }} + - ${{ else }}: + - ${{ parameters.Artifacts }} + ArtifactName: packages + TargetDocRepoOwner: ${{parameters.TargetDocRepoOwner}} + TargetDocRepoName: ${{parameters.TargetDocRepoName}} + EnableIntegrationStage: false diff --git a/eng/pipelines/templates/stages/archetype-sdk-tests-isolated.yml b/eng/pipelines/templates/stages/archetype-sdk-tests-isolated.yml new file mode 100644 index 000000000000..bc91d23f976a --- /dev/null +++ b/eng/pipelines/templates/stages/archetype-sdk-tests-isolated.yml @@ -0,0 +1,175 @@ +parameters: +- name: TestName + type: string + default: 'LiveTest' +- name: AdditionalPlatforms + type: object + default: {} +- name: Clouds + type: string + default: 'Public' +- name: SupportedClouds + type: string + default: 'Public' +- name: UnsupportedClouds + type: string + default: '' +- name: Artifacts + type: object + default: [] +- name: AdditionalModules + type: object + default: [] +- name: TestResultsFiles + type: object + default: '' +- name: DisableAzureResourceCreation + type: boolean + default: false +- name: PreSteps + type: object + default: [] +- name: PostSteps + type: object + default: [] +- name: EnvVars + type: object + default: {} +- name: MaxParallel + type: number + default: 0 +- name: TimeoutInMinutes + type: number + default: 60 +- name: Location + type: string + default: '' +- name: ServiceDirectory + type: string + default: not-specified +- name: TestResourceDirectories + type: object + default: +- name: TestMode + type: string + default: 'LIVE' +- name: TestVersionSupport + type: boolean + default: false +- name: CloudConfig + type: object + default: + Public: + SubscriptionConfiguration: $(sub-config-azure-cloud-test-resources) + Preview: + SubscriptionConfiguration: $(sub-config-azure-cloud-test-resources-preview) + Canary: + SubscriptionConfiguration: $(sub-config-azure-cloud-test-resources) + Location: 'centraluseuap' + UsGov: + SubscriptionConfiguration: $(sub-config-gov-test-resources) + China: + SubscriptionConfiguration: $(sub-config-cn-test-resources) +- name: MatrixConfigs + type: object + default: + - Name: Java_live_test_base + Path: eng/pipelines/templates/stages/platform-matrix.json + Selection: sparse + GenerateVMJobs: true +- name: AdditionalMatrixConfigs + type: object + default: [] +- name: MatrixFilters + type: object + default: [] +- name: MatrixReplace + type: object + default: [] +- name: PlatformPreSteps + type: object + default: [] +- name: PlatformPostSteps + type: object + default: [] +- name: TestGoals + type: string + default: $(TestGoals) +- name: TestOptions + type: string + default: $(TestOptions) +- name: UseHttpFaultInjector + type: boolean + default: false +- name: CalledFromClient + type: boolean + default: false +- name: AdditionalVariables + type: object + default: [] + +stages: +- ${{ each cloud in parameters.CloudConfig }}: + - ${{ if or(contains(parameters.Clouds, cloud.key), and(contains(variables['Build.DefinitionName'], 'tests-weekly'), contains(parameters.SupportedClouds, cloud.key))) }}: + - ${{ if not(contains(parameters.UnsupportedClouds, cloud.key)) }}: + - stage: ${{ cloud.key }}_${{ parameters.TestName }} + dependsOn: [] + variables: + - template: /eng/pipelines/templates/variables/globals.yml + - template: /eng/pipelines/templates/variables/image.yml + # Convert artifact parameter objects to json and set them as variables to be used in + # pipeline jobs/stages. By setting these as a variable once we save thousands of lines + # of yaml in extreme cases. This helps us stay under the devops max yaml size limits. + - name: ArtifactsJson + value: '${{ convertToJson(parameters.Artifacts) }}' + - name: AdditionalModulesJson + value: '${{ convertToJson(parameters.AdditionalModules) }}' + - ${{ parameters.AdditionalVariables }} + jobs: + - template: /eng/common/pipelines/templates/jobs/generate-job-matrix.yml + parameters: + SparseCheckoutPaths: + - "sdk/${{ parameters.ServiceDirectory }}/**/*.json" + - '!sdk/**/test-recordings/*' + - '!sdk/**/session-records/*' + JobTemplatePath: /eng/pipelines/templates/jobs/live.tests.yml + AdditionalParameters: + PreSteps: + - ${{ parameters.PlatformPreSteps }} + - ${{ parameters.PreSteps }} + PostSteps: + - ${{ parameters.PlatformPostSteps }} + - ${{ parameters.PostSteps }} + EnvVars: ${{ parameters.EnvVars }} + MaxParallel: ${{ parameters.MaxParallel }} + TimeoutInMinutes: ${{ parameters.TimeoutInMinutes }} + Location: ${{ parameters.Location }} + ServiceDirectory: ${{ parameters.ServiceDirectory }} + TestResourceDirectories: ${{ parameters.TestResourceDirectories }} + TestMode: ${{ parameters.TestMode }} + TestVersionSupport: ${{ parameters.TestVersionSupport }} + TestResultsFiles: ${{ parameters.TestResultsFiles }} + DisableAzureResourceCreation: ${{ parameters.DisableAzureResourceCreation }} + TestGoals: ${{ parameters.TestGoals }} + TestOptions: ${{ parameters.TestOptions }} + UseHttpFaultInjector: ${{ parameters.UseHttpFaultInjector }} + + MatrixConfigs: + # Enumerate platforms and additional platforms based on supported clouds (sparse platform<-->cloud matrix). + - ${{ each config in parameters.MatrixConfigs }}: + - ${{ config }} + - ${{ each config in parameters.AdditionalMatrixConfigs }}: + - ${{ config }} + MatrixFilters: + - ${{ each cloudFilter in cloud.value.MatrixFilters }}: + - ${{ cloudFilter }} + - ${{ parameters.MatrixFilters }} + MatrixReplace: + - ${{ each cloudReplace in cloud.value.MatrixReplace }}: + - ${{ cloudReplace }} + - ${{ parameters.MatrixReplace }} + CloudConfig: + SubscriptionConfiguration: ${{ cloud.value.SubscriptionConfiguration }} + SubscriptionConfigurations: ${{ cloud.value.SubscriptionConfigurations }} + Location: ${{ coalesce(parameters.Location, cloud.value.Location) }} + Cloud: ${{ cloud.key }} diff --git a/eng/pipelines/templates/stages/archetype-sdk-tests.yml b/eng/pipelines/templates/stages/archetype-sdk-tests.yml index 987a910f77c9..dc2887900b97 100644 --- a/eng/pipelines/templates/stages/archetype-sdk-tests.yml +++ b/eng/pipelines/templates/stages/archetype-sdk-tests.yml @@ -1,168 +1,116 @@ parameters: -- name: TestName - type: string - default: 'LiveTest' -- name: AdditionalPlatforms - type: object - default: {} -- name: Clouds - type: string - default: 'Public' -- name: SupportedClouds - type: string - default: 'Public' -- name: UnsupportedClouds - type: string - default: '' -- name: Artifacts - type: object - default: [] -- name: AdditionalModules - type: object - default: [] -- name: TestResultsFiles - type: object - default: '' -- name: DisableAzureResourceCreation - type: boolean - default: false -- name: PreSteps - type: object - default: [] -- name: PostSteps - type: object - default: [] -- name: EnvVars - type: object - default: {} -- name: MaxParallel - type: number - default: 0 -- name: BuildInParallel - type: boolean - default: true -- name: TimeoutInMinutes - type: number - default: 60 -- name: Location - type: string - default: '' -- name: ServiceDirectory - type: string - default: not-specified -- name: TestResourceDirectories - type: object - default: -- name: TestSetupSteps - type: stepList - default: [] -- name: TestMode - type: string - default: 'LIVE' -- name: TestVersionSupport - type: boolean - default: false -- name: CloudConfig - type: object - default: - Public: - SubscriptionConfiguration: $(sub-config-azure-cloud-test-resources) - Preview: - SubscriptionConfiguration: $(sub-config-azure-cloud-test-resources-preview) - Canary: - SubscriptionConfiguration: $(sub-config-azure-cloud-test-resources) - Location: 'centraluseuap' - UsGov: - SubscriptionConfiguration: $(sub-config-gov-test-resources) - China: - SubscriptionConfiguration: $(sub-config-cn-test-resources) -- name: MatrixConfigs - type: object - default: - - Name: Java_live_test_base - Path: eng/pipelines/templates/stages/platform-matrix.json - Selection: sparse - GenerateVMJobs: true -- name: AdditionalMatrixConfigs - type: object - default: [] -- name: MatrixFilters - type: object - default: [] -- name: MatrixReplace - type: object - default: [] -- name: PlatformPreSteps - type: object - default: [] -- name: PlatformPostSteps - type: object - default: [] -- name: TestGoals - type: string - default: $(TestGoals) -- name: TestOptions - type: string - default: $(TestOptions) -- name: UseHttpFaultInjector - type: boolean - default: false + - name: TestName + type: string + default: 'LiveTest' + - name: AdditionalPlatforms + type: object + default: {} + - name: Clouds + type: string + default: 'Public' + - name: SupportedClouds + type: string + default: 'Public' + - name: UnsupportedClouds + type: string + default: '' + - name: Artifacts + type: object + default: [] + - name: AdditionalModules + type: object + default: [] + - name: TestResultsFiles + type: object + default: '' + - name: DisableAzureResourceCreation + type: boolean + default: false + - name: PreSteps + type: object + default: [] + - name: PostSteps + type: object + default: [] + - name: EnvVars + type: object + default: {} + - name: MaxParallel + type: number + default: 0 + - name: TimeoutInMinutes + type: number + default: 60 + - name: Location + type: string + default: '' + - name: ServiceDirectory + type: string + default: not-specified + - name: TestResourceDirectories + type: object + default: + - name: TestMode + type: string + default: 'LIVE' + - name: TestVersionSupport + type: boolean + default: false + - name: CloudConfig + type: object + default: + Public: + SubscriptionConfiguration: $(sub-config-azure-cloud-test-resources) + Preview: + SubscriptionConfiguration: $(sub-config-azure-cloud-test-resources-preview) + Canary: + SubscriptionConfiguration: $(sub-config-azure-cloud-test-resources) + Location: 'centraluseuap' + UsGov: + SubscriptionConfiguration: $(sub-config-gov-test-resources) + China: + SubscriptionConfiguration: $(sub-config-cn-test-resources) + - name: MatrixConfigs + type: object + default: + - Name: Java_live_test_base + Path: eng/pipelines/templates/stages/platform-matrix.json + Selection: sparse + GenerateVMJobs: true + - name: AdditionalMatrixConfigs + type: object + default: [] + - name: MatrixFilters + type: object + default: [] + - name: MatrixReplace + type: object + default: [] + - name: PlatformPreSteps + type: object + default: [] + - name: PlatformPostSteps + type: object + default: [] + - name: TestGoals + type: string + default: $(TestGoals) + - name: TestOptions + type: string + default: $(TestOptions) + - name: UseHttpFaultInjector + type: boolean + default: false + - name: CalledFromClient + type: boolean + default: false + - name: AdditionalVariables + type: object + default: [] -stages: -- ${{ each cloud in parameters.CloudConfig }}: - - ${{ if or(contains(parameters.Clouds, cloud.key), and(contains(variables['Build.DefinitionName'], 'tests-weekly'), contains(parameters.SupportedClouds, cloud.key))) }}: - - ${{ if not(contains(parameters.UnsupportedClouds, cloud.key)) }}: - - stage: ${{ cloud.key }}_${{ parameters.TestName }} - dependsOn: [] - jobs: - - template: /eng/common/pipelines/templates/jobs/archetype-sdk-tests-generate.yml - parameters: - SparseCheckoutPaths: - - "sdk/${{ parameters.ServiceDirectory }}/**/*.json" - - '!sdk/**/test-recordings/*' - - '!sdk/**/session-records/*' - JobTemplatePath: /eng/pipelines/templates/jobs/live.tests.yml - AdditionalParameters: - PreSteps: - - ${{ parameters.PlatformPreSteps }} - - ${{ parameters.PreSteps }} - PostSteps: - - ${{ parameters.PlatformPostSteps }} - - ${{ parameters.PostSteps }} - EnvVars: ${{ parameters.EnvVars }} - MaxParallel: ${{ parameters.MaxParallel }} - BuildInParallel: ${{ parameters.BuildInParallel }} - TimeoutInMinutes: ${{ parameters.TimeoutInMinutes }} - Location: ${{ parameters.Location }} - ServiceDirectory: ${{ parameters.ServiceDirectory }} - TestResourceDirectories: ${{ parameters.TestResourceDirectories }} - TestSetupSteps: ${{ parameters.TestSetupSteps }} - TestMode: ${{ parameters.TestMode }} - TestVersionSupport: ${{ parameters.TestVersionSupport }} - Artifacts: ${{ parameters.Artifacts }} - AdditionalModules: ${{ parameters.AdditionalModules }} - TestResultsFiles: ${{ parameters.TestResultsFiles }} - DisableAzureResourceCreation: ${{ parameters.DisableAzureResourceCreation }} - TestGoals: ${{ parameters.TestGoals }} - TestOptions: ${{ parameters.TestOptions }} - UseHttpFaultInjector: ${{ parameters.UseHttpFaultInjector }} - - MatrixConfigs: - # Enumerate platforms and additional platforms based on supported clouds (sparse platform<-->cloud matrix). - - ${{ each config in parameters.MatrixConfigs }}: - - ${{ config }} - - ${{ each config in parameters.AdditionalMatrixConfigs }}: - - ${{ config }} - MatrixFilters: - - ${{ each cloudFilter in cloud.value.MatrixFilters }}: - - ${{ cloudFilter }} - - ${{ parameters.MatrixFilters }} - MatrixReplace: - - ${{ each cloudReplace in cloud.value.MatrixReplace }}: - - ${{ cloudReplace }} - - ${{ parameters.MatrixReplace }} - CloudConfig: - SubscriptionConfiguration: ${{ cloud.value.SubscriptionConfiguration }} - SubscriptionConfigurations: ${{ cloud.value.SubscriptionConfigurations }} - Location: ${{ coalesce(parameters.Location, cloud.value.Location) }} - Cloud: ${{ cloud.key }} +extends: + template: /eng/pipelines/templates/stages/1es-redirect.yml + parameters: + stages: + - template: /eng/pipelines/templates/stages/archetype-sdk-tests-isolated.yml + parameters: ${{ parameters }} diff --git a/eng/pipelines/templates/stages/cosmos-emulator-matrix.json b/eng/pipelines/templates/stages/cosmos-emulator-matrix.json index aa6190a49d3c..6b4b78e3f8bc 100644 --- a/eng/pipelines/templates/stages/cosmos-emulator-matrix.json +++ b/eng/pipelines/templates/stages/cosmos-emulator-matrix.json @@ -1,7 +1,7 @@ { "matrix": { "Agent": { - "windows-2022": { "OSVmImage": "windows-2022", "Pool": "azsdk-pool-mms-win-2022-general" } + "windows-2022": { "OSVmImage": "env:WINDOWSVMIMAGE", "Pool": "env:WINDOWSPOOL" } }, "EmulatorConfig": { "Emulator Only Integration Tests Tcp - Java 8": { diff --git a/eng/pipelines/templates/stages/cosmos-sdk-client.yml b/eng/pipelines/templates/stages/cosmos-sdk-client.yml index 4017cab87236..bd296d74e53b 100644 --- a/eng/pipelines/templates/stages/cosmos-sdk-client.yml +++ b/eng/pipelines/templates/stages/cosmos-sdk-client.yml @@ -1,10 +1,3 @@ -resources: - repositories: - - repository: azure-sdk-build-tools - type: git - name: internal/azure-sdk-build-tools - ref: refs/tags/azure-sdk-build-tools_20230829.1 - parameters: - name: Artifacts type: object @@ -34,129 +27,141 @@ parameters: type: object default: [] -variables: - - template: /eng/pipelines/templates/variables/globals.yml +extends: + template: /eng/pipelines/templates/stages/1es-redirect.yml + parameters: + stages: + - stage: Build + variables: + - template: /eng/pipelines/templates/variables/globals.yml + - template: /eng/pipelines/templates/variables/image.yml + # Convert artifact parameter objects to json and set them as variables to be used in + # pipeline jobs/stages. By setting these as a variable once we save thousands of lines + # of yaml in extreme cases. This helps us stay under the devops max yaml size limits. + - name: ArtifactsJson + value: '${{ convertToJson(parameters.Artifacts) }}' + - name: AdditionalModulesJson + value: '${{ convertToJson(parameters.AdditionalModules) }}' + jobs: + - template: /eng/pipelines/templates/jobs/ci.yml + parameters: + JavaBuildVersion: '1.17' + ServiceDirectory: ${{parameters.ServiceDirectory}} + Artifacts: ${{ parameters.Artifacts }} + ReleaseArtifacts: + - ${{ if and(eq(variables['System.TeamProject'], 'internal'), eq(variables['Build.Reason'], 'Manual')) }}: + - ${{ each artifact in parameters.Artifacts }}: + - ${{ if ne(artifact.releaseInBatch, 'false') }}: + - ${{ artifact }} + - ${{ else }}: + - ${{ parameters.Artifacts }} + SDKType: ${{parameters.SDKType}} + MatrixConfigs: + - Name: Cosmos_ci_test + Path: eng/pipelines/templates/stages/platform-matrix.json + Selection: sparse + NonSparseParameters: Agent + GenerateVMJobs: true + MatrixFilters: + - TestFromSource=^$|false + - ${{ parameters.MatrixFilters }} + MatrixReplace: + - AZURE_TEST.*=.*/ + - .*Version=1.21/1.17 + BuildParallelization: 1 + TestOptions: '-Punit' -stages: - - stage: Build - jobs: - - template: /eng/pipelines/templates/jobs/ci.yml - parameters: - JavaBuildVersion: '1.17' - ServiceDirectory: ${{parameters.ServiceDirectory}} - Artifacts: ${{ parameters.Artifacts }} - ReleaseArtifacts: - - ${{ if and(eq(variables['System.TeamProject'], 'internal'), eq(variables['Build.Reason'], 'Manual')) }}: - - ${{ each artifact in parameters.Artifacts }}: - - ${{ if ne(artifact.releaseInBatch, 'false') }}: - - ${{ artifact }} - - ${{ else }}: - - ${{ parameters.Artifacts }} - AdditionalModules: ${{ parameters.AdditionalModules }} - SDKType: ${{parameters.SDKType}} - MatrixConfigs: - - Name: Cosmos_ci_test - Path: eng/pipelines/templates/stages/platform-matrix.json - Selection: sparse - NonSparseParameters: Agent - GenerateVMJobs: true - MatrixFilters: - - TestFromSource=^$|false - - ${{ parameters.MatrixFilters }} - MatrixReplace: - - AZURE_TEST.*=.*/ - - .*Version=1.21/1.17 - BuildParallelization: 1 - TestOptions: '-Punit' + - stage: TestEmulator + displayName: Test Emulator + dependsOn: [] + variables: + - template: /eng/pipelines/templates/variables/globals.yml + - template: /eng/pipelines/templates/variables/image.yml + - name: ArtifactsJson + value: '${{ convertToJson(parameters.Artifacts) }}' + jobs: + - template: /eng/common/pipelines/templates/jobs/generate-job-matrix.yml + parameters: + JobTemplatePath: /eng/pipelines/templates/jobs/live.tests.yml + MatrixConfigs: + - Name: Cosmos_emulator_integration + Path: eng/pipelines/templates/stages/cosmos-emulator-matrix.json + Selection: all + GenerateVMJobs: true + MatrixFilters: + - ${{ parameters.LanguageFilter }} + - ${{ parameters.MatrixFilters }} + AdditionalParameters: + BuildParallelization: 1 + DisableAzureResourceCreation: true + ServiceDirectory: cosmos + ACCOUNT_HOST: 'https://localhost:8081/' + ACCOUNT_KEY: 'C2y6yDjf5/R+ob0N8A7Cgv30VRDJIWEHLM+4QDU5DE2nQ9nDuVTqobD4b8mGGyPMbIZnqyMsEcaGQy67XIw/Jw==' + SECONDARY_ACCOUNT_KEY: 'C2y6yDjf5/R+ob0N8A7Cgv30VRDJIWEHLM+4QDU5DE2nQ9nDuVTqobD4b8mGGyPMbIZnqyMsEcaGQy67XIw/Jw==' + # Increased timeout to 90 because of cosmos emulator taking 25-30 mins to download emulator + # Issue filed to improve download speed: https://github.com/Azure/azure-sdk-for-java/issues/12970 + TimeoutInMinutes: 90 + TestGoals: 'clean verify' + TestOptions: '$(ProfileFlag) $(AdditionalArgs)' - - stage: TestEmulator - displayName: Test Emulator - dependsOn: [] - jobs: - - template: /eng/common/pipelines/templates/jobs/archetype-sdk-tests-generate.yml - parameters: - JobTemplatePath: /eng/pipelines/templates/jobs/live.tests.yml - MatrixConfigs: - - Name: Cosmos_emulator_integration - Path: eng/pipelines/templates/stages/cosmos-emulator-matrix.json - Selection: all - GenerateVMJobs: true - MatrixFilters: - - ${{ parameters.LanguageFilter }} - - ${{ parameters.MatrixFilters }} - AdditionalParameters: - BuildParallelization: 1 - DisableAzureResourceCreation: true - ServiceDirectory: cosmos - Artifacts: ${{ parameters.Artifacts }} - AdditionalModules: ${{ parameters.AdditionalModules }} - ACCOUNT_HOST: 'https://localhost:8081/' - ACCOUNT_KEY: 'C2y6yDjf5/R+ob0N8A7Cgv30VRDJIWEHLM+4QDU5DE2nQ9nDuVTqobD4b8mGGyPMbIZnqyMsEcaGQy67XIw/Jw==' - SECONDARY_ACCOUNT_KEY: 'C2y6yDjf5/R+ob0N8A7Cgv30VRDJIWEHLM+4QDU5DE2nQ9nDuVTqobD4b8mGGyPMbIZnqyMsEcaGQy67XIw/Jw==' - # Increased timeout to 90 because of cosmos emulator taking 25-30 mins to download emulator - # Issue filed to improve download speed: https://github.com/Azure/azure-sdk-for-java/issues/12970 - TimeoutInMinutes: 90 - TestGoals: 'clean verify' - TestOptions: '$(ProfileFlag) $(AdditionalArgs)' + PreSteps: + - template: /eng/common/pipelines/templates/steps/cosmos-emulator.yml + parameters: + StartParameters: '/noexplorer /noui /enablepreview /EnableSqlComputeEndpoint /SqlComputePort=9999 /disableratelimiting /partitioncount=50 /consistency=Strong' + - powershell: | + $Key = 'C2y6yDjf5/R+ob0N8A7Cgv30VRDJIWEHLM+4QDU5DE2nQ9nDuVTqobD4b8mGGyPMbIZnqyMsEcaGQy67XIw/Jw==' + $password = ConvertTo-SecureString -String $Key -Force -AsPlainText + $cert = Get-ChildItem cert:\LocalMachine\My | Where-Object { $_.FriendlyName -eq "DocumentDbEmulatorCertificate" } + Export-PfxCertificate -Cert $cert -FilePath ".\CosmosDbEmulatorCert.pfx" -Password $password | Out-Null + $cert = New-Object System.Security.Cryptography.X509Certificates.X509Certificate2 + $cert.Import(".\CosmosDbEmulatorCert.pfx", $Key, "DefaultKeySet") + $cert | Export-Certificate -FilePath "$env:temp\CosmosDbEmulatorCert.cer" -Type CERT + displayName: 'Export Cosmos DB Emulator Certificate' + - powershell: | + if (Test-Path $env:JAVA_HOME\jre\lib\security) { + cd $env:JAVA_HOME\jre\lib\security + } elseif (Test-Path $env:JAVA_HOME\lib\security) { + cd $env:JAVA_HOME\lib\security + } else { + Write-Error "JDK directory structure is unknown and unsupported. JAVA_HOME is '$env:JAVA_HOME'" + exit 1 + } + cp $env:temp\CosmosDbEmulatorCert.cer . + keytool -keystore cacerts -importcert -noprompt -trustcacerts -alias CosmosDbEmulatorCert -file CosmosDbEmulatorCert.cer -storepass changeit + displayName: 'Create Java TrustStore' - PreSteps: - - template: /eng/common/pipelines/templates/steps/cosmos-emulator.yml + # The Prerelease and Release stages are conditioned on whether we are building a pull request and the branch. + - ${{if and(ne(variables['Build.Reason'], 'PullRequest'), eq(variables['System.TeamProject'], 'internal'))}}: + - ${{ if eq(parameters.EnableBatchRelease, 'true') }}: + - template: archetype-java-release-batch.yml parameters: - StartParameters: '/noexplorer /noui /enablepreview /EnableSqlComputeEndpoint /SqlComputePort=9999 /disableratelimiting /partitioncount=50 /consistency=Strong' - - powershell: | - $Key = 'C2y6yDjf5/R+ob0N8A7Cgv30VRDJIWEHLM+4QDU5DE2nQ9nDuVTqobD4b8mGGyPMbIZnqyMsEcaGQy67XIw/Jw==' - $password = ConvertTo-SecureString -String $Key -Force -AsPlainText - $cert = Get-ChildItem cert:\LocalMachine\My | Where-Object { $_.FriendlyName -eq "DocumentDbEmulatorCertificate" } - Export-PfxCertificate -Cert $cert -FilePath ".\CosmosDbEmulatorCert.pfx" -Password $password | Out-Null - $cert = New-Object System.Security.Cryptography.X509Certificates.X509Certificate2 - $cert.Import(".\CosmosDbEmulatorCert.pfx", $Key, "DefaultKeySet") - $cert | Export-Certificate -FilePath "$env:temp\CosmosDbEmulatorCert.cer" -Type CERT - displayName: 'Export Cosmos DB Emulator Certificate' - - powershell: | - if (Test-Path $env:JAVA_HOME\jre\lib\security) { - cd $env:JAVA_HOME\jre\lib\security - } elseif (Test-Path $env:JAVA_HOME\lib\security) { - cd $env:JAVA_HOME\lib\security - } else { - Write-Error "JDK directory structure is unknown and unsupported. JAVA_HOME is '$env:JAVA_HOME'" - exit 1 - } - cp $env:temp\CosmosDbEmulatorCert.cer . - keytool -keystore cacerts -importcert -noprompt -trustcacerts -alias CosmosDbEmulatorCert -file CosmosDbEmulatorCert.cer -storepass changeit - displayName: 'Create Java TrustStore' - - # The Prerelease and Release stages are conditioned on whether we are building a pull request and the branch. - - ${{if and(ne(variables['Build.Reason'], 'PullRequest'), eq(variables['System.TeamProject'], 'internal'))}}: - - ${{ if eq(parameters.EnableBatchRelease, 'true') }}: - - template: archetype-java-release-batch.yml - parameters: - DependsOn: - - Build - - TestEmulator - ServiceDirectory: ${{ parameters.ServiceDirectory }} - SDKType: ${{ parameters.SDKType }} - # By default, the Artifacts list will contain everything as we won't skip an artifact unless it, - # specifically, has releaseInBatch set to false. releaseInBatch should only be set libraries, - # not ready for release, in service directories that have batch release enabled. The if statement - # below, looking for releaseInBatch not equal false has to be set this way because if the library's - # metadata in the ci.yml doesn't have this variable then it defaults to being released. - Artifacts: - - ${{ each artifact in parameters.Artifacts }}: - - ${{ if ne(artifact.releaseInBatch, 'false') }}: - - ${{ artifact }} - TestPipeline: false - ArtifactName: packages - TargetDocRepoName: ${{ parameters.TargetDocRepoName }} - UseEsrpRelease: ${{ parameters.UseEsrpRelease }} - - ${{ else }}: - - template: archetype-java-release.yml - parameters: - DependsOn: - - Build - - TestEmulator - ServiceDirectory: ${{ parameters.ServiceDirectory }} - SDKType: ${{ parameters.SDKType }} - Artifacts: ${{ parameters.Artifacts }} - ArtifactName: packages - TargetDocRepoName: ${{ parameters.TargetDocRepoName }} - UseEsrpRelease: ${{ parameters.UseEsrpRelease }} + DependsOn: + - Build + - TestEmulator + ServiceDirectory: ${{ parameters.ServiceDirectory }} + SDKType: ${{ parameters.SDKType }} + # By default, the Artifacts list will contain everything as we won't skip an artifact unless it, + # specifically, has releaseInBatch set to false. releaseInBatch should only be set libraries, + # not ready for release, in service directories that have batch release enabled. The if statement + # below, looking for releaseInBatch not equal false has to be set this way because if the library's + # metadata in the ci.yml doesn't have this variable then it defaults to being released. + Artifacts: + - ${{ each artifact in parameters.Artifacts }}: + - ${{ if ne(artifact.releaseInBatch, 'false') }}: + - ${{ artifact }} + TestPipeline: false + ArtifactName: packages + TargetDocRepoName: ${{ parameters.TargetDocRepoName }} + UseEsrpRelease: ${{ parameters.UseEsrpRelease }} + - ${{ else }}: + - template: archetype-java-release.yml + parameters: + DependsOn: + - Build + - TestEmulator + ServiceDirectory: ${{ parameters.ServiceDirectory }} + SDKType: ${{ parameters.SDKType }} + Artifacts: ${{ parameters.Artifacts }} + ArtifactName: packages + TargetDocRepoName: ${{ parameters.TargetDocRepoName }} + UseEsrpRelease: ${{ parameters.UseEsrpRelease }} diff --git a/eng/pipelines/templates/stages/native-platform-matrix.json b/eng/pipelines/templates/stages/native-platform-matrix.json index e6a62f87079c..4752c7e38a5f 100644 --- a/eng/pipelines/templates/stages/native-platform-matrix.json +++ b/eng/pipelines/templates/stages/native-platform-matrix.json @@ -4,7 +4,7 @@ }, "matrix": { "Agent": { - "ubuntu-20.04": { "OSVmImage": "MMSUbuntu20.04", "Pool": "azsdk-pool-mms-ubuntu-2004-general" } + "ubuntu-20.04": { "OSVmImage": "env:LINUXVMIMAGE", "Pool": "env:LINUXPOOL" } }, "JavaTestVersion": [ "1.11" ], "AZURE_TEST_HTTP_CLIENTS": [ "netty" ], @@ -16,7 +16,7 @@ "include": [ { "Agent": { - "ubuntu-20.04": { "OSVmImage": "MMSUbuntu20.04", "Pool": "azsdk-pool-mms-ubuntu-2004-general" } + "ubuntu-20.04": { "OSVmImage": "env:LINUXVMIMAGE", "Pool": "env:LINUXPOOL" } }, "JavaTestVersion": "1.11", "AZURE_TEST_HTTP_CLIENTS": "netty", diff --git a/eng/pipelines/templates/stages/platform-matrix.json b/eng/pipelines/templates/stages/platform-matrix.json index 3a59e1c2bf56..672b982e45c2 100644 --- a/eng/pipelines/templates/stages/platform-matrix.json +++ b/eng/pipelines/templates/stages/platform-matrix.json @@ -4,9 +4,9 @@ }, "matrix": { "Agent": { - "ubuntu-20.04": { "OSVmImage": "MMSUbuntu20.04", "Pool": "azsdk-pool-mms-ubuntu-2004-general" }, - "windows-2022": { "OSVmImage": "windows-2022", "Pool": "azsdk-pool-mms-win-2022-general" }, - "macos-11": { "OSVmImage": "macos-11", "Pool": "Azure Pipelines" } + "ubuntu-20.04": { "OSVmImage": "env:LINUXVMIMAGE", "Pool": "env:LINUXPOOL" }, + "windows-2022": { "OSVmImage": "env:WINDOWSVMIMAGE", "Pool": "env:WINDOWSPOOL" }, + "macos-11": { "OSVmImage": "env:MACVMIMAGE", "Pool": "env:MACPOOL" } }, "JavaTestVersion": [ "1.8", "1.21" ], "AZURE_TEST_HTTP_CLIENTS": [ "okhttp", "netty" ], @@ -17,14 +17,14 @@ }, "exclude": [ { - "Pool": "azsdk-pool-mms-win-2022-general", + "Pool": "env:WINDOWSPOOL", "JavaTestVersion": "1.21" } ], "include": [ { "Agent": { - "ubuntu-20.04": { "OSVmImage": "MMSUbuntu20.04", "Pool": "azsdk-pool-mms-ubuntu-2004-general" } + "ubuntu-20.04": { "OSVmImage": "env:LINUXVMIMAGE", "Pool": "env:LINUXPOOL" } }, "JavaTestVersion": "1.21", "AZURE_TEST_HTTP_CLIENTS": "netty", @@ -35,7 +35,7 @@ }, { "Agent": { - "windows-2022": { "OSVmImage": "windows-2022", "Pool": "azsdk-pool-mms-win-2022-general" } + "windows-2022": { "OSVmImage": "env:WINDOWSVMIMAGE", "Pool": "env:WINDOWSPOOL" } }, "JavaTestVersion": "1.21", "AZURE_TEST_HTTP_CLIENTS": "netty", @@ -46,7 +46,7 @@ }, { "Agent": { - "ubuntu-20.04": { "OSVmImage": "MMSUbuntu20.04", "Pool": "azsdk-pool-mms-ubuntu-2004-general" } + "ubuntu-20.04": { "OSVmImage": "env:LINUXVMIMAGE", "Pool": "env:LINUXPOOL" } }, "JavaTestVersion": "1.11", "AZURE_TEST_HTTP_CLIENTS": "netty", @@ -57,7 +57,7 @@ }, { "Agent": { - "ubuntu-20.04": { "OSVmImage": "MMSUbuntu20.04", "Pool": "azsdk-pool-mms-ubuntu-2004-general" } + "ubuntu-20.04": { "OSVmImage": "env:LINUXVMIMAGE", "Pool": "env:LINUXPOOL" } }, "JavaTestVersion": "1.17", "AZURE_TEST_HTTP_CLIENTS": "netty", diff --git a/eng/pipelines/templates/steps/build-and-test-native.yml b/eng/pipelines/templates/steps/build-and-test-native.yml index 88f0a8f8414b..cc744ec479c0 100644 --- a/eng/pipelines/templates/steps/build-and-test-native.yml +++ b/eng/pipelines/templates/steps/build-and-test-native.yml @@ -1,10 +1,4 @@ parameters: - - name: SDKType - type: string - default: client - - name: ServiceDirectory - type: string - default: 'not-specified' # Set a default that breaks in obvious ways. - name: BuildParallelization type: string default: '2C' @@ -124,8 +118,6 @@ steps: env: ${{ parameters.TestEnvVars }} condition: and(succeeded(), eq(variables['TestFromSource'], 'true')) - - template: /eng/pipelines/templates/steps/upload-repository-on-failure.yml - - template: /eng/pipelines/templates/steps/retain-test-logs.yml - template: /eng/pipelines/templates/steps/retain-heap-dump-hprofs.yml diff --git a/eng/pipelines/templates/steps/build-and-test.yml b/eng/pipelines/templates/steps/build-and-test.yml index 8556d492ac6d..b17275dbd899 100644 --- a/eng/pipelines/templates/steps/build-and-test.yml +++ b/eng/pipelines/templates/steps/build-and-test.yml @@ -1,10 +1,4 @@ parameters: - - name: SDKType - type: string - default: client - - name: ServiceDirectory - type: string - default: 'not-specified' # Set a default that breaks in obvious ways. - name: BuildParallelization type: string default: '2C' diff --git a/eng/pipelines/templates/steps/upload-repository-on-failure.yml b/eng/pipelines/templates/steps/clean-maven-local-cache.yml similarity index 51% rename from eng/pipelines/templates/steps/upload-repository-on-failure.yml rename to eng/pipelines/templates/steps/clean-maven-local-cache.yml index 825f85f45dc3..ed5702c22c98 100644 --- a/eng/pipelines/templates/steps/upload-repository-on-failure.yml +++ b/eng/pipelines/templates/steps/clean-maven-local-cache.yml @@ -1,9 +1,4 @@ steps: - - publish: $(System.DefaultWorkingDirectory) - condition: or(eq(variables['CaptureRepositoryOnFailure'], 'true'), and(failed(), eq(variables['Build.Reason'],'Schedule'))) - displayName: 'Capture repo state for analysis' - artifact: repository-$(System.JobName) - - task: PowerShell@2 displayName: Clean up maven local cache inputs: diff --git a/eng/pipelines/templates/steps/download-credscan-suppressions.yml b/eng/pipelines/templates/steps/download-credscan-suppressions.yml new file mode 100644 index 000000000000..bb56a50e30f4 --- /dev/null +++ b/eng/pipelines/templates/steps/download-credscan-suppressions.yml @@ -0,0 +1,14 @@ +# 1es PT credscan step will fail if the suppression file path we use in other stages does not exist here. +# Checking out the repo via sparse checkout changes the devops path structure so that can't be used instead. +steps: + - pwsh: | + $ErrorActionPreference = 'Stop' + New-Item -ItemType Directory -Force eng + + $req = Invoke-WebRequest https://raw.githubusercontent.com/Azure/azure-sdk-for-java/main/eng/CredScanSuppression.json + $req.RawContent | Out-File eng/CredScanSuppression.json + + $req2 = Invoke-WebRequest https://raw.githubusercontent.com/Azure/azure-sdk-for-java/main/eng/java.gdnbaselines + $req2.RawContent | Out-File eng/java.gdnbaselines + workingDirectory: $(Build.SourcesDirectory) + displayName: Set credscan suppression/baseline file diff --git a/eng/pipelines/templates/steps/generate-project-list-and-cache-maven-repository.yml b/eng/pipelines/templates/steps/generate-project-list-and-cache-maven-repository.yml index ca8e80be9213..c9eaf3ca6c87 100644 --- a/eng/pipelines/templates/steps/generate-project-list-and-cache-maven-repository.yml +++ b/eng/pipelines/templates/steps/generate-project-list-and-cache-maven-repository.yml @@ -9,12 +9,6 @@ # The project list is also being used as a cache key. parameters: - - name: Artifacts - type: object - default: [] - - name: AdditionalModules - type: object - default: [] - name: JobType type: string default: test @@ -27,40 +21,14 @@ steps: # The ProjectList is used by subsequent steps and tasks to run CI. # The ProjectListSha256 is used by the cache key, previously the cache key was using ProjectList but it was found # that long cache keys cause caching to fail. -- pwsh: | - $artifacts = '${{ convertToJson(parameters.Artifacts) }}' | ConvertFrom-Json - $additionalModules = '${{ convertToJson(parameters.AdditionalModules) }}' | ConvertFrom-Json - - $projectList = @() - $artifactsList = @() - $additionalModulesList = @() - foreach ($artifact in $artifacts) { - $projectList += "$($artifact.groupId):$($artifact.name)" - $artifactsList += "$($artifact.groupId):$($artifact.name)" - } - foreach ($artifact in $additionalModules) { - $projectList += "$($artifact.groupId):$($artifact.name)" - $additionalModulesList += "$($artifact.groupId):$($artifact.name)" - } - - $projects = $projectList -join ',' - Write-Host "ProjectList = $projects" - Write-Host "##vso[task.setvariable variable=ProjectList;]$projects" - - $artifactsString = $artifactsList -join ',' - Write-Host "ArtifactsList = $artifactsString" - Write-Host "##vso[task.setvariable variable=ArtifactsList;]$artifactsString" - - $additionalModulesString = $additionalModulesList -join ',' - Write-Host "AdditionalModulesList = $additionalModulesString" - Write-Host "##vso[task.setvariable variable=AdditionalModulesList;]$additionalModulesString" - - $sha256 = new-object -TypeName System.Security.Cryptography.SHA256Managed - $utf8 = new-object -TypeName System.Text.UTF8Encoding - - $projectListSha256 = [Convert]::ToBase64String($sha256.ComputeHash($utf8.GetBytes($projects))) - Write-Host "##vso[task.setvariable variable=ProjectListSha256;]$projectListSha256" +- task: PowerShell@2 displayName: Initialize project list variable + inputs: + pwsh: true + filePath: eng/pipelines/scripts/generate-project-list.ps1 + env: + ARTIFACTSJSON: $(ArtifactsJson) + ADDITIONALMODULESJSON: $(AdditionalModulesJson) # The Cache task, when restoring, can have a miss and still pass but, if nothing is built, the # Post-Job Cache will fail because there's no .m2/repository diff --git a/eng/pipelines/templates/steps/http-fault-injector.yml b/eng/pipelines/templates/steps/http-fault-injector.yml index b6f351b3c90c..2886b3cbf78a 100644 --- a/eng/pipelines/templates/steps/http-fault-injector.yml +++ b/eng/pipelines/templates/steps/http-fault-injector.yml @@ -1,45 +1,10 @@ steps: - - powershell: | - dotnet tool install azure.sdk.tools.httpfaultinjector --global --prerelease --add-source https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-net/nuget/v3/index.json - dotnet tool update azure.sdk.tools.httpfaultinjector --global --prerelease --add-source https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-net/nuget/v3/index.json - http-fault-injector --version - displayName: 'Install http-fault-injector' - - - pwsh: | - Write-Host "##vso[task.setvariable variable=ASPNETCORE_Kestrel__Certificates__Default__Path]$(Build.SourcesDirectory)/eng/common/testproxy/dotnet-devcert.pfx" - Write-Host "##vso[task.setvariable variable=ASPNETCORE_Kestrel__Certificates__Default__Password]password" - Write-Host "##vso[task.setvariable variable=PROXY_MANUAL_START]true" - displayName: 'Configure Kestrel and PROXY_MANUAL_START Variables' - - - powershell: | - if (Test-Path $env:JAVA_HOME\jre\lib\security) { - cd $env:JAVA_HOME\jre\lib\security - } elseif (Test-Path $env:JAVA_HOME\lib\security) { - cd $env:JAVA_HOME\lib\security - } else { - Write-Error "JDK directory structure is unknown and unsupported. JAVA_HOME is '$env:JAVA_HOME'" - exit 1 - } - - dotnet dev-certs https --export-path http-fault-injector.pfx - keytool -keystore cacerts -importcert -noprompt -trustcacerts -alias HttpFaultInject -file http-fault-injector.pfx -storepass changeit - displayName: 'Trust http-fault-injector self-signed certificate - windows' - condition: and(succeeded(), eq(variables['Agent.OS'],'Windows_NT')) - - - bash: | - if [ -d ${JAVA_HOME}/jre/lib/security ]; then - cd ${JAVA_HOME}/jre/lib/security - elif [ -d ${JAVA_HOME}/lib/security ]; then - cd ${JAVA_HOME}/lib/security - else - echo "JDK directory structure is unknown and unsupported. JAVA_HOME is '${JAVA_HOME}'" - exit 1 - fi - - dotnet dev-certs https --export-path http-fault-injector.pfx - sudo keytool -keystore cacerts -importcert -noprompt -trustcacerts -alias HttpFaultInject -file http-fault-injector.pfx -storepass changeit - displayName: 'Trust http-fault-injector self-signed certificate - linux/mac' - condition: and(succeeded(), ne(variables['Agent.OS'],'Windows_NT')) + - task: PowerShell@2 + displayName: Setup http fault injector + inputs: + pwsh: true + filePath: $(Build.SourcesDirectory)/eng/scripts/setup-http-fault-injector.ps1 + arguments: -SourcesDirectory $(Build.SourcesDirectory) - pwsh: | Start-Process http-fault-injector -NoNewWindow -PassThru -RedirectStandardOutput "$(Build.SourcesDirectory)/http-fault-injector.log" diff --git a/eng/pipelines/templates/steps/initialize-test-environment.yml b/eng/pipelines/templates/steps/initialize-test-environment.yml index 4e70f34c97c7..62a437b7f87b 100644 --- a/eng/pipelines/templates/steps/initialize-test-environment.yml +++ b/eng/pipelines/templates/steps/initialize-test-environment.yml @@ -1,19 +1,8 @@ parameters: - - name: ServiceDirectory - type: string - - name: Artifacts - type: object - default: [] - - name: AdditionalModules - type: object - default: [] - name: CheckoutRecordings type: boolean default: false - - name: SDKType - type: string - default: client - - name: OSVmImage + - name: OS type: string default: $(OSVmImage) @@ -36,7 +25,7 @@ steps: - template: /eng/common/pipelines/templates/steps/verify-agent-os.yml parameters: - AgentImage: ${{ parameters.OSVmImage }} + AgentImage: ${{ parameters.OS }} - task: PythonScript@0 displayName: 'Set versions for source build' @@ -54,8 +43,6 @@ steps: - template: /eng/pipelines/templates/steps/generate-project-list-and-cache-maven-repository.yml parameters: - Artifacts: ${{ parameters.Artifacts }} - AdditionalModules: ${{ parameters.AdditionalModules }} JobType: 'test' # This call is used generate the sparse checkout variables for non-FromSource runs. @@ -84,7 +71,7 @@ steps: # Skip sparse checkout for the `azure-sdk-for--pr` private mirrored repositories # as we require the GitHub service connection to be loaded. - ${{ if not(contains(variables['Build.DefinitionName'], 'java-pr')) }}: - - template: /eng/common/pipelines/templates/steps/sparse-checkout.yml + - template: /eng/pipelines/templates/steps/sparse-checkout-repo-initialized.yml parameters: SkipCheckoutNone: true Paths: $(SparseCheckoutDirectories) diff --git a/eng/pipelines/templates/steps/publish-http-fault-injector-logs.yml b/eng/pipelines/templates/steps/publish-http-fault-injector-logs.yml index 18ae4af62975..a7ecdaa7a7ee 100644 --- a/eng/pipelines/templates/steps/publish-http-fault-injector-logs.yml +++ b/eng/pipelines/templates/steps/publish-http-fault-injector-logs.yml @@ -1,24 +1,11 @@ steps: - pwsh: | if (Test-Path -Path "$(Build.SourcesDirectory)/http-fault-injector.log") { - Write-Host "##vso[task.setvariable variable=HAS_HTTP_FAULT_INJECTOR_LOGS]true" - } else { - Write-Host "##vso[task.setvariable variable=HAS_HTTP_FAULT_INJECTOR_LOGS]false" + if (-not (Test-Path "$(System.DefaultWorkingDirectory)/troubleshooting")) { + New-Item -ItemType Directory -Path "$(System.DefaultWorkingDirectory)/troubleshooting" | Out-Null + } + Compress-Archive -Path "$(Build.SourcesDirectory)/http-fault-injector.log" -DestinationPath "$(System.DefaultWorkingDirectory)/troubleshooting/fault-$(System.JobName).zip" + Write-Host "##vso[task.setvariable variable=HAS_TROUBLESHOOTING]true" } - displayName: 'Check if http-fault-injector log file exists' + displayName: 'Check for and copy http-fault-injector log file' condition: failed() - - - pwsh: | - Copy-Item -Path "$(Build.SourcesDirectory)/http-fault-injector.log" -Destination "$(Build.SourcesDirectory)/fault.log" - condition: and(failed(), eq(variables['HAS_HTTP_FAULT_INJECTOR_LOGS'], 'true')) - - - template: /eng/common/pipelines/templates/steps/publish-artifact.yml - parameters: - ArtifactName: "$(System.JobName)-http-fault-injector-logs" - ArtifactPath: "$(Build.SourcesDirectory)/fault.log" - CustomCondition: and(failed(), eq(variables['HAS_HTTP_FAULT_INJECTOR_LOGS'], 'true')) - - - pwsh: | - Remove-Item -Force $(Build.SourcesDirectory)/fault.log - displayName: 'Cleanup http-fault-injector log file' - condition: and(failed(), eq(variables['HAS_HTTP_FAULT_INJECTOR_LOGS'], 'true')) diff --git a/eng/pipelines/templates/steps/retain-heap-dump-hprofs.yml b/eng/pipelines/templates/steps/retain-heap-dump-hprofs.yml index 9d125ce7b011..2c27c3f37701 100644 --- a/eng/pipelines/templates/steps/retain-heap-dump-hprofs.yml +++ b/eng/pipelines/templates/steps/retain-heap-dump-hprofs.yml @@ -4,27 +4,12 @@ parameters: default: 'oom-hprofs' steps: - - pwsh: | - if ((Get-ChildItem -Path . -Recurse -Filter *.hprof -File).Count -eq 0) { - Write-Host "##vso[task.setvariable variable=HAS_OOM_PROFS]false" - } else { - Write-Host "##vso[task.setvariable variable=HAS_OOM_PROFS]true" - } - displayName: 'Check for OOM hprofs' + - task: PowerShell@2 + displayName: 'Check for and copy OOM hprofs' + inputs: + pwsh: true + filePath: eng/pipelines/scripts/Get-Heap-Dump-Hprofs.ps1 + arguments: > + -StagingDirectory $(System.DefaultWorkingDirectory) + -OomArtifactName ${{ parameters.OomArtifactName }} condition: always() - - - pwsh: | - New-Item $(Build.ArtifactStagingDirectory)/${{ parameters.OomArtifactName }} -ItemType directory - foreach($hprofFile in (Get-ChildItem -Path . -Recurse -Filter *.hprof -File)) { - $fileFullName = $hprofFile.FullName - $fileName = $hprofFile.Name - Move-Item -Path $fileFullName -Destination $(Build.ArtifactStagingDirectory)/${{ parameters.OomArtifactName }}/$fileName -ErrorAction SilentlyContinue - } - [System.IO.Compression.ZipFile]::CreateFromDirectory("$(Build.ArtifactStagingDirectory)/${{ parameters.OomArtifactName }}","$(Build.ArtifactStagingDirectory)/${{ parameters.OomArtifactName }}.zip") - displayName: 'Copy OOM hprofs' - condition: eq(variables['HAS_OOM_PROFS'], 'true') - - - publish: $(Build.ArtifactStagingDirectory)/${{ parameters.OomArtifactName }}.zip - displayName: 'Publish OOM hprofs' - artifact: ${{ parameters.OomArtifactName }}-$(System.StageName)-$(System.JobName)-$(System.JobAttempt) - condition: eq(variables['HAS_OOM_PROFS'], 'true') diff --git a/eng/pipelines/templates/steps/retain-test-logs.yml b/eng/pipelines/templates/steps/retain-test-logs.yml index a777408c9cc9..c644de203e19 100644 --- a/eng/pipelines/templates/steps/retain-test-logs.yml +++ b/eng/pipelines/templates/steps/retain-test-logs.yml @@ -4,24 +4,12 @@ parameters: default: 'test-logs' steps: - - pwsh: | - $testLogs = Get-ChildItem -Path . -Recurse -Filter test.log -File -Depth 4 - if ($testLogs.Count -gt 0) { - Write-Host "##vso[task.setvariable variable=HAS_TEST_LOGS]true" - New-Item $(Build.ArtifactStagingDirectory)/${{ parameters.TestLogsArtifactName }} -ItemType directory - foreach($testLog in $testLogs) { - $fileFullName = $testLog.FullName - $fileName = "$($testLog.Directory.Parent.Parent.Name)-$($testLog.Directory.Parent.Name)-$($testLog.Name)" - Move-Item -Path $fileFullName -Destination $(Build.ArtifactStagingDirectory)/${{ parameters.TestLogsArtifactName }}/$fileName -ErrorAction SilentlyContinue - } - [System.IO.Compression.ZipFile]::CreateFromDirectory("$(Build.ArtifactStagingDirectory)/${{ parameters.TestLogsArtifactName }}","$(Build.ArtifactStagingDirectory)/${{ parameters.TestLogsArtifactName }}.zip") - } else { - Write-Host "##vso[task.setvariable variable=HAS_TEST_LOGS]false" - } + - task: PowerShell@2 displayName: 'Check for and copy test logs' + inputs: + pwsh: true + filePath: eng/pipelines/scripts/Get-Test-Logs.ps1 + arguments: > + -StagingDirectory $(System.DefaultWorkingDirectory) + -TestLogsArtifactName ${{ parameters.TestLogsArtifactName }} condition: always() - - - publish: $(Build.ArtifactStagingDirectory)/${{ parameters.TestLogsArtifactName }}.zip - displayName: 'Publish test logs' - artifact: ${{ parameters.TestLogsArtifactName }}-$(System.StageName)-$(System.JobName)-$(System.JobAttempt) - condition: and(not(succeeded()), eq(variables['HAS_TEST_LOGS'], 'true')) diff --git a/eng/pipelines/templates/steps/run-and-validate-linting.yml b/eng/pipelines/templates/steps/run-and-validate-linting.yml index 34f7a1a4fcfc..c9e456df5bdd 100644 --- a/eng/pipelines/templates/steps/run-and-validate-linting.yml +++ b/eng/pipelines/templates/steps/run-and-validate-linting.yml @@ -61,22 +61,16 @@ steps: - task: PowerShell@2 inputs: filePath: $(System.DefaultWorkingDirectory)/eng/pipelines/scripts/Get-Linting-Reports.ps1 - arguments: -OutputDirectory $(Build.ArtifactStagingDirectory)/linting-reports + arguments: -StagingDirectory $(System.DefaultWorkingDirectory) pwsh: true workingDirectory: $(Pipeline.Workspace) displayName: 'Generate Linting Reports' continueOnError: ${{ parameters.ContinueOnError }} condition: or(eq(coalesce(variables['IsLatestNonLtsJdk'], true), true), and(${{ parameters.RunLinting }}, succeeded())) - - publish: $(Build.ArtifactStagingDirectory)/linting-reports.zip - displayName: 'Publish Linting Reports' - artifact: linting-reports-$(System.StageName)-$(System.JobName)-$(System.JobAttempt) - continueOnError: ${{ parameters.ContinueOnError }} - condition: or(eq(coalesce(variables['IsLatestNonLtsJdk'], true), true), and(${{ parameters.RunLinting }}, succeeded())) - - pwsh: | - if ((Get-ChildItem -Path $(Build.ArtifactStagingDirectory)/linting-reports -Directory | Measure-Object).Count -gt 0) { - Write-Host "Linting errors have been found, download the 'linting-reports.zip' artifact to see what was found." + if (Test-Path -Path "$(System.DefaultWorkingDirectory)/troubleshooting/linting-report.zip") { + Write-Host "Linting errors have been found, download the 'linting-report.zip' artifact to see what was found." exit 1 } displayName: 'Fail Pipeline if Linting Reports Exist' diff --git a/eng/pipelines/templates/steps/sparse-checkout-repo-initialized.yml b/eng/pipelines/templates/steps/sparse-checkout-repo-initialized.yml new file mode 100644 index 000000000000..07c75f94ff9e --- /dev/null +++ b/eng/pipelines/templates/steps/sparse-checkout-repo-initialized.yml @@ -0,0 +1,30 @@ +parameters: + - name: Paths + type: object + default: [] + - name: Repositories + type: object + default: + - Name: $(Build.Repository.Name) + Commitish: $(Build.SourceVersion) + WorkingDirectory: $(System.DefaultWorkingDirectory) + - name: SkipCheckoutNone + type: boolean + default: false + +steps: + - ${{ if not(parameters.SkipCheckoutNone) }}: + - checkout: none + + - task: PowerShell@2 + ${{ if eq(length(parameters.Repositories), 1) }}: + displayName: 'Sparse checkout ${{ parameters.Repositories[0].Name }}' + ${{ else }}: + displayName: 'Sparse checkout repositories' + inputs: + pwsh: true + filePath: eng/pipelines/scripts/Invoke-Sparse-Checkout.ps1 + arguments: > + -PathsJson '${{ convertToJson(parameters.Paths) }}' + -RepositoriesJson '${{ convertToJson(parameters.Repositories) }}' + workingDirectory: $(System.DefaultWorkingDirectory) diff --git a/eng/pipelines/templates/variables/globals.yml b/eng/pipelines/templates/variables/globals.yml index 83f38787a362..64c8cdcf8103 100644 --- a/eng/pipelines/templates/variables/globals.yml +++ b/eng/pipelines/templates/variables/globals.yml @@ -55,3 +55,5 @@ variables: # Disable CodeQL injections except for where we specifically enable it Codeql.SkipTaskAutoInjection: true + + ComponentDetection.Timeout: 1200 diff --git a/eng/pipelines/templates/variables/image.yml b/eng/pipelines/templates/variables/image.yml new file mode 100644 index 000000000000..322e3875f38e --- /dev/null +++ b/eng/pipelines/templates/variables/image.yml @@ -0,0 +1,26 @@ +# Default pool image selection. Set as variable so we can override at pipeline level + +variables: + - name: LINUXPOOL + value: azsdk-pool-mms-ubuntu-2004-general + - name: WINDOWSPOOL + value: azsdk-pool-mms-win-2022-general + - name: MACPOOL + value: Azure Pipelines + + - name: LINUXVMIMAGE + value: azsdk-pool-mms-ubuntu-2004-1espt + - name: LINUXNEXTVMIMAGE + value: azsdk-pool-mms-ubuntu-2204-1espt + - name: WINDOWSVMIMAGE + value: azsdk-pool-mms-win-2022-1espt + - name: MACVMIMAGE + value: macos-11 + + # Values required for pool.os field in 1es pipeline templates + - name: LINUXOS + value: linux + - name: WINDOWSOS + value: windows + - name: MACOS + value: macOS diff --git a/eng/scripts/Generate-ServiceDirectories-From-Project-List.ps1 b/eng/scripts/Generate-ServiceDirectories-From-Project-List.ps1 index b6d4a0797121..4e4734faa8ce 100644 --- a/eng/scripts/Generate-ServiceDirectories-From-Project-List.ps1 +++ b/eng/scripts/Generate-ServiceDirectories-From-Project-List.ps1 @@ -10,9 +10,12 @@ # prior to calling this script. param( # $(Build.SourcesDirectory) - root of the repository - [Parameter(Mandatory=$true)][string]$SourcesDirectory, - # ArtifactsList will be using ('${{ convertToJson(parameters.Artifacts) }}' | ConvertFrom-Json | Select-Object name, groupId) - [Parameter(Mandatory=$true)][array] $ProjectList + [Parameter(Mandatory=$true)] + [string]$SourcesDirectory, + + [Parameter(Mandatory=$true)] + [AllowEmptyCollection()] + [array] $ProjectList ) $StartTime = $(get-date) diff --git a/eng/scripts/setup-http-fault-injector.ps1 b/eng/scripts/setup-http-fault-injector.ps1 new file mode 100644 index 000000000000..3f5bc523a99a --- /dev/null +++ b/eng/scripts/setup-http-fault-injector.ps1 @@ -0,0 +1,30 @@ +param( + [Parameter(Mandatory=$false)] + [string]$SourcesDirectory = $env:BUILD_SOURCESDIRECTORY +) + +dotnet tool install azure.sdk.tools.httpfaultinjector --global --prerelease --add-source https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-net/nuget/v3/index.json +dotnet tool update azure.sdk.tools.httpfaultinjector --global --prerelease --add-source https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-net/nuget/v3/index.json +http-fault-injector --version + +Write-Host "##vso[task.setvariable variable=ASPNETCORE_Kestrel__Certificates__Default__Path]$SourcesDirectory/eng/common/testproxy/dotnet-devcert.pfx" +Write-Host "##vso[task.setvariable variable=ASPNETCORE_Kestrel__Certificates__Default__Password]password" +Write-Host "##vso[task.setvariable variable=PROXY_MANUAL_START]true" + +# Trust http-fault-injector self-siigned certificate +if (Test-Path $env:JAVA_HOME/jre/lib/security) { + Set-Location $env:JAVA_HOME/jre/lib/security +} elseif (Test-Path $env:JAVA_HOME/lib/security) { + Set-Location $env:JAVA_HOME/lib/security +} else { + Write-Error "JDK directory structure is unknown and unsupported. JAVA_HOME is '$env:JAVA_HOME'" + exit 1 +} + +dotnet dev-certs https --export-path http-fault-injector.pfx + +if ($IsWindows) { + keytool -keystore cacerts -importcert -noprompt -trustcacerts -alias HttpFaultInject -file http-fault-injector.pfx -storepass changeit +} else { + sudo keytool -keystore cacerts -importcert -noprompt -trustcacerts -alias HttpFaultInject -file http-fault-injector.pfx -storepass changeit +} diff --git a/sdk/appconfiguration/tests.native.yml b/sdk/appconfiguration/tests.native.yml index 00ba3ca33a0b..734347461fe5 100644 --- a/sdk/appconfiguration/tests.native.yml +++ b/sdk/appconfiguration/tests.native.yml @@ -9,22 +9,19 @@ pr: - eng/pipelines/native-image-live-tests.yml - eng/scrips/Install-GraalVM-JDK.ps1 -variables: - - template: /eng/pipelines/templates/variables/globals.yml - -stages: - - template: /eng/pipelines/templates/stages/archetype-sdk-native-tests.yml - parameters: - ServiceDirectory: appconfiguration - Artifacts: - - name: azure-data-appconfiguration - groupId: com.azure - safeName: azuredataappconfiguration - TimeoutInMinutes: 90 - SupportedClouds: 'Public' - EnvVars: - AZURE_CLIENT_ID: $(APPCONFIGURATION_CLIENT_ID) - AZURE_CLIENT_SECRET: $(APPCONFIGURATION_CLIENT_SECRET) - AZURE_TENANT_ID: $(APPCONFIGURATION_TENANT_ID) - TestGoals: 'verify' - TestOptions: '-DskipSpringITs=false' +extends: + template: /eng/pipelines/templates/stages/archetype-sdk-native-tests.yml + parameters: + ServiceDirectory: appconfiguration + Artifacts: + - name: azure-data-appconfiguration + groupId: com.azure + safeName: azuredataappconfiguration + TimeoutInMinutes: 90 + SupportedClouds: 'Public' + EnvVars: + AZURE_CLIENT_ID: $(APPCONFIGURATION_CLIENT_ID) + AZURE_CLIENT_SECRET: $(APPCONFIGURATION_CLIENT_SECRET) + AZURE_TENANT_ID: $(APPCONFIGURATION_TENANT_ID) + TestGoals: 'verify' + TestOptions: '-DskipSpringITs=false' diff --git a/sdk/communication/azure-communication-callautomation/tests.yml b/sdk/communication/azure-communication-callautomation/tests.yml index 02949212d53a..6faa4c10981e 100644 --- a/sdk/communication/azure-communication-callautomation/tests.yml +++ b/sdk/communication/azure-communication-callautomation/tests.yml @@ -1,7 +1,7 @@ trigger: none -stages: -- template: /sdk/communication/communication-tests-template.yml +extends: + template: /sdk/communication/communication-tests-template.yml parameters: PackageName: azure-communication-callautomation SafeName: azurecommunicationcallautomation diff --git a/sdk/communication/azure-communication-callingserver/tests.yml b/sdk/communication/azure-communication-callingserver/tests.yml index 27671325fa64..5eb85f52d279 100644 --- a/sdk/communication/azure-communication-callingserver/tests.yml +++ b/sdk/communication/azure-communication-callingserver/tests.yml @@ -1,9 +1,9 @@ trigger: none -stages: -- template: /sdk/communication/communication-tests-template.yml +extends: + template: /sdk/communication/communication-tests-template.yml parameters: PackageName: azure-communication-callingserver - SafeName: azurecommunicationcallingserver + SafeName: azurecommunicationcallingserver Clouds: 'Public' TestMode: 'LIVE' diff --git a/sdk/communication/azure-communication-chat/tests.yml b/sdk/communication/azure-communication-chat/tests.yml index 94c2431991fa..17f110629067 100644 --- a/sdk/communication/azure-communication-chat/tests.yml +++ b/sdk/communication/azure-communication-chat/tests.yml @@ -1,7 +1,7 @@ trigger: none -stages: - - template: /sdk/communication/communication-tests-template.yml - parameters: - PackageName: azure-communication-chat - SafeName: azurecommunicationchat +extends: + template: /sdk/communication/communication-tests-template.yml + parameters: + PackageName: azure-communication-chat + SafeName: azurecommunicationchat diff --git a/sdk/communication/azure-communication-email/tests.yml b/sdk/communication/azure-communication-email/tests.yml index 02b3f882b2eb..05fc0c00a69e 100644 --- a/sdk/communication/azure-communication-email/tests.yml +++ b/sdk/communication/azure-communication-email/tests.yml @@ -6,28 +6,28 @@ parameters: type: boolean default: false -stages: - - template: /sdk/communication/communication-tests-template.yml - parameters: - PackageName: azure-communication-email - SafeName: azurecommunicationemail - ${{ if eq(parameters.runOnlyPPE, true) }}: - Clouds: 'PPE' - ${{ if eq(parameters.runOnlyPPE, false) }}: - Clouds: 'Public,PPE,Int' - CloudConfig: - Public: - SubscriptionConfigurations: - - $(sub-config-azure-cloud-test-resources) - - $(sub-config-communication-services-cloud-test-resources-common) - - $(sub-config-communication-services-cloud-test-resources-java) - Int: - SubscriptionConfigurations: - - $(sub-config-communication-int-test-resources-common) - - $(sub-config-communication-int-test-resources-java) - PPE: - SubscriptionConfigurations: - - $(sub-config-communication-ppe-test-resources-common) - - $(sub-config-communication-ppe-test-resources-java) - TestResourceDirectories: - - communication/azure-communication-email/ +extends: + template: /sdk/communication/communication-tests-template.yml + parameters: + PackageName: azure-communication-email + SafeName: azurecommunicationemail + ${{ if eq(parameters.runOnlyPPE, true) }}: + Clouds: 'PPE' + ${{ if eq(parameters.runOnlyPPE, false) }}: + Clouds: 'Public,PPE,Int' + CloudConfig: + Public: + SubscriptionConfigurations: + - $(sub-config-azure-cloud-test-resources) + - $(sub-config-communication-services-cloud-test-resources-common) + - $(sub-config-communication-services-cloud-test-resources-java) + Int: + SubscriptionConfigurations: + - $(sub-config-communication-int-test-resources-common) + - $(sub-config-communication-int-test-resources-java) + PPE: + SubscriptionConfigurations: + - $(sub-config-communication-ppe-test-resources-common) + - $(sub-config-communication-ppe-test-resources-java) + TestResourceDirectories: + - communication/azure-communication-email/ diff --git a/sdk/communication/azure-communication-identity/tests.yml b/sdk/communication/azure-communication-identity/tests.yml index 2d5244b67d96..958d8192c86b 100644 --- a/sdk/communication/azure-communication-identity/tests.yml +++ b/sdk/communication/azure-communication-identity/tests.yml @@ -1,22 +1,22 @@ trigger: none -stages: - - template: /sdk/communication/communication-tests-template.yml - parameters: - PackageName: azure-communication-identity - SafeName: azurecommunicationidentity - Clouds: 'Public,PPE,Int' - CloudConfig: - Public: - SubscriptionConfigurations: - - $(sub-config-azure-cloud-test-resources) - - $(sub-config-communication-services-cloud-test-resources-common) - - $(sub-config-communication-services-cloud-test-resources-java) - Int: - SubscriptionConfigurations: - - $(sub-config-communication-int-test-resources-common) - - $(sub-config-communication-int-test-resources-java) - PPE: - SubscriptionConfigurations: - - $(sub-config-communication-ppe-test-resources-common) - - $(sub-config-communication-ppe-test-resources-java) +extends: + template: /sdk/communication/communication-tests-template.yml + parameters: + PackageName: azure-communication-identity + SafeName: azurecommunicationidentity + Clouds: 'Public,PPE,Int' + CloudConfig: + Public: + SubscriptionConfigurations: + - $(sub-config-azure-cloud-test-resources) + - $(sub-config-communication-services-cloud-test-resources-common) + - $(sub-config-communication-services-cloud-test-resources-java) + Int: + SubscriptionConfigurations: + - $(sub-config-communication-int-test-resources-common) + - $(sub-config-communication-int-test-resources-java) + PPE: + SubscriptionConfigurations: + - $(sub-config-communication-ppe-test-resources-common) + - $(sub-config-communication-ppe-test-resources-java) diff --git a/sdk/communication/azure-communication-jobrouter/tests.yml b/sdk/communication/azure-communication-jobrouter/tests.yml index 71e0a12ea8e4..7426940a8985 100644 --- a/sdk/communication/azure-communication-jobrouter/tests.yml +++ b/sdk/communication/azure-communication-jobrouter/tests.yml @@ -1,7 +1,7 @@ trigger: none -stages: - - template: /sdk/communication/communication-tests-template.yml - parameters: - PackageName: azure-communication-jobrouter - SafeName: azurecommunicationjobrouter +extends: + template: /sdk/communication/communication-tests-template.yml + parameters: + PackageName: azure-communication-jobrouter + SafeName: azurecommunicationjobrouter diff --git a/sdk/communication/azure-communication-messages/tests.yml b/sdk/communication/azure-communication-messages/tests.yml index a9ffca231edd..95cc9020d4a4 100644 --- a/sdk/communication/azure-communication-messages/tests.yml +++ b/sdk/communication/azure-communication-messages/tests.yml @@ -6,24 +6,24 @@ parameters: type: boolean default: false -stages: - - template: /sdk/communication/communication-tests-template.yml - parameters: - PackageName: azure-communication-messages - SafeName: azurecommunicationmessages - ${{ if eq(parameters.runOnlyPPE, true) }}: - Clouds: 'PPE' - ${{ if eq(parameters.runOnlyPPE, false) }}: - Clouds: 'Public,PPE' - CloudConfig: - Public: - SubscriptionConfigurations: - - $(sub-config-azure-cloud-test-resources) - - $(sub-config-communication-services-cloud-test-resources-common) - - $(sub-config-communication-services-cloud-test-resources-java) - PPE: - SubscriptionConfigurations: - - $(sub-config-communication-ppe-test-resources-common) - - $(sub-config-communication-ppe-test-resources-java) - TestResourceDirectories: - - communication/azure-communication-messages/ +extends: + template: /sdk/communication/communication-tests-template.yml + parameters: + PackageName: azure-communication-messages + SafeName: azurecommunicationmessages + ${{ if eq(parameters.runOnlyPPE, true) }}: + Clouds: 'PPE' + ${{ if eq(parameters.runOnlyPPE, false) }}: + Clouds: 'Public,PPE' + CloudConfig: + Public: + SubscriptionConfigurations: + - $(sub-config-azure-cloud-test-resources) + - $(sub-config-communication-services-cloud-test-resources-common) + - $(sub-config-communication-services-cloud-test-resources-java) + PPE: + SubscriptionConfigurations: + - $(sub-config-communication-ppe-test-resources-common) + - $(sub-config-communication-ppe-test-resources-java) + TestResourceDirectories: + - communication/azure-communication-messages/ diff --git a/sdk/communication/azure-communication-networktraversal/tests.yml b/sdk/communication/azure-communication-networktraversal/tests.yml index aab91a89141d..407ac8b620b1 100644 --- a/sdk/communication/azure-communication-networktraversal/tests.yml +++ b/sdk/communication/azure-communication-networktraversal/tests.yml @@ -1,8 +1,8 @@ trigger: none -stages: - - template: /sdk/communication/communication-tests-template.yml - parameters: - PackageName: azure-communication-networktraversal - SafeName: azurecommunicationnetworktraversal - Clouds: 'Public' +extends: + template: /sdk/communication/communication-tests-template.yml + parameters: + PackageName: azure-communication-networktraversal + SafeName: azurecommunicationnetworktraversal + Clouds: 'Public' diff --git a/sdk/communication/azure-communication-phonenumbers/phone-numbers-livetest-matrix.json b/sdk/communication/azure-communication-phonenumbers/phone-numbers-livetest-matrix.json index 245909fe9d6d..46a5386a8f96 100644 --- a/sdk/communication/azure-communication-phonenumbers/phone-numbers-livetest-matrix.json +++ b/sdk/communication/azure-communication-phonenumbers/phone-numbers-livetest-matrix.json @@ -5,15 +5,15 @@ "matrix": { "Agent": { "ubuntu-20.04": { - "OSVmImage": "MMSUbuntu20.04", - "Pool": "azsdk-pool-mms-ubuntu-2004-general", + "OSVmImage": "env:LINUXVMIMAGE", + "Pool": "env:LINUXPOOL", "JavaTestVersion": "1.8", "AZURE_TEST_HTTP_CLIENTS": "okhttp", "AZURE_TEST_AGENT": "UBUNTU_2004_JAVA8" }, "macos-11": { - "OSVmImage": "macos-11", - "Pool": "Azure Pipelines", + "OSVmImage": "env:MACVMIMAGE", + "Pool": "env:MACPOOL", "JavaTestVersion": "1.21", "AZURE_TEST_HTTP_CLIENTS": "netty", "AZURE_TEST_AGENT": "MACOS_1015_JAVA11" @@ -30,8 +30,8 @@ { "Agent": { "ubuntu-20.04": { - "OSVmImage": "MMSUbuntu20.04", - "Pool": "azsdk-pool-mms-ubuntu-2004-general" + "OSVmImage": "env:LINUXVMIMAGE", + "Pool": "env:LINUXPOOL" } }, "JavaTestVersion": "1.21", @@ -47,8 +47,8 @@ { "Agent": { "windows-2022": { - "OSVmImage": "windows-2022", - "Pool": "azsdk-pool-mms-win-2022-general" + "OSVmImage": "env:WINDOWSVMIMAGE", + "Pool": "env:WINDOWSPOOL" } }, "JavaTestVersion": "1.21", diff --git a/sdk/communication/azure-communication-phonenumbers/tests.yml b/sdk/communication/azure-communication-phonenumbers/tests.yml index 7fe880a8f468..7e795c2399dc 100644 --- a/sdk/communication/azure-communication-phonenumbers/tests.yml +++ b/sdk/communication/azure-communication-phonenumbers/tests.yml @@ -6,36 +6,36 @@ parameters: type: boolean default: false -stages: - - template: /sdk/communication/communication-tests-template.yml - parameters: - PackageName: azure-communication-phonenumbers - SafeName: azurecommunicationphonenumbers - ${{ if eq(parameters.runOnlyPPE, true) }}: - Clouds: 'PPE' - ${{ if eq(parameters.runOnlyPPE, false) }}: - Clouds: 'Public,PPE,Int' - CloudConfig: - Public: - SubscriptionConfigurations: - - $(sub-config-azure-cloud-test-resources) - - $(sub-config-communication-services-cloud-test-resources-common) - - $(sub-config-communication-services-cloud-test-resources-java) - Int: - SubscriptionConfigurations: - - $(sub-config-communication-int-test-resources-common) - - $(sub-config-communication-int-test-resources-java) +extends: + template: /sdk/communication/communication-tests-template.yml + parameters: + PackageName: azure-communication-phonenumbers + SafeName: azurecommunicationphonenumbers + ${{ if eq(parameters.runOnlyPPE, true) }}: + Clouds: 'PPE' + ${{ if eq(parameters.runOnlyPPE, false) }}: + Clouds: 'Public,PPE,Int' + CloudConfig: + Public: + SubscriptionConfigurations: + - $(sub-config-azure-cloud-test-resources) + - $(sub-config-communication-services-cloud-test-resources-common) + - $(sub-config-communication-services-cloud-test-resources-java) + Int: + SubscriptionConfigurations: + - $(sub-config-communication-int-test-resources-common) + - $(sub-config-communication-int-test-resources-java) - MatrixReplace: - - SKIP_UPDATE_CAPABILITIES_LIVE_TESTS=false/true - PPE: - SubscriptionConfigurations: - - $(sub-config-communication-ppe-test-resources-common) - - $(sub-config-communication-ppe-test-resources-java) - MatrixReplace: - - SKIP_UPDATE_CAPABILITIES_LIVE_TESTS=false/true - MatrixConfigs: - - Name: PhoneNumbers_java_livetest_matrix - Path: sdk/communication/azure-communication-phonenumbers/phone-numbers-livetest-matrix.json - Selection: sparse - GenerateVMJobs: true + MatrixReplace: + - SKIP_UPDATE_CAPABILITIES_LIVE_TESTS=false/true + PPE: + SubscriptionConfigurations: + - $(sub-config-communication-ppe-test-resources-common) + - $(sub-config-communication-ppe-test-resources-java) + MatrixReplace: + - SKIP_UPDATE_CAPABILITIES_LIVE_TESTS=false/true + MatrixConfigs: + - Name: PhoneNumbers_java_livetest_matrix + Path: sdk/communication/azure-communication-phonenumbers/phone-numbers-livetest-matrix.json + Selection: sparse + GenerateVMJobs: true diff --git a/sdk/communication/azure-communication-rooms/tests.yml b/sdk/communication/azure-communication-rooms/tests.yml index 35fd2d3b34bb..8b53a1306bd7 100644 --- a/sdk/communication/azure-communication-rooms/tests.yml +++ b/sdk/communication/azure-communication-rooms/tests.yml @@ -1,20 +1,20 @@ trigger: none -stages: - - template: /sdk/communication/communication-tests-template.yml - parameters: - PackageName: azure-communication-rooms - SafeName: azurecommunicationrooms - CloudConfig: - Public: - SubscriptionConfigurations: - - $(sub-config-azure-cloud-test-resources) - - $(sub-config-communication-services-cloud-test-resources-common) - - $(sub-config-communication-services-cloud-test-resources-java) - PPE: - SubscriptionConfigurations: - - $(sub-config-communication-ppe-test-resources-common) - - $(sub-config-communication-ppe-test-resources-java) - Clouds: Public,PPE - TestResourceDirectories: - - communication/test-resources/ +extends: + template: /sdk/communication/communication-tests-template.yml + parameters: + PackageName: azure-communication-rooms + SafeName: azurecommunicationrooms + CloudConfig: + Public: + SubscriptionConfigurations: + - $(sub-config-azure-cloud-test-resources) + - $(sub-config-communication-services-cloud-test-resources-common) + - $(sub-config-communication-services-cloud-test-resources-java) + PPE: + SubscriptionConfigurations: + - $(sub-config-communication-ppe-test-resources-common) + - $(sub-config-communication-ppe-test-resources-java) + Clouds: Public,PPE + TestResourceDirectories: + - communication/test-resources/ diff --git a/sdk/communication/azure-communication-sms/tests.yml b/sdk/communication/azure-communication-sms/tests.yml index a9d6fe86125e..9144b1f87120 100644 --- a/sdk/communication/azure-communication-sms/tests.yml +++ b/sdk/communication/azure-communication-sms/tests.yml @@ -1,20 +1,20 @@ trigger: none -stages: - - template: /sdk/communication/communication-tests-template.yml - parameters: - PackageName: azure-communication-sms - SafeName: azurecommunicationsms - Clouds: 'Public,Int' - CloudConfig: - Public: - SubscriptionConfigurations: - - $(sub-config-azure-cloud-test-resources) - - $(sub-config-communication-services-cloud-test-resources-common) - - $(sub-config-communication-services-cloud-test-resources-java) - - $(sub-config-communication-services-sms-cloud-test-resources) - Int: - SubscriptionConfigurations: - - $(sub-config-communication-int-test-resources-common) - - $(sub-config-communication-int-test-resources-java) - - $(sub-config-communication-sms-int-test-resources) +extends: + template: /sdk/communication/communication-tests-template.yml + parameters: + PackageName: azure-communication-sms + SafeName: azurecommunicationsms + Clouds: 'Public,Int' + CloudConfig: + Public: + SubscriptionConfigurations: + - $(sub-config-azure-cloud-test-resources) + - $(sub-config-communication-services-cloud-test-resources-common) + - $(sub-config-communication-services-cloud-test-resources-java) + - $(sub-config-communication-services-sms-cloud-test-resources) + Int: + SubscriptionConfigurations: + - $(sub-config-communication-int-test-resources-common) + - $(sub-config-communication-int-test-resources-java) + - $(sub-config-communication-sms-int-test-resources) diff --git a/sdk/communication/communication-tests-template.yml b/sdk/communication/communication-tests-template.yml index 5daf721140dc..d285bb770180 100644 --- a/sdk/communication/communication-tests-template.yml +++ b/sdk/communication/communication-tests-template.yml @@ -42,22 +42,25 @@ parameters: MatrixReplace: - SKIP_UPDATE_CAPABILITIES_LIVE_TESTS=false/true -stages: - - template: /eng/pipelines/templates/stages/archetype-sdk-tests.yml - parameters: - CloudConfig: ${{ parameters.CloudConfig }} - Clouds: ${{ parameters.Clouds }} - TestMode: ${{ parameters.TestMode }} - Artifacts: - - name: ${{ parameters.PackageName }} - groupId: com.azure - safeName: ${{ parameters.SafeName }} - ServiceDirectory: communication - TestResourceDirectories: ${{ parameters.TestResourceDirectories }} - EnvVars: - SKIP_LIVE_TEST: TRUE - ${{ each var in parameters.EnVars }}: - ${{ var.key }}: ${{ var.value }} - MatrixConfigs: - - ${{ each config in parameters.MatrixConfigs }}: - - ${{ config }} +extends: + template: /eng/pipelines/templates/stages/1es-redirect.yml + parameters: + stages: + - template: /eng/pipelines/templates/stages/archetype-sdk-tests-isolated.yml + parameters: + CloudConfig: ${{ parameters.CloudConfig }} + Clouds: ${{ parameters.Clouds }} + TestMode: ${{ parameters.TestMode }} + Artifacts: + - name: ${{ parameters.PackageName }} + groupId: com.azure + safeName: ${{ parameters.SafeName }} + ServiceDirectory: communication + TestResourceDirectories: ${{ parameters.TestResourceDirectories }} + EnvVars: + SKIP_LIVE_TEST: TRUE + ${{ each var in parameters.EnVars }}: + ${{ var.key }}: ${{ var.value }} + MatrixConfigs: + - ${{ each config in parameters.MatrixConfigs }}: + - ${{ config }} diff --git a/sdk/core/ci.yml b/sdk/core/ci.yml index 6f882731a102..9b68322d215e 100644 --- a/sdk/core/ci.yml +++ b/sdk/core/ci.yml @@ -178,7 +178,6 @@ extends: jobs: - template: /eng/pipelines/templates/jobs/ci.versions.tests.yml parameters: - ServiceDirectory: core Artifacts: - name: azure-core-version-tests groupId: com.azure @@ -197,59 +196,6 @@ extends: TestGoals: surefire:test LiveTestStages: - - template: /eng/pipelines/templates/stages/archetype-sdk-tests.yml - parameters: - ServiceDirectory: core - Artifacts: - - name: azure-core - groupId: com.azure - safeName: azurecore - - name: azure-core-amqp - groupId: com.azure - safeName: azurecoreamqp - - name: azure-core-amqp-experimental - groupId: com.azure - safeName: azurecoreamqpexperimental - - name: azure-core-experimental - groupId: com.azure - safeName: azurecoreexperimental - skipPublishDocMs: true - - name: azure-core-http-jdk-httpclient - groupId: com.azure - safeName: azurecorehttpjdkhttpclient - - name: azure-core-http-netty - groupId: com.azure - safeName: azurecorehttpnetty - - name: azure-core-http-okhttp - groupId: com.azure - safeName: azurecorehttpokhttp - - name: azure-core-management - groupId: com.azure - safeName: azurecoremanagement - - name: azure-core-serializer-avro-apache - groupId: com.azure - safeName: azurecoreserializeravroapache - - name: azure-core-metrics-opentelemetry - groupId: com.azure - safeName: azurecoremetricsopentelemetry - - name: azure-core-serializer-json-gson - groupId: com.azure - safeName: azurecoreserializerjsongson - - name: azure-core-serializer-json-jackson - groupId: com.azure - safeName: azurecoreserializerjsonjackson - - name: azure-core-test - groupId: com.azure - safeName: azurecoretest - skipPublishDocMs: true - - name: azure-core-tracing-opentelemetry - groupId: com.azure - safeName: azurecoretracingopentelemetry - - name: azure-core-tracing-opentelemetry-samples - groupId: com.azure - safeName: azurecoretracingopentelemetrysamples - MatrixReplace: - - TestGoals=(surefire:test)/$1 failsafe:integration-test failsafe:verify - template: /sdk/storage/tests-template.yml parameters: AdditionalMatrixReplace: diff --git a/sdk/cosmos/ci.yml b/sdk/cosmos/ci.yml index 1b5ac26bda22..39a2b82ec70c 100644 --- a/sdk/cosmos/ci.yml +++ b/sdk/cosmos/ci.yml @@ -152,7 +152,7 @@ extends: uberJar: true skipPublishDocGithubIo: true skipPublishDocMs: true - releaseInBatch: ${{ parameters.release_azurecosmosspark34 }} + releaseInBatch: ${{ parameters.release_azurecosmosspark34 }} - name: azure-cosmos-test groupId: com.azure safeName: azurecosmostest diff --git a/sdk/cosmos/kafka-integration-matrix.json b/sdk/cosmos/kafka-integration-matrix.json index 608160ba2f4d..8b353fe22bd8 100644 --- a/sdk/cosmos/kafka-integration-matrix.json +++ b/sdk/cosmos/kafka-integration-matrix.json @@ -4,8 +4,8 @@ "Session_Integration": { "ArmTemplateParameters": "@{ defaultConsistencyLevel = 'Session'; enableMultipleWriteLocations = $false }", "ProfileFlag": "-P kafka-integration", - "Pool": "azsdk-pool-mms-ubuntu-2004-general", - "OSVmImage": "MMSUbuntu2004" + "Pool": "env:LINUXPOOL", + "OSVmImage": "env:LINUXVMIMAGE" } }, "TestFromSource": true, diff --git a/sdk/cosmos/live-platform-matrix.json b/sdk/cosmos/live-platform-matrix.json index 2f78ef0a12e7..a564450f6fec 100644 --- a/sdk/cosmos/live-platform-matrix.json +++ b/sdk/cosmos/live-platform-matrix.json @@ -38,7 +38,7 @@ ], "ProfileFlag": "-Pe2e", "Agent": { - "ubuntu": { "OSVmImage": "MMSUbuntu20.04", "Pool": "azsdk-pool-mms-ubuntu-2004-general" } + "ubuntu": { "OSVmImage": "env:LINUXVMIMAGE", "Pool": "env:LINUXPOOL" } } }, { @@ -48,7 +48,7 @@ "ProfileFlag": [ "-Pcfp-split", "-Psplit", "-Pquery", "-Pfast", "-Pdirect" ], "ArmTemplateParameters": "@{ enableMultipleWriteLocations = $false; defaultConsistencyLevel = 'Session' }", "Agent": { - "ubuntu": { "OSVmImage": "MMSUbuntu20.04", "Pool": "azsdk-pool-mms-ubuntu-2004-general" } + "ubuntu": { "OSVmImage": "env:LINUXVMIMAGE", "Pool": "env:LINUXPOOL" } } }, { @@ -58,7 +58,7 @@ "PROTOCOLS": "[\"Tcp\"]", "ProfileFlag": [ "-Pcfp-split", "-Psplit", "-Pquery", "-Pfast" ], "Agent": { - "ubuntu": { "OSVmImage": "MMSUbuntu20.04", "Pool": "azsdk-pool-mms-ubuntu-2004-general" } + "ubuntu": { "OSVmImage": "env:LINUXVMIMAGE", "Pool": "env:LINUXPOOL" } } }, { @@ -68,7 +68,7 @@ "ProfileFlag": "-Pe2e", "ArmTemplateParameters": "@{ enableMultipleWriteLocations = $false; defaultConsistencyLevel = 'Strong' }", "Agent": { - "ubuntu": { "OSVmImage": "MMSUbuntu20.04", "Pool": "azsdk-pool-mms-ubuntu-2004-general" } + "ubuntu": { "OSVmImage": "env:LINUXVMIMAGE", "Pool": "env:LINUXPOOL" } } }, { @@ -78,7 +78,7 @@ "ProfileFlag": [ "-Pdirect" ], "ArmTemplateParameters": "@{ enableMultipleWriteLocations = $false; defaultConsistencyLevel = 'Strong' }", "Agent": { - "ubuntu": { "OSVmImage": "MMSUbuntu20.04", "Pool": "azsdk-pool-mms-ubuntu-2004-general" } + "ubuntu": { "OSVmImage": "env:LINUXVMIMAGE", "Pool": "env:LINUXPOOL" } } }, { @@ -88,7 +88,7 @@ "ProfileFlag": [ "-Plong" ], "ArmTemplateParameters": "@{ enableMultipleWriteLocations = $false; defaultConsistencyLevel = 'Session'; enablePartitionMerge = $true }", "Agent": { - "ubuntu": { "OSVmImage": "MMSUbuntu20.04", "Pool": "azsdk-pool-mms-ubuntu-2004-general" } + "ubuntu": { "OSVmImage": "env:LINUXVMIMAGE", "Pool": "env:LINUXPOOL" } } }, { @@ -103,7 +103,7 @@ "PROTOCOLS": "[\"Tcp\"]", "ProfileFlag": [ "-Pcfp-split", "-Psplit", "-Pquery", "-Pmulti-master", "-Pflaky-multi-master", "-Pfast", "-Pdirect" ], "Agent": { - "ubuntu": { "OSVmImage": "MMSUbuntu20.04", "Pool": "azsdk-pool-mms-ubuntu-2004-general" } + "ubuntu": { "OSVmImage": "env:LINUXVMIMAGE", "Pool": "env:LINUXPOOL" } } }, { @@ -118,7 +118,7 @@ "PROTOCOLS": "[\"Tcp\"]", "PREFERRED_LOCATIONS": null, "Agent": { - "ubuntu": { "OSVmImage": "MMSUbuntu20.04", "Pool": "azsdk-pool-mms-ubuntu-2004-general" } + "ubuntu": { "OSVmImage": "env:LINUXVMIMAGE", "Pool": "env:LINUXPOOL" } } } ] diff --git a/sdk/cosmos/tests.yml b/sdk/cosmos/tests.yml index 8093ca170cca..98d674a636ea 100644 --- a/sdk/cosmos/tests.yml +++ b/sdk/cosmos/tests.yml @@ -1,92 +1,99 @@ trigger: none -variables: - - template: ../../eng/pipelines/templates/variables/globals.yml - - name: AdditionalArgs - value: '-DCOSMOS.CLIENT_TELEMETRY_ENDPOINT=$(cosmos-client-telemetry-endpoint) -DCOSMOS.CLIENT_TELEMETRY_COSMOS_ACCOUNT=$(cosmos-client-telemetry-cosmos-account)' +extends: + template: /eng/pipelines/templates/stages/1es-redirect.yml + parameters: + stages: + - template: /eng/pipelines/templates/stages/archetype-sdk-tests-isolated.yml + parameters: + CloudConfig: + Cosmos_Public: + SubscriptionConfigurations: + - $(sub-config-azure-cloud-test-resources) + - $(sub-config-cosmos-azure-cloud-test-resources) + Clouds: 'Cosmos_Public_Integration' + MatrixConfigs: + - Name: Cosmos_live_test + Path: sdk/cosmos/live-platform-matrix.json + Selection: all + GenerateVMJobs: true + MatrixReplace: + - .*Version=1.21/1.17 + ServiceDirectory: cosmos + Artifacts: + - name: azure-cosmos + groupId: com.azure + safeName: azurecosmos + AdditionalModules: + - name: azure-cosmos-tests + groupId: com.azure + - name: azure-cosmos-benchmark + groupId: com.azure + TimeoutInMinutes: 120 + MaxParallel: 20 + PreSteps: + - template: /eng/pipelines/templates/steps/install-reporting-tools.yml + TestGoals: 'verify' + TestOptions: '$(ProfileFlag) $(AdditionalArgs) -DskipCompile=true -DskipTestCompile=true -DcreateSourcesJar=false' + TestResultsFiles: '**/junitreports/TEST-*.xml' + AdditionalVariables: + - name: AdditionalArgs + value: '-DCOSMOS.CLIENT_TELEMETRY_ENDPOINT=$(cosmos-client-telemetry-endpoint) -DCOSMOS.CLIENT_TELEMETRY_COSMOS_ACCOUNT=$(cosmos-client-telemetry-cosmos-account)' -stages: - - template: /eng/pipelines/templates/stages/archetype-sdk-tests.yml - parameters: - CloudConfig: - Cosmos_Public: - SubscriptionConfigurations: - - $(sub-config-azure-cloud-test-resources) - - $(sub-config-cosmos-azure-cloud-test-resources) - Clouds: 'Cosmos_Public_Integration' - MatrixConfigs: - - Name: Cosmos_live_test - Path: sdk/cosmos/live-platform-matrix.json - Selection: all - GenerateVMJobs: true - MatrixReplace: - - .*Version=1.21/1.17 - ServiceDirectory: cosmos - Artifacts: - - name: azure-cosmos - groupId: com.azure - safeName: azurecosmos - AdditionalModules: - - name: azure-cosmos-tests - groupId: com.azure - - name: azure-cosmos-benchmark - groupId: com.azure - TimeoutInMinutes: 120 - MaxParallel: 20 - PreSteps: - - template: /eng/pipelines/templates/steps/install-reporting-tools.yml - TestGoals: 'verify' - TestOptions: '$(ProfileFlag) $(AdditionalArgs) -DskipCompile=true -DskipTestCompile=true -DcreateSourcesJar=false' - TestResultsFiles: '**/junitreports/TEST-*.xml' + - template: /eng/pipelines/templates/stages/archetype-sdk-tests-isolated.yml + parameters: + TestName: 'Spring_Data_Cosmos_Integration' + CloudConfig: + Public: + SubscriptionConfigurations: + - $(sub-config-azure-cloud-test-resources) + - $(sub-config-cosmos-azure-cloud-test-resources) + MatrixConfigs: + - Name: Cosmos_live_test_integration + Path: sdk/spring/pipeline/cosmos-integration-matrix.json + Selection: all + GenerateVMJobs: true + ServiceDirectory: spring + TestResourceDirectories: + - spring/spring-cloud-azure-integration-tests/test-resources/cosmos-spring + Artifacts: + - name: azure-spring-data-cosmos + groupId: com.azure + safeName: azurespringdatacosmos + TimeoutInMinutes: 90 + PreSteps: + - template: /eng/pipelines/templates/steps/install-reporting-tools.yml + TestGoals: 'verify' + TestOptions: '$(ProfileFlag) -DskipCompile=true -DskipTestCompile=true -DcreateSourcesJar=false' + AdditionalVariables: + - name: AdditionalArgs + value: '-DCOSMOS.CLIENT_TELEMETRY_ENDPOINT=$(cosmos-client-telemetry-endpoint) -DCOSMOS.CLIENT_TELEMETRY_COSMOS_ACCOUNT=$(cosmos-client-telemetry-cosmos-account)' - - template: /eng/pipelines/templates/stages/archetype-sdk-tests.yml - parameters: - TestName: 'Spring_Data_Cosmos_Integration' - CloudConfig: - Public: - SubscriptionConfigurations: - - $(sub-config-azure-cloud-test-resources) - - $(sub-config-cosmos-azure-cloud-test-resources) - MatrixConfigs: - - Name: Cosmos_live_test_integration - Path: sdk/spring/pipeline/cosmos-integration-matrix.json - Selection: all - GenerateVMJobs: true - ServiceDirectory: spring - TestResourceDirectories: - - spring/spring-cloud-azure-integration-tests/test-resources/cosmos-spring - Artifacts: - - name: azure-spring-data-cosmos - groupId: com.azure - safeName: azurespringdatacosmos - TimeoutInMinutes: 90 - PreSteps: - - template: /eng/pipelines/templates/steps/install-reporting-tools.yml - TestGoals: 'verify' - TestOptions: '$(ProfileFlag) -DskipCompile=true -DskipTestCompile=true -DcreateSourcesJar=false' - - - template: /eng/pipelines/templates/stages/archetype-sdk-tests.yml - parameters: - TestName: 'Kafka_Cosmos_Integration' - CloudConfig: - Public: - SubscriptionConfigurations: - - $(sub-config-azure-cloud-test-resources) - - $(sub-config-cosmos-azure-cloud-test-resources) - MatrixConfigs: - - Name: Kafka_Cosmos_Integration_Test - Path: sdk/cosmos/kafka-integration-matrix.json - Selection: all - GenerateVMJobs: true - ServiceDirectory: cosmos - TestResourceDirectories: - - cosmos/ - Artifacts: - - name: azure-cosmos-kafka-connect - groupId: com.azure.cosmos.kafka - safeName: azurecosmoskafkaconnect - TimeoutInMinutes: 120 - PreSteps: - - template: /eng/pipelines/templates/steps/install-reporting-tools.yml - TestGoals: 'verify' - TestOptions: '$(ProfileFlag) -DskipCompile=true -DskipTestCompile=true -DcreateSourcesJar=false' + - template: /eng/pipelines/templates/stages/archetype-sdk-tests-isolated.yml + parameters: + TestName: 'Kafka_Cosmos_Integration' + CloudConfig: + Public: + SubscriptionConfigurations: + - $(sub-config-azure-cloud-test-resources) + - $(sub-config-cosmos-azure-cloud-test-resources) + MatrixConfigs: + - Name: Kafka_Cosmos_Integration_Test + Path: sdk/cosmos/kafka-integration-matrix.json + Selection: all + GenerateVMJobs: true + ServiceDirectory: cosmos + TestResourceDirectories: + - cosmos/ + Artifacts: + - name: azure-cosmos-kafka-connect + groupId: com.azure.cosmos.kafka + safeName: azurecosmoskafkaconnect + TimeoutInMinutes: 120 + PreSteps: + - template: /eng/pipelines/templates/steps/install-reporting-tools.yml + TestGoals: 'verify' + TestOptions: '$(ProfileFlag) -DskipCompile=true -DskipTestCompile=true -DcreateSourcesJar=false' + AdditionalVariables: + - name: AdditionalArgs + value: '-DCOSMOS.CLIENT_TELEMETRY_ENDPOINT=$(cosmos-client-telemetry-endpoint) -DCOSMOS.CLIENT_TELEMETRY_COSMOS_ACCOUNT=$(cosmos-client-telemetry-cosmos-account)' diff --git a/sdk/documentintelligence/tests.native.yml b/sdk/documentintelligence/tests.native.yml index 4fcec3def8e6..d2abc732b068 100644 --- a/sdk/documentintelligence/tests.native.yml +++ b/sdk/documentintelligence/tests.native.yml @@ -1,16 +1,16 @@ trigger: none -stages: - - template: /eng/pipelines/templates/stages/archetype-sdk-native-tests.yml - parameters: - ServiceDirectory: documentintelligence - timeoutInMinutes: 150 # how long to run the job before automatically cancelling - Artifacts: - - name: azure-ai-documentintelligence - groupId: com.azure - safeName: azureaidocumentintelligence - CloudConfig: - Public: - SubscriptionConfiguration: $(sub-config-azure-cloud-test-resources) - Location: 'eastus' - SupportedClouds: 'Public' +extends: + template: /eng/pipelines/templates/stages/archetype-sdk-native-tests.yml + parameters: + ServiceDirectory: documentintelligence + timeoutInMinutes: 150 # how long to run the job before automatically cancelling + Artifacts: + - name: azure-ai-documentintelligence + groupId: com.azure + safeName: azureaidocumentintelligence + CloudConfig: + Public: + SubscriptionConfiguration: $(sub-config-azure-cloud-test-resources) + Location: 'eastus' + SupportedClouds: 'Public' diff --git a/sdk/eventhubs/version-overrides-matrix.json b/sdk/eventhubs/version-overrides-matrix.json index 8ca1fe9995b6..e596b93e7b0a 100644 --- a/sdk/eventhubs/version-overrides-matrix.json +++ b/sdk/eventhubs/version-overrides-matrix.json @@ -1,7 +1,7 @@ { "matrix": { "Agent": { - "ubuntu-20.04": { "OSVmImage": "MMSUbuntu20.04", "Pool": "azsdk-pool-mms-ubuntu-2004-general" } + "ubuntu-20.04": { "OSVmImage": "env:LINUXVMIMAGE", "Pool": "env:LINUXPOOL" } }, "JavaTestVersion": "1.21", "TestGoals": "surefire:test", diff --git a/sdk/formrecognizer/tests.native.yml b/sdk/formrecognizer/tests.native.yml index 8ac9a4e9b862..b8b66d4bc304 100644 --- a/sdk/formrecognizer/tests.native.yml +++ b/sdk/formrecognizer/tests.native.yml @@ -1,16 +1,16 @@ trigger: none -stages: - - template: /eng/pipelines/templates/stages/archetype-sdk-native-tests.yml - parameters: - ServiceDirectory: formrecognizer - timeoutInMinutes: 150 # how long to run the job before automatically cancelling - Artifacts: - - name: azure-ai-formrecognizer - groupId: com.azure - safeName: azureaiformrecognizer - CloudConfig: - Public: - SubscriptionConfiguration: $(sub-config-azure-cloud-test-resources) - Location: 'eastus' - SupportedClouds: 'Public' +extends: + template: /eng/pipelines/templates/stages/archetype-sdk-native-tests.yml + parameters: + ServiceDirectory: formrecognizer + timeoutInMinutes: 150 # how long to run the job before automatically cancelling + Artifacts: + - name: azure-ai-formrecognizer + groupId: com.azure + safeName: azureaiformrecognizer + CloudConfig: + Public: + SubscriptionConfiguration: $(sub-config-azure-cloud-test-resources) + Location: 'eastus' + SupportedClouds: 'Public' diff --git a/sdk/identity/ci.yml b/sdk/identity/ci.yml index 6c5ea43416c7..8a73b07b01ec 100644 --- a/sdk/identity/ci.yml +++ b/sdk/identity/ci.yml @@ -48,7 +48,7 @@ parameters: default: true extends: - template: ../../eng/pipelines/templates/stages/archetype-sdk-client.yml + template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: ServiceDirectory: identity EnableBatchRelease: true @@ -69,8 +69,9 @@ extends: - name: perf-test-core groupId: com.azure LiveTestStages: - - template: /eng/pipelines/templates/stages/archetype-sdk-tests.yml + - template: /eng/pipelines/templates/stages/archetype-sdk-tests-isolated.yml parameters: + CalledFromClient: true ServiceDirectory: identity SupportedClouds: 'Public,UsGov,China' Artifacts: diff --git a/sdk/keyvault/platform-matrix.json b/sdk/keyvault/platform-matrix.json index dec96e695606..6fbf3f7ee4b4 100644 --- a/sdk/keyvault/platform-matrix.json +++ b/sdk/keyvault/platform-matrix.json @@ -20,8 +20,8 @@ { "Agent": { "ubuntu-20.04_TestFromSource": { - "OSVmImage": "MMSUbuntu20.04", - "Pool": "azsdk-pool-mms-ubuntu-2004-general", + "OSVmImage": "env:LINUXVMIMAGE", + "Pool": "env:LINUXPOOL", "TestGoals": "surefire:test", "TestFromSource": true } @@ -34,8 +34,8 @@ { "Agent": { "ubuntu-20.04_TestFromSource": { - "OSVmImage": "MMSUbuntu20.04", - "Pool": "azsdk-pool-mms-ubuntu-2004-general", + "OSVmImage": "env:LINUXVMIMAGE", + "Pool": "env:LINUXPOOL", "TestGoals": "surefire:test", "TestFromSource": true } diff --git a/sdk/serialization/ci.yml b/sdk/serialization/ci.yml index fee4c9cf7b43..8c70ef903d7b 100644 --- a/sdk/serialization/ci.yml +++ b/sdk/serialization/ci.yml @@ -53,7 +53,6 @@ extends: jobs: - template: /eng/pipelines/templates/jobs/ci.versions.tests.yml parameters: - ServiceDirectory: serialization Artifacts: - name: azure-json-reflect groupId: com.azure @@ -76,7 +75,7 @@ extends: TestGoals: surefire:test LiveTestStages: - - template: /eng/pipelines/templates/stages/archetype-sdk-tests.yml + - template: /eng/pipelines/templates/stages/archetype-sdk-tests-isolated.yml parameters: ServiceDirectory: serialization Artifacts: diff --git a/sdk/servicebus/version-overrides-matrix.json b/sdk/servicebus/version-overrides-matrix.json index e3725d303c0e..8ac15095df6d 100644 --- a/sdk/servicebus/version-overrides-matrix.json +++ b/sdk/servicebus/version-overrides-matrix.json @@ -1,7 +1,7 @@ { "matrix": { "Agent": { - "ubuntu-20.04": { "OSVmImage": "MMSUbuntu20.04", "Pool": "azsdk-pool-mms-ubuntu-2004-general" } + "ubuntu-20.04": { "OSVmImage": "env:LINUXVMIMAGE", "Pool": "env:LINUXPOOL" } }, "JavaTestVersion": "1.21", "TestGoals": "surefire:test", diff --git a/sdk/spring/compatibility-tests.yml b/sdk/spring/compatibility-tests.yml index 3297cb17872e..c5cb89d556f2 100644 --- a/sdk/spring/compatibility-tests.yml +++ b/sdk/spring/compatibility-tests.yml @@ -7,7 +7,7 @@ variables: stages: - stage: "spring_boot_compatibility_tests" jobs: - - template: /eng/common/pipelines/templates/jobs/archetype-sdk-tests-generate.yml + - template: /eng/common/pipelines/templates/jobs/generate-job-matrix.yml parameters: SparseCheckout: true JobTemplatePath: ../../../../../sdk/spring/pipeline/compatibility-tests-job.yml diff --git a/sdk/spring/monitor-tests.yml b/sdk/spring/monitor-tests.yml index f6e704abce9e..ff8c50460a8d 100644 --- a/sdk/spring/monitor-tests.yml +++ b/sdk/spring/monitor-tests.yml @@ -7,7 +7,7 @@ variables: stages: - stage: "spring_monitor_tests" jobs: - - template: /eng/common/pipelines/templates/jobs/archetype-sdk-tests-generate.yml + - template: /eng/common/pipelines/templates/jobs/generate-job-matrix.yml parameters: SparseCheckout: true JobTemplatePath: ../../../../../sdk/spring/pipeline/monitor-tests-job.yml diff --git a/sdk/spring/pipeline/cosmos-integration-matrix.json b/sdk/spring/pipeline/cosmos-integration-matrix.json index 30c22f3c1178..0c821c3cb73a 100644 --- a/sdk/spring/pipeline/cosmos-integration-matrix.json +++ b/sdk/spring/pipeline/cosmos-integration-matrix.json @@ -4,7 +4,7 @@ "Session_Integration": { "ArmTemplateParameters": "@{ defaultConsistencyLevel = 'Session' }", "ProfileFlag": "-P integration-test-azure", - "Pool": "azsdk-pool-mms-ubuntu-2004-general", + "Pool": "env:LINUXPOOL", "OSVmImage": "MMSUbuntu2004" } }, diff --git a/sdk/spring/pipeline/monitor-supported-version-matrix.json b/sdk/spring/pipeline/monitor-supported-version-matrix.json index d4c7aab84e32..0fc1c370d8fd 100644 --- a/sdk/spring/pipeline/monitor-supported-version-matrix.json +++ b/sdk/spring/pipeline/monitor-supported-version-matrix.json @@ -4,7 +4,7 @@ }, "matrix": { "Agent": { - "ubuntu-20.04": { "OSVmImage": "MMSUbuntu20.04", "Pool": "azsdk-pool-mms-ubuntu-2004-general" } + "ubuntu-20.04": { "OSVmImage": "env:LINUXVMIMAGE", "Pool": "env:LINUXPOOL" } }, "JavaTestVersion": "1.21", "TEST_SPRING_BOOT_VERSION": [ diff --git a/sdk/spring/pipeline/supported-version-matrix.json b/sdk/spring/pipeline/supported-version-matrix.json index b7fcb1701994..3061483ac3da 100644 --- a/sdk/spring/pipeline/supported-version-matrix.json +++ b/sdk/spring/pipeline/supported-version-matrix.json @@ -4,7 +4,7 @@ }, "matrix": { "Agent": { - "ubuntu-20.04": { "OSVmImage": "MMSUbuntu20.04", "Pool": "azsdk-pool-mms-ubuntu-2004-general" } + "ubuntu-20.04": { "OSVmImage": "env:LINUXVMIMAGE", "Pool": "env:LINUXPOOL" } }, "JavaTestVersion": "1.21", "SPRING_CLOUD_AZURE_TEST_SUPPORTED_SPRING_BOOT_VERSION": [ diff --git a/sdk/spring/tests.yml b/sdk/spring/tests.yml index 10b4af291495..c31f9a6469a4 100644 --- a/sdk/spring/tests.yml +++ b/sdk/spring/tests.yml @@ -1,83 +1,86 @@ trigger: none -stages: - - template: ../../eng/pipelines/templates/stages/archetype-sdk-tests.yml - parameters: - SupportedClouds: "Public,UsGov,China" - Clouds: "Public" - CloudConfig: - Public: - SubscriptionConfiguration: $(sub-config-azure-cloud-test-resources) - UsGov: - SubscriptionConfiguration: $(sub-config-gov-test-resources) - China: - SubscriptionConfiguration: $(sub-config-cn-test-resources) - Location: "chinanorth3" - TestResourceDirectories: - - spring/spring-cloud-azure-integration-tests/test-resources/common - - spring/spring-cloud-azure-integration-tests/test-resources/jdbc/mysql - - spring/spring-cloud-azure-integration-tests/test-resources/appconfiguration - - spring/spring-cloud-azure-integration-tests/test-resources/cosmos - - spring/spring-cloud-azure-integration-tests/test-resources/servicebus - - spring/spring-cloud-azure-integration-tests/test-resources/eventhubs - - spring/spring-cloud-azure-integration-tests/test-resources/storage - - spring/spring-cloud-azure-integration-tests/test-resources/keyvault - - spring/spring-cloud-azure-integration-tests/test-resources/dummy - Artifacts: - - name: spring-cloud-azure-integration-tests - groupId: com.azure.spring - safeName: springcloudazureintegrationtests - TimeoutInMinutes: 240 - ServiceDirectory: spring - TestName: Spring_IT - TestGoals: "verify" - TestOptions: "-DskipSpringITs=false" - - template: ../../eng/pipelines/templates/stages/archetype-sdk-tests.yml - parameters: - SupportedClouds: 'Public,UsGov,China' - Clouds: 'Public' - CloudConfig: - Public: - SubscriptionConfiguration: $(sub-config-azure-cloud-test-resources) - UsGov: - SubscriptionConfiguration: $(sub-config-gov-test-resources) - China: - SubscriptionConfiguration: $(sub-config-cn-test-resources) - TestResourceDirectories: - - spring/spring-cloud-azure-integration-test-appconfiguration-config - Artifacts: - - name: spring-cloud-azure-integration-test-appconfiguration-config - groupId: com.azure.spring - safeName: springcloudazureintegrationtestappconfigurationconfig - TimeoutInMinutes: 60 - ServiceDirectory: spring - TestName: Spring_App_Config_IT - TestGoals: 'verify' - - template: ../../eng/pipelines/templates/stages/archetype-sdk-tests.yml - parameters: - SupportedClouds: 'Public,UsGov' - Clouds: 'Public' - CloudConfig: - Public: - SubscriptionConfiguration: $(sub-config-azure-cloud-test-resources) - UsGov: - SubscriptionConfiguration: $(sub-config-gov-test-resources) - MatrixConfigs: - - Name: Cosmos_live_test_integration - Path: sdk/spring/pipeline/cosmos-integration-matrix.json - Selection: all - GenerateVMJobs: true - TestResourceDirectories: - - spring/spring-cloud-azure-integration-tests/test-resources/cosmos-spring - Artifacts: - - name: azure-spring-data-cosmos - groupId: com.azure - safeName: azurespringdatacosmos - TimeoutInMinutes: 90 - PreSteps: - - template: /eng/pipelines/templates/steps/install-reporting-tools.yml - ServiceDirectory: spring - TestName: 'Spring_Data_Cosmos_Integration' - TestGoals: 'clean verify' - TestOptions: '$(ProfileFlag)' +extends: + template: /eng/pipelines/templates/stages/1es-redirect.yml + parameters: + stages: + - template: /eng/pipelines/templates/stages/archetype-sdk-tests-isolated.yml + parameters: + SupportedClouds: "Public,UsGov,China" + Clouds: "Public" + CloudConfig: + Public: + SubscriptionConfiguration: $(sub-config-azure-cloud-test-resources) + UsGov: + SubscriptionConfiguration: $(sub-config-gov-test-resources) + China: + SubscriptionConfiguration: $(sub-config-cn-test-resources) + Location: "chinanorth3" + TestResourceDirectories: + - spring/spring-cloud-azure-integration-tests/test-resources/common + - spring/spring-cloud-azure-integration-tests/test-resources/jdbc/mysql + - spring/spring-cloud-azure-integration-tests/test-resources/appconfiguration + - spring/spring-cloud-azure-integration-tests/test-resources/cosmos + - spring/spring-cloud-azure-integration-tests/test-resources/servicebus + - spring/spring-cloud-azure-integration-tests/test-resources/eventhubs + - spring/spring-cloud-azure-integration-tests/test-resources/storage + - spring/spring-cloud-azure-integration-tests/test-resources/keyvault + - spring/spring-cloud-azure-integration-tests/test-resources/dummy + Artifacts: + - name: spring-cloud-azure-integration-tests + groupId: com.azure.spring + safeName: springcloudazureintegrationtests + TimeoutInMinutes: 240 + ServiceDirectory: spring + TestName: Spring_IT + TestGoals: "verify" + TestOptions: "-DskipSpringITs=false" + - template: /eng/pipelines/templates/stages/archetype-sdk-tests-isolated.yml + parameters: + SupportedClouds: 'Public,UsGov,China' + Clouds: 'Public' + CloudConfig: + Public: + SubscriptionConfiguration: $(sub-config-azure-cloud-test-resources) + UsGov: + SubscriptionConfiguration: $(sub-config-gov-test-resources) + China: + SubscriptionConfiguration: $(sub-config-cn-test-resources) + TestResourceDirectories: + - spring/spring-cloud-azure-integration-test-appconfiguration-config + Artifacts: + - name: spring-cloud-azure-integration-test-appconfiguration-config + groupId: com.azure.spring + safeName: springcloudazureintegrationtestappconfigurationconfig + TimeoutInMinutes: 60 + ServiceDirectory: spring + TestName: Spring_App_Config_IT + TestGoals: 'verify' + - template: /eng/pipelines/templates/stages/archetype-sdk-tests-isolated.yml + parameters: + SupportedClouds: 'Public,UsGov' + Clouds: 'Public' + CloudConfig: + Public: + SubscriptionConfiguration: $(sub-config-azure-cloud-test-resources) + UsGov: + SubscriptionConfiguration: $(sub-config-gov-test-resources) + MatrixConfigs: + - Name: Cosmos_live_test_integration + Path: sdk/spring/pipeline/cosmos-integration-matrix.json + Selection: all + GenerateVMJobs: true + TestResourceDirectories: + - spring/spring-cloud-azure-integration-tests/test-resources/cosmos-spring + Artifacts: + - name: azure-spring-data-cosmos + groupId: com.azure + safeName: azurespringdatacosmos + TimeoutInMinutes: 90 + PreSteps: + - template: /eng/pipelines/templates/steps/install-reporting-tools.yml + ServiceDirectory: spring + TestName: 'Spring_Data_Cosmos_Integration' + TestGoals: 'clean verify' + TestOptions: '$(ProfileFlag)' diff --git a/sdk/storage/platform-matrix-all-versions.json b/sdk/storage/platform-matrix-all-versions.json index 4fb71571a81a..34fc36f841bf 100644 --- a/sdk/storage/platform-matrix-all-versions.json +++ b/sdk/storage/platform-matrix-all-versions.json @@ -1,8 +1,8 @@ { "matrix": { "Agent": { - "ubuntu-20.04": { "OSVmImage": "MMSUbuntu20.04", "Pool": "azsdk-pool-mms-ubuntu-2004-general" }, - "windows-2022": { "OSVmImage": "windows-2022", "Pool": "azsdk-pool-mms-win-2022-general" } + "ubuntu-20.04": { "OSVmImage": "env:LINUXVMIMAGE", "Pool": "env:LINUXPOOL" }, + "windows-2022": { "OSVmImage": "env:WINDOWSVMIMAGE", "Pool": "env:WINDOWSPOOL" } }, "JavaTestVersion": [ "1.8", "1.21" ], "AZURE_TEST_HTTP_CLIENTS": [ "okhttp", "netty" ], diff --git a/sdk/storage/platform-matrix-ci.json b/sdk/storage/platform-matrix-ci.json index 362b8415d4ee..adc9a427db03 100644 --- a/sdk/storage/platform-matrix-ci.json +++ b/sdk/storage/platform-matrix-ci.json @@ -4,7 +4,7 @@ }, "include": [ { - "Agent": { "windows-2022": { "OSVmImage": "windows-2022", "Pool": "azsdk-pool-mms-win-2022-general" } }, + "Agent": { "windows-2022": { "OSVmImage": "env:WINDOWSVMIMAGE", "Pool": "env:WINDOWSPOOL" } }, "JavaTestVersion": "1.21", "AZURE_TEST_HTTP_CLIENTS": "netty", "TestFromSource": false, diff --git a/sdk/storage/platform-matrix.json b/sdk/storage/platform-matrix.json index e5ad48314ad7..f1db18982b39 100644 --- a/sdk/storage/platform-matrix.json +++ b/sdk/storage/platform-matrix.json @@ -7,32 +7,32 @@ ], "include": [ { - "Agent": { "macos-11": { "OSVmImage": "macos-11", "Pool": "Azure Pipelines" } }, + "Agent": { "macos-11": { "OSVmImage": "env:MACVMIMAGE", "Pool": "env:MACPOOL" } }, "JavaTestVersion": "1.8", "AZURE_TEST_HTTP_CLIENTS": "netty", "TestFromSource": false }, { - "Agent": { "macos-11": { "OSVmImage": "macos-11", "Pool": "Azure Pipelines" } }, + "Agent": { "macos-11": { "OSVmImage": "env:MACVMIMAGE", "Pool": "env:MACPOOL" } }, "JavaTestVersion": "1.11", "AZURE_TEST_HTTP_CLIENTS": "okhttp", "TestFromSource": false }, { - "Agent": { "windows-2022": { "OSVmImage": "windows-2022", "Pool": "azsdk-pool-mms-win-2022-general" } }, + "Agent": { "windows-2022": { "OSVmImage": "env:WINDOWSVMIMAGE", "Pool": "env:WINDOWSPOOL" } }, "JavaTestVersion": "1.17", "AZURE_TEST_HTTP_CLIENTS": "netty", "TestFromSource": false }, { - "Agent": { "windows-2022": { "OSVmImage": "windows-2022", "Pool": "azsdk-pool-mms-win-2022-general" } }, + "Agent": { "windows-2022": { "OSVmImage": "env:WINDOWSVMIMAGE", "Pool": "env:WINDOWSPOOL" } }, "JavaTestVersion": "1.21", "AZURE_TEST_HTTP_CLIENTS": "netty", "TestFromSource": false }, { "Agent": { - "ubuntu-20.04": { "OSVmImage": "MMSUbuntu20.04", "Pool": "azsdk-pool-mms-ubuntu-2004-general" } + "ubuntu-20.04": { "OSVmImage": "env:LINUXVMIMAGE", "Pool": "env:LINUXPOOL" } }, "JavaTestVersion": ["1.8", "1.21"], "AZURE_TEST_HTTP_CLIENTS": "netty", diff --git a/sdk/storage/tests-template.yml b/sdk/storage/tests-template.yml index 9ea08c858926..d9a361cf0753 100644 --- a/sdk/storage/tests-template.yml +++ b/sdk/storage/tests-template.yml @@ -4,7 +4,7 @@ parameters: default: [] stages: - - template: /eng/pipelines/templates/stages/archetype-sdk-tests.yml + - template: /eng/pipelines/templates/stages/archetype-sdk-tests-isolated.yml parameters: ServiceDirectory: storage Artifacts: @@ -55,7 +55,8 @@ stages: SupportedClouds: Preview MatrixReplace: # Use dedicated storage pool in canadacentral with higher memory capacity - - Pool=(.*)-general/$1-storage + - Pool=.*LINUXPOOL.*/azsdk-pool-mms-ubuntu-2004-storage + - Pool=.*WINDOWSPOOL.*/azsdk-pool-mms-win-2022-general - ${{ each additionalReplace in parameters.AdditionalMatrixReplace }}: - ${{ additionalReplace }} MatrixConfigs: diff --git a/sdk/tables/platform-matrix.json b/sdk/tables/platform-matrix.json index 65be0e6f2424..f28473ad4e00 100644 --- a/sdk/tables/platform-matrix.json +++ b/sdk/tables/platform-matrix.json @@ -6,9 +6,9 @@ }, "matrix": { "Agent": { - "windows-2022": { "OSVmImage": "windows-2022", "Pool": "azsdk-pool-mms-win-2022-general" }, - "ubuntu-2004": { "OSVmImage": "MMSUbuntu20.04", "Pool": "azsdk-pool-mms-ubuntu-2004-general" }, - "macos-11": { "OSVmImage": "macos-11", "Pool": "Azure Pipelines" } + "windows-2022": { "OSVmImage": "env:WINDOWSVMIMAGE", "Pool": "env:WINDOWSPOOL" }, + "ubuntu-2004": { "OSVmImage": "env:LINUXVMIMAGE", "Pool": "env:LINUXPOOL" }, + "macos-11": { "OSVmImage": "env:MACVMIMAGE", "Pool": "env:MACPOOL" } }, "ArmTemplateParameters": [ "@{endpointType='storage'}", "@{endpointType='cosmos'}" ], "AZURE_TEST_HTTP_CLIENTS": "netty", @@ -19,7 +19,7 @@ "AZURE_TEST_HTTP_CLIENTS": "okhttp", "JavaTestVersion": "1.8", "Agent": { - "windows-2022": { "OSVmImage": "windows-2022", "Pool": "azsdk-pool-mms-win-2022-general" } + "windows-2022": { "OSVmImage": "env:WINDOWSVMIMAGE", "Pool": "env:WINDOWSPOOL" } }, "ArmTemplateParameters": "@{endpointType='storage'}" }, @@ -27,7 +27,7 @@ "AZURE_TEST_HTTP_CLIENTS": "okhttp", "JavaTestVersion": "1.21", "Agent": { - "macos-11": { "OSVmImage": "macos-11", "Pool": "Azure Pipelines" } + "macos-11": { "OSVmImage": "env:MACVMIMAGE", "Pool": "env:MACPOOL" } }, "ArmTemplateParameters": "@{endpointType='storage'}" }, @@ -35,7 +35,7 @@ "AZURE_TEST_HTTP_CLIENTS": "netty", "JavaTestVersion": "1.21", "Agent": { - "ubuntu-2004": { "OSVmImage": "MMSUbuntu20.04", "Pool": "azsdk-pool-mms-ubuntu-2004-general" } + "ubuntu-2004": { "OSVmImage": "env:LINUXVMIMAGE", "Pool": "env:LINUXPOOL" } }, "ArmTemplateParameters": "@{endpointType='storage'}", "TestFromSource": true diff --git a/sdk/template/ci.yml b/sdk/template/ci.yml index 3f336645544d..e980f668bfd9 100644 --- a/sdk/template/ci.yml +++ b/sdk/template/ci.yml @@ -88,7 +88,7 @@ extends: - name: perf-test-core groupId: com.azure LiveTestStages: - - template: /eng/pipelines/templates/stages/archetype-sdk-tests.yml + - template: /eng/pipelines/templates/stages/archetype-sdk-tests-isolated.yml parameters: ServiceDirectory: template Artifacts: diff --git a/sdk/template/tests.yml b/sdk/template/tests.yml index 0fb81b159110..8df72b803313 100644 --- a/sdk/template/tests.yml +++ b/sdk/template/tests.yml @@ -1,14 +1,14 @@ trigger: none -stages: - - template: /eng/pipelines/templates/stages/archetype-sdk-tests.yml - parameters: - ServiceDirectory: appconfiguration - Artifacts: - - name: azure-sdk-template - groupId: com.azure - safeName: azuresdktemplate - EnvVars: - AZURE_TENANT_ID: $(TEMPLATE_TENANT_ID) - AZURE_CLIENT_SECRET: $(TEMPLATE_CLIENT_SECRET) - AZURE_CLIENT_ID: $(TEMPLATE_CLIENT_ID) +extends: + template: /eng/pipelines/templates/stages/archetype-sdk-tests.yml + parameters: + ServiceDirectory: appconfiguration + Artifacts: + - name: azure-sdk-template + groupId: com.azure + safeName: azuresdktemplate + EnvVars: + AZURE_TENANT_ID: $(TEMPLATE_TENANT_ID) + AZURE_CLIENT_SECRET: $(TEMPLATE_CLIENT_SECRET) + AZURE_CLIENT_ID: $(TEMPLATE_CLIENT_ID) diff --git a/sdk/textanalytics/tests.native.yml b/sdk/textanalytics/tests.native.yml index 7a5e0ce6f419..d3c28b63c324 100644 --- a/sdk/textanalytics/tests.native.yml +++ b/sdk/textanalytics/tests.native.yml @@ -1,25 +1,25 @@ trigger: none -stages: - - template: /eng/pipelines/templates/stages/archetype-sdk-native-tests.yml - parameters: - ServiceDirectory: textanalytics - Location: eastus - SupportedClouds: 'Public' - Artifacts: - - name: azure-ai-textanalytics - groupId: com.azure - safeName: azureaitextanalytics - # temporary env vars for custom text features - EnvVars: - AZURE_TENANT_ID: $(TEXTANALYTICS_TENANT_ID) - AZURE_CLIENT_SECRET: $(TEXTANALYTICS_CLIENT_SECRET) - AZURE_CLIENT_ID: $(TEXTANALYTICS_CLIENT_ID) - AZURE_TEXT_ANALYTICS_CUSTOM_TEXT_API_KEY: $(java-textanalytics-test-api-key) - AZURE_TEXT_ANALYTICS_CUSTOM_TEXT_ENDPOINT: $(java-textanalytics-test-ppe-endpoint-string) - AZURE_TEXT_ANALYTICS_CUSTOM_SINGLE_CLASSIFICATION_PROJECT_NAME: $(java-single-category-classify-project-name) - AZURE_TEXT_ANALYTICS_CUSTOM_SINGLE_CLASSIFICATION_DEPLOYMENT_NAME: $(java-single-category-classify-deployment-name) - AZURE_TEXT_ANALYTICS_CUSTOM_MULTI_CLASSIFICATION_PROJECT_NAME: $(java-multi-category-classify-project-name) - AZURE_TEXT_ANALYTICS_CUSTOM_MULTI_CLASSIFICATION_DEPLOYMENT_NAME: $(java-multi-category-classify-deployment-name) - AZURE_TEXT_ANALYTICS_CUSTOM_ENTITIES_PROJECT_NAME: $(java-recognize-custom-entities-project-name) - AZURE_TEXT_ANALYTICS_CUSTOM_ENTITIES_DEPLOYMENT_NAME: $(java-recognize-custom-entities-deployment-name) +extends: + template: /eng/pipelines/templates/stages/archetype-sdk-native-tests.yml + parameters: + ServiceDirectory: textanalytics + Location: eastus + SupportedClouds: 'Public' + Artifacts: + - name: azure-ai-textanalytics + groupId: com.azure + safeName: azureaitextanalytics + # temporary env vars for custom text features + EnvVars: + AZURE_TENANT_ID: $(TEXTANALYTICS_TENANT_ID) + AZURE_CLIENT_SECRET: $(TEXTANALYTICS_CLIENT_SECRET) + AZURE_CLIENT_ID: $(TEXTANALYTICS_CLIENT_ID) + AZURE_TEXT_ANALYTICS_CUSTOM_TEXT_API_KEY: $(java-textanalytics-test-api-key) + AZURE_TEXT_ANALYTICS_CUSTOM_TEXT_ENDPOINT: $(java-textanalytics-test-ppe-endpoint-string) + AZURE_TEXT_ANALYTICS_CUSTOM_SINGLE_CLASSIFICATION_PROJECT_NAME: $(java-single-category-classify-project-name) + AZURE_TEXT_ANALYTICS_CUSTOM_SINGLE_CLASSIFICATION_DEPLOYMENT_NAME: $(java-single-category-classify-deployment-name) + AZURE_TEXT_ANALYTICS_CUSTOM_MULTI_CLASSIFICATION_PROJECT_NAME: $(java-multi-category-classify-project-name) + AZURE_TEXT_ANALYTICS_CUSTOM_MULTI_CLASSIFICATION_DEPLOYMENT_NAME: $(java-multi-category-classify-deployment-name) + AZURE_TEXT_ANALYTICS_CUSTOM_ENTITIES_PROJECT_NAME: $(java-recognize-custom-entities-project-name) + AZURE_TEXT_ANALYTICS_CUSTOM_ENTITIES_DEPLOYMENT_NAME: $(java-recognize-custom-entities-deployment-name)