From fd550f122b83a2addcba310d01baa6c5285cdc04 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 96866ba8f210..d2d513db530c 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 1b2a1d263903d18e2291f86c7f2eb4442138e8e0 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 d2d513db530c..6a161c1b4df9 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 } }