From 5366a2469cbd1f68c7a2888e7f979c9e40d81f3b Mon Sep 17 00:00:00 2001 From: Chidozie Ononiwu Date: Thu, 10 Jun 2021 13:18:46 -0700 Subject: [PATCH 1/2] Add verification of changelog sections --- eng/common/scripts/ChangeLog-Operations.ps1 | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/eng/common/scripts/ChangeLog-Operations.ps1 b/eng/common/scripts/ChangeLog-Operations.ps1 index 96866ba8f2..d2d513db53 100644 --- a/eng/common/scripts/ChangeLog-Operations.ps1 +++ b/eng/common/scripts/ChangeLog-Operations.ps1 @@ -175,6 +175,22 @@ function Confirm-ChangeLogEntry { LogError "Entry has no content. Please ensure to provide some content of what changed in this version." return $false } + + $emptySections = @() + foreach ($key in $changeLogEntry.Sections.Keys) + { + $sectionContent = $changeLogEntry.Sections[$key] + if ([System.String]::IsNullOrWhiteSpace(($sectionContent | Out-String))) + { + $emptySections += $key + } + } + if ($emptySections.Count -gt 0) + { + LogError "Entry has empty changelog section(s) shown below. Please make sure there are no empty changelog section." + Write-Host ($emptySections -Join ", ") + return $false + } } return $true } From 7487afe91b7ce5b6e1c4e35f113105be743e4005 Mon Sep 17 00:00:00 2001 From: Chidozie Ononiwu <31145988+chidozieononiwu@users.noreply.github.com> Date: Tue, 15 Jun 2021 13:45:19 -0700 Subject: [PATCH 2/2] Update eng/common/scripts/ChangeLog-Operations.ps1 Co-authored-by: Wes Haggard --- eng/common/scripts/ChangeLog-Operations.ps1 | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/eng/common/scripts/ChangeLog-Operations.ps1 b/eng/common/scripts/ChangeLog-Operations.ps1 index d2d513db53..6a161c1b4d 100644 --- a/eng/common/scripts/ChangeLog-Operations.ps1 +++ b/eng/common/scripts/ChangeLog-Operations.ps1 @@ -187,8 +187,7 @@ function Confirm-ChangeLogEntry { } if ($emptySections.Count -gt 0) { - LogError "Entry has empty changelog section(s) shown below. Please make sure there are no empty changelog section." - Write-Host ($emptySections -Join ", ") + LogError "The changelog entry has the following sections with no content ($($emptySections -join ', ')). Please ensure to either remove the empty sections or add content to the section." return $false } }