Skip to content
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

Filter out Breaking changes info and return in automation result #46860

Merged
merged 3 commits into from
Nov 1, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions eng/scripts/automation/GenerateAndBuildLib.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -747,6 +747,7 @@ function GeneratePackage()
$artifacts = @()
$apiViewArtifact = ""
$hasBreakingChange = $false
$breakingChangeItems = @()
$content = ""
$result = "succeeded"
$isGenerateSuccess = $true
Expand Down Expand Up @@ -856,8 +857,15 @@ function GeneratePackage()
$hasBreakingChange = $false
}
else {
$logFile = Get-Content -Path $logFilePath | select-object -skip 2
$breakingChanges = $logFile -join ",`n"
Write-Host "Breaking changes detected in the build log."
$logFile = Get-Content -Path $logFilePath | select-object -SkipLast 1
$regex = "error( ?):( ?)(?<breakingChange>.*) .*\["
foreach ($line in $logFile) {
if ($line -match $regex) {
$breakingChangeItems += $matches["breakingChange"]
}
}
$breakingChanges = $breakingChangeItems -join ",`n"
$content = "Breaking Changes: $breakingChanges"
$hasBreakingChange = $true
}
Expand All @@ -871,6 +879,7 @@ function GeneratePackage()
$changelog = [PSCustomObject]@{
content = $content
hasBreakingChange = $hasBreakingChange
breakingChangeItems = $breakingChangeItems
}

$ciFilePath = "sdk/$service/ci.yml"
Expand Down