From b3fe1497e0218f6804b8f9301d3b8f7bee44fb76 Mon Sep 17 00:00:00 2001 From: Chidozie Ononiwu Date: Wed, 7 Oct 2020 17:45:19 -0700 Subject: [PATCH] Remove Verify an Merge Stage, Add auto-merge label to the Tools PR --- eng/pipelines/eng-common-sync.yml | 67 +++---------------------------- 1 file changed, 6 insertions(+), 61 deletions(-) diff --git a/eng/pipelines/eng-common-sync.yml b/eng/pipelines/eng-common-sync.yml index caa51775611e..a3b0afe30700 100644 --- a/eng/pipelines/eng-common-sync.yml +++ b/eng/pipelines/eng-common-sync.yml @@ -97,10 +97,6 @@ stages: steps: - checkout: self - - pwsh: | - New-Item -Path $(Build.ArtifactStagingDirectory)/${{ parameters.PRDataFileName }} -ItemType File - displayName: Create PRData Artifact - - ${{ each repo in parameters.Repos }}: - task: PowerShell@2 displayName: Create pull request @@ -118,7 +114,7 @@ stages: -PRBranch "sync-${{ parameters.DirectoryToSync }}-$(System.PullRequest.SourceBranch)-$(System.PullRequest.PullRequestNumber)" -AuthToken "$(azuresdk-github-pat)" -PRTitle "Sync ${{ parameters.DirectoryToSync }} directory with azure-sdk-tools for PR $(System.PullRequest.PullRequestNumber)" - -PRLabels "Central-EngSys, EngSys" + -PRLabels "Central-EngSys,EngSys,auto-merge" -PRBody "Sync ${{ parameters.DirectoryToSync }} directory with azure-sdk-tools for PR https://github.com/Azure/azure-sdk-tools/pull/$(System.PullRequest.PullRequestNumber)` See [eng/common workflow](https://github.com/Azure/azure-sdk-tools/blob/master/eng/common/README.md#workflow)" ${{ if ne(variables['Build.Reason'], 'PullRequest') }}: @@ -134,59 +130,8 @@ stages: -PRBody "Sync ${{ parameters.DirectoryToSync }} directory with azure-sdk-tools for PR https://github.com/Azure/azure-sdk-tools/pull/$(System.PullRequest.PullRequestNumber)` See [eng/common workflow](https://github.com/Azure/azure-sdk-tools/blob/master/eng/common/README.md#workflow)" - - pwsh: | - $PRData = "Azure;${{ repo }};$(Submitted.PullRequest.Number)" - Add-Content -Path "$(Build.ArtifactStagingDirectory)/${{ parameters.PRDataFileName }}" -Value $PRData - displayName: Write Sync PR Data to Artifact File - condition: succeeded() - - - task: PublishPipelineArtifact@1 - condition: succeeded() - displayName: Publish ${{ parameters.PRDataFileName }} - inputs: - artifactName: ${{ parameters.ArtifactName }} - path: $(Build.ArtifactStagingDirectory)/${{ parameters.PRDataFileName }} - - - stage: VerifyAndMerge - jobs: - - deployment: VerifyandMergeSyncPrs - displayName: Verify and Merge Sync PRs - environment: githubmerges - - pool: - vmImage: windows-2019 - - strategy: - runOnce: - deploy: - steps: - - checkout: self - - - download: current - artifact: ${{parameters.ArtifactName}} - displayName: Download ${{ parameters.PRDataFileName }} - - - task: PowerShell@2 - displayName: 'Verify then Merge Pull Requests' - inputs: - targetType: filePath - filePath: $(Build.SourcesDirectory)/eng/scripts/Verify-And-Merge-PRs.ps1 - arguments: > - -PRDataArtifactPath "$(Pipeline.Workspace)/${{parameters.ArtifactName}}/${{ parameters.PRDataFileName }}" - -AuthToken "$(azuresdk-github-pat)" - -devOpsLogging - pwsh: true - - - ${{ if ne(variables['Build.Reason'], 'PullRequest') }}: - - ${{ each repo in parameters.Repos }}: - - pwsh: | - git clone https://github.com/azure/${{ repo }} --depth 1 - pushd $(System.DefaultWorkingDirectory)/${{ repo }} - git push origin --delete "sync-${{ parameters.DirectoryToSync }}-$(System.PullRequest.SourceBranch)-$(System.PullRequest.PullRequestNumber)" - if ($lastExitCode -ne 0) { - Write-Host "Failed to delete [sync-${{ parameters.DirectoryToSync }}-$(System.PullRequest.SourceBranch)-$(System.PullRequest.PullRequestNumber)] branch in ${{ repo }}" - exit 1 - } - displayName: Write Sync PR Data to Artifact File - workingDirectory: $(System.DefaultWorkingDirectory) - condition: succeeded() + - pwsh: | + . "$(Build.SourcesDirectory)\eng\common\scripts\Invoke-GitHub-API.ps1" -AuthToken "$(azuresdk-github-pat)" + UpdateIssue -RepoOwner "Azure" -RepoName "azure-sdk-tools" -IssueNumber $(System.PullRequest.PullRequestNumber) -labels "auto-merge" + displayName: Add Auto Merge to Tool PR. + condition: succeeded() \ No newline at end of file