diff --git a/eng/common/scripts/git-branch-push.ps1 b/eng/common/scripts/git-branch-push.ps1 index 333ed0a62c5e..8de7812141f1 100644 --- a/eng/common/scripts/git-branch-push.ps1 +++ b/eng/common/scripts/git-branch-push.ps1 @@ -27,6 +27,8 @@ param( [Parameter(Mandatory = $false)] [string] $PushArgs = "", + [string] $ForkName = "azure-sdk-fork", + [Parameter(Mandatory = $false)] [boolean] $SkipCommit = $false ) @@ -36,16 +38,16 @@ param( # would fail the first time git wrote command output. $ErrorActionPreference = "Continue" -Write-Host "git remote add azure-sdk-fork $GitUrl" -git remote add azure-sdk-fork $GitUrl +Write-Host "git remote add $ForkName $GitUrl" +git remote add $ForkName $GitUrl if ($LASTEXITCODE -ne 0) { Write-Error "Unable to add remote LASTEXITCODE=$($LASTEXITCODE), see command output above." exit $LASTEXITCODE } -Write-Host "git fetch azure-sdk-fork" -git fetch azure-sdk-fork +Write-Host "git fetch $ForkName" +git fetch $ForkName if ($LASTEXITCODE -ne 0) { Write-Error "Unable to fetch remote LASTEXITCODE=$($LASTEXITCODE), see command output above." @@ -84,15 +86,15 @@ $tryNumber = 0 do { $needsRetry = $false - Write-Host "git push azure-sdk-fork $PRBranchName $PushArgs" - git push azure-sdk-fork $PRBranchName $PushArgs + Write-Host "git push $ForkName $PRBranchName $PushArgs" + git push $ForkName $PRBranchName $PushArgs $tryNumber++ if ($LASTEXITCODE -ne 0) { $needsRetry = $true Write-Host "Git push failed with LASTEXITCODE=$($LASTEXITCODE) Need to fetch and rebase: attempt number=$($tryNumber)" - Write-Host "git fetch azure-sdk-fork" - git fetch azure-sdk-fork + Write-Host "git fetch $ForkName" + git fetch $ForkName if ($LASTEXITCODE -ne 0) { Write-Error "Unable to fetch remote LASTEXITCODE=$($LASTEXITCODE), see command output above." @@ -110,8 +112,8 @@ do continue } - Write-Host "git reset --hard azure-sdk-fork/${PRBranchName}" - git reset --hard azure-sdk-fork/${PRBranchName} + Write-Host "git reset --hard $ForkName/${PRBranchName}" + git reset --hard $ForkName/${PRBranchName} if ($LASTEXITCODE -ne 0) { Write-Error "Unable to hard reset branch LASTEXITCODE=$($LASTEXITCODE), see command output above." diff --git a/eng/common/scripts/modules/ChangeLog-Operations.psm1 b/eng/common/scripts/modules/ChangeLog-Operations.psm1 index ca432870b34f..cba8a2631298 100644 --- a/eng/common/scripts/modules/ChangeLog-Operations.psm1 +++ b/eng/common/scripts/modules/ChangeLog-Operations.psm1 @@ -1,6 +1,5 @@ $RELEASE_TITLE_REGEX = "(?^\#+.*(?\b\d+\.\d+\.\d+([^0-9\s][^\s:]+)?)(\s(?\(Unreleased\)|\(\d{4}-\d{2}-\d{2}\)))?)" -# Returns a Collection of changeLogEntry object containing changelog info for all version present in the gived CHANGELOG function Get-ChangeLogEntries { param ( [Parameter(Mandatory = $true)] diff --git a/eng/pipelines/eng-common-sync.yml b/eng/pipelines/eng-common-sync.yml index 216108ab1cca..5b41815e9bbb 100644 --- a/eng/pipelines/eng-common-sync.yml +++ b/eng/pipelines/eng-common-sync.yml @@ -36,7 +36,7 @@ pr: - eng/common pool: - vmImage: windows-2019 + vmImage: ubuntu-18.04 stages: - ${{ if eq(variables['Build.Reason'], 'PullRequest') }}: diff --git a/eng/pipelines/templates/steps/sync-directory.yml b/eng/pipelines/templates/steps/sync-directory.yml index e71bd26f1397..8ec760ddec65 100644 --- a/eng/pipelines/templates/steps/sync-directory.yml +++ b/eng/pipelines/templates/steps/sync-directory.yml @@ -41,7 +41,7 @@ steps: workingDirectory: $(System.DefaultWorkingDirectory) - task: PowerShell@2 - displayName: Push changes + displayName: Push changes for creating Sync PRs condition: and(succeeded(), eq(variables['HasChanges'], 'true')) inputs: pwsh: true @@ -54,6 +54,21 @@ steps: -PushArgs "${{ parameters.PushArgs }}" -SkipCommit $${{parameters.SkipCheckingForChanges}} + - task: PowerShell@2 + displayName: Push changes for Queueing Test Pipeline + condition: and(succeeded(), ne(variables['${{repo}}-template-definition-id'], '')) + inputs: + pwsh: true + workingDirectory: $(System.DefaultWorkingDirectory)/${{ repo }} + filePath: ${{ parameters.ScriptDirectory }}/git-branch-push.ps1 + arguments: > + -PRBranchName "${{ parameters.UpstreamBranchName }}-ForTestPipeline" + -CommitMsg "${{ parameters.CommitMessage }}" + -GitUrl "https://$(azuresdk-github-pat)@github.com/${{ parameters.PROwner }}/${{ repo }}.git" + -PushArgs "${{ parameters.PushArgs }}" + -ForkName "azure-sdk-test-fork" + -SkipCommit $${{parameters.SkipCheckingForChanges}} + - task: PowerShell@2 displayName: Queue test pipeline condition: and(succeeded(), ne(variables['${{repo}}-template-definition-id'], '')) @@ -64,7 +79,7 @@ steps: arguments: > -Organization "azure-sdk" -Project "internal" - -SourceBranch "${{ parameters.UpstreamBranchName }}" + -SourceBranch "${{ parameters.UpstreamBranchName }}-ForTestPipeline" -DefinitionId "$(${{repo}}-template-definition-id)" -VsoQueuedPipelines "QueuedPipelines" -AuthToken "$(azuresdk-azure-sdk-devops-build-queuing-pat)"