Skip to content

Commit

Permalink
Add some changes in eng/common to test things
Browse files Browse the repository at this point in the history
  • Loading branch information
chidozieononiwu committed Sep 19, 2020
1 parent d7a29f5 commit e0fed5e
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 9 deletions.
3 changes: 2 additions & 1 deletion eng/common/pipelines/templates/steps/create-pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ parameters:
GHTeamReviewersVariable: ''
# Multiple labels seperated by comma, e.g. "bug, APIView"
PRLabels: ''
SkipCheckingForChanges: false

steps:

Expand All @@ -42,7 +43,7 @@ steps:
echo "RepoName = $repName"
displayName: Check for changes
condition: and(succeeded(), eq(variables['HasChanges'], ''))
condition: and(succeeded(), eq(${{ parameters.SkipCheckingForChanges }}, true))
workingDirectory: ${{ parameters.WorkingDirectory }}
ignoreLASTEXITCODE: true

Expand Down
2 changes: 1 addition & 1 deletion eng/common/scripts/modules/ChangeLog-Operations.psm1
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Common Changelog Operations

# This Files has been retired
$RELEASE_TITLE_REGEX = "(?<releaseNoteTitle>^\#+.*(?<version>\b\d+\.\d+\.\d+([^0-9\s][^\s:]+)?)(\s(?<releaseStatus>\(Unreleased\)|\(\d{4}-\d{2}-\d{2}\)))?)"

# Returns a Collection of changeLogEntry object containing changelog info for all version present in the gived CHANGELOG
Expand Down
1 change: 1 addition & 0 deletions eng/common/scripts/modules/Package-Properties.psm1
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# This Files has been retired
# Helper functions for retireving useful information from azure-sdk-for-* repo
# Example Use : Import-Module .\eng\common\scripts\modules
class PackageProps
Expand Down
14 changes: 10 additions & 4 deletions eng/pipelines/eng-common-sync.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,16 @@ stages:
- ${{ if eq(variables['Build.Reason'], 'PullRequest') }}:
- pwsh: |
$patchDir = "$(System.DefaultWorkingDirectory)/patchfiles"
$patchfiles = git format-patch $(system.pullRequest.sourceBranch)...$(system.pullRequest.targetBranch) ${{ parameters.DirectoryToSync }} -o $patchDir
if ($patchfiles)
{
git log --graph --pretty=format:'%C(auto)%h%d %s %Creset%C(green)//%an %cr%Creset' -20
$patchfiles = git format-patch HEAD~1...origin/master -- ${{ parameters.DirectoryToSync }} -o $patchDir
Write-Host "Patch Files $patchfiles"
Write-Host "LASTEXITCODE $LASTEXITCODE"
if ($patchfiles -and ($LASTEXITCODE -eq 0)) {
echo "##vso[task.setvariable variable=PatchFilesLocation]$patchDir"
echo "##vso[task.setvariable variable=HasChanges]$true"
}
else {
Write-Host "Failed to Create PatchFiles from Pull Request [https://github.com/Azure/azure-sdk-tools/pull/$(System.PullRequest.PullRequestNumber)]"
exit 1
}
displayName: Create Patch Files from Changes in PR
workingDirectory: $(System.DefaultWorkingDirectory)
Expand All @@ -53,6 +58,7 @@ stages:
PRBody: >
Sync ${{ parameters.DirectoryToSync }} directory with azure-sdk-tools for PR https://github.com/Azure/azure-sdk-tools/pull/$(System.PullRequest.PullRequestNumber)<br>
See [eng/common workflow](https://github.com/Azure/azure-sdk-tools/blob/master/eng/common/README.md#workflow)
SkipCheckingForChanges: true
${{ if ne(variables['Build.Reason'], 'PullRequest') }}:
CommitMessage: Sync ${{ parameters.DirectoryToSync }} directory with azure-sdk-tools repository
DirectoryToSync: ${{ parameters.DirectoryToSync }}
Expand Down
8 changes: 5 additions & 3 deletions eng/pipelines/templates/steps/sync-directory.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ parameters:
PRTitle: pr-title-not-set
PRBody: pr-body-not-set
PRDataArtifactPath: pr-data-artifact-path-not-set
SkipCheckingForChanges: false

steps:
- pwsh: |
Expand All @@ -20,10 +21,10 @@ steps:
if ($PatchFilesLocation)
{
pushd ${{ repo }}
$results = Get-ChildItem $PatchFilesLocation | % { $git am $_.FullName }
if ($results.Count -ne (Get-ChildItem $PatchFilesLocation).Count)
$results = Get-ChildItem $PatchFilesLocation | % { git am $_.FullName }
if (($results.Count -ne (Get-ChildItem $PatchFilesLocation).Count) -or ($LASTEXITCODE -ne 0))
{
Write-Output "Failed to apply patch files"
Write-Output "Failed to apply patch files to [https://github.com/azure/${{ repo }}]"
exit 1
}
}
Expand All @@ -50,6 +51,7 @@ steps:
PushArgs: -f
WorkingDirectory: $(System.DefaultWorkingDirectory)/${{ repo }}
ScriptDirectory: $(System.DefaultWorkingDirectory)/eng/common/scripts
SkipCheckingForChanges: ${{ parameters.SkipCheckingForChanges }}

- pwsh: |
$PRData = "Azure;${{ repo }};$(Submitted.PullRequest.Number)"
Expand Down

0 comments on commit e0fed5e

Please sign in to comment.