-
Notifications
You must be signed in to change notification settings - Fork 186
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update Tools repo Sync to make use of patch files #995
Update Tools repo Sync to make use of patch files #995
Conversation
/azp run azure-sdk-tools - sync - eng-common |
Azure Pipelines could not run because the pipeline triggers exclude this branch/path. |
36c5911
to
1fb6800
Compare
175e264
to
4d3c6a9
Compare
e0fed5e
to
f2a383e
Compare
4b159e0
to
8d4ccba
Compare
echo "##vso[task.setvariable variable=HasChanges]$false" | ||
foreach ($file in (Get-ChildItem $(PatchFilesLocation))) | ||
{ | ||
$results += git -c user.name="azure-sdk" -c user.email="azuresdk@microsoft.com" am $file.FullName |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't you still check the lastExitCode after each invoke of git am?
{ | ||
$results += git -c user.name="azure-sdk" -c user.email="azuresdk@microsoft.com" am $file.FullName | ||
} | ||
if (($results.Count -eq (Get-ChildItem $(PatchFilesLocation))) -and ($LASTEXITCODE -eq 0)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(Get-ChildItem $(PatchFilesLocation))
that doesn't return a count does it?
foreach ($file in (Get-ChildItem $(PatchFilesLocation))) | ||
{ | ||
$results += git -c user.name="azure-sdk" -c user.email="azuresdk@microsoft.com" am $file.FullName | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
foreach ($file in (Get-ChildItem $(PatchFilesLocation))) | |
{ | |
$results += git -c user.name="azure-sdk" -c user.email="azuresdk@microsoft.com" am $file.FullName | |
} | |
$shaBeforePatches = git ref-parse --short HEAD | |
foreach ($file in (Get-ChildItem $(PatchFilesLocation)*.patch)) | |
{ | |
git -c user.name="azure-sdk" -c user.email="azuresdk@microsoft.com" am -3 $file.FullName | |
if ($lastExitCode -ne 0) { | |
git am --show-current-patch=diff | |
# Once we hit one conflict that causes the patch to fail we should fail the pipeline until that | |
# gets addressed. | |
Write-Error "##vso[task.LogIssue type=warning;]Failed to properly apply patch files to [https://github.com/azure/${{ repo }}]" | |
exit 1 | |
} | |
} | |
$shaAfterPatches = git ref-parse --short HEAD | |
$hasChanges = $shaBeforePatches -ne $shaAfterPatches | |
echo "##vso[task.setvariable variable=HasChanges]$hasChanges" |
9d4ef32
to
a020f66
Compare
beea611
to
b470244
Compare
d138471
to
0f4036e
Compare
0f4036e
to
e790cb3
Compare
Am closing this since the changes have been incorporated in #1052 |
@chidozieononiwu please also go and close the sync PRs. |
For pull request triggered runs of the sync pipeline. Rather that copying over all the files in the Sync directory make use of a patch file to apply only the changes associated with the latest commits.