Use .diff instead of csv for sdk content diffs

This commit is contained in:
Jackson Schuster 2024-03-06 13:37:06 -08:00
parent 60c0a7e489
commit 6ca4c6f0d2
2 changed files with 17 additions and 6 deletions

View file

@ -208,7 +208,7 @@ jobs:
exit 1
fi
displayName: Setup Previously Source-Built SDK
- ${{ if eq(parameters.targetOS, 'windows') }}:
- script: |
call $(sourcesPath)\build.cmd -ci -cleanWhileBuilding -prepareMachine ${{ parameters.extraProperties }}
@ -305,7 +305,7 @@ jobs:
for envVar in $customEnvVars; do
customDockerRunArgs="$customDockerRunArgs -e $envVar"
done
if [[ '${{ parameters.runOnline }}' == 'False' ]]; then
customDockerRunArgs="$customDockerRunArgs --network none"
fi
@ -342,10 +342,10 @@ jobs:
# Don't use CopyFiles@2 as it encounters permissions issues because it indexes all files in the source directory graph.
- powershell: |
function CopyWithRelativeFolders($sourcePath, $targetFolder, $filter) {
Get-ChildItem -Path $sourcePath -Filter $filter -Recurse | ForEach-Object {
Get-ChildItem -Path $sourcePath -Filter $filter -Recurse | ForEach-Object {
$targetPath = Join-Path $targetFolder (Resolve-Path -Relative $_.FullName)
New-Item -ItemType Directory -Path (Split-Path -Parent $targetPath) -Force | Out-Null
Copy-Item $_.FullName -Destination $targetPath -Force
Copy-Item $_.FullName -Destination $targetPath -Force
}
}
@ -356,6 +356,7 @@ jobs:
CopyWithRelativeFolders "artifacts/" $targetFolder "*.binlog"
CopyWithRelativeFolders "artifacts/" $targetFolder "*.log"
CopyWithRelativeFolders "artifacts/" $targetFolder "*.diff"
CopyWithRelativeFolders "src/" $targetFolder "*.binlog"
CopyWithRelativeFolders "src/" $targetFolder "*.log"
CopyWithRelativeFolders "test/" $targetFolder "*.binlog"
@ -382,6 +383,7 @@ jobs:
cd "$(sourcesPath)"
find artifacts/ -type f -name "*.binlog" -exec rsync -R {} -t ${targetFolder} \;
find artifacts/ -type f -name "*.log" -exec rsync -R {} -t ${targetFolder} \;
find artifacts/ -type f -name "*.diff" -exec rsync -R {} -t ${targetFolder} \;
if [[ "${{ parameters.buildSourceOnly }}" == "True" ]]; then
find artifacts/prebuilt-report/ -exec rsync -R {} -t ${targetFolder} \;
fi

View file

@ -34,13 +34,22 @@
<ItemGroup>
<_changedFiles Include="@(_ContentDifferences)" Condition="'%(_contentDifferences.Kind)' != 'Unchanged'" />
<_sdkFilesDiff Include="@(_ContentDifferences)" Condition="'%(_contentDifferences.Kind)' == 'Added'" >
<DiffIndicator>+</DiffIndicator>
</_sdkFilesDiff>
<_sdkFilesDiff Include="@(_ContentDifferences)" Condition="'%(_contentDifferences.Kind)' == 'Removed'" >
<DiffIndicator>-</DiffIndicator>
</_sdkFilesDiff>
<_sdkFilesDiff Include="@(_ContentDifferences)" Condition="'%(_contentDifferences.Kind)' == 'Unchanged'" >
<DiffIndicator> </DiffIndicator>
</_sdkFilesDiff>
</ItemGroup>
<PropertyGroup>
<SdkArchiveDiffsReport>$(ArtifactsLogDir)SdkArchiveDiffs.csv</SdkArchiveDiffsReport>
<SdkArchiveDiffsReport>$(ArtifactsLogDir)SdkArchiveContent.diff</SdkArchiveDiffsReport>
</PropertyGroup>
<WriteLinesToFile File="$(SdkArchiveDiffsReport)" Lines="%(_ContentDifference.Kind), %(_ContentDifferences.Identity)" Overwrite="true" WriteOnlyWhenDifferent="true" />
<WriteLinesToFile File="$(SdkArchiveDiffsReport)" Lines="%(_sdkFilesDiff.DiffIndicator) %(_sdkFilesDiff.Identity)" Overwrite="true" WriteOnlyWhenDifferent="true" />
<Message Text="Difference in sdk archive: %(_changedFiles.Kind): %(_changedFiles.Identity)"
Importance="High"