From 1028d93d5df828cd1dc8a270cc1adb1782e6c432 Mon Sep 17 00:00:00 2001 From: Chidozie Ononiwu <31145988+chidozieononiwu@users.noreply.github.com> Date: Tue, 8 Jun 2021 12:13:51 -0700 Subject: [PATCH] Update format of new Changelog Entry (#1633) Update changelog entry to match updated guidance https://azure.github.io/azure-sdk/policies_releases.html#change-logs New Changelog entries will now look like ``` # Release History ## 1.15.0 (Unreleased) ### Features Added ### Breaking Changes ### Key Bugs Fixed ### Fixed ## 1.15.0-beta.1 (Unreleased) ### Features Added - Types to represent `GeoJson` primitives. ``` --- eng/common/scripts/ChangeLog-Operations.ps1 | 29 +++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/eng/common/scripts/ChangeLog-Operations.ps1 b/eng/common/scripts/ChangeLog-Operations.ps1 index 972e91616cd..98769dcd9eb 100644 --- a/eng/common/scripts/ChangeLog-Operations.ps1 +++ b/eng/common/scripts/ChangeLog-Operations.ps1 @@ -40,7 +40,6 @@ function Get-ChangeLogEntriesFromContent { $changeLogEntries = [Ordered]@{} try { # walk the document, finding where the version specifiers are and creating lists - $changeLogEntry = $null foreach ($line in $changeLogContent) { if ($line -match $RELEASE_TITLE_REGEX) { $changeLogEntry = [pscustomobject]@{ @@ -48,11 +47,25 @@ function Get-ChangeLogEntriesFromContent { ReleaseStatus = $matches["releaseStatus"] ReleaseTitle = "## {0} {1}" -f $matches["version"], $matches["releaseStatus"] ReleaseContent = @() + Sections = @{} } $changeLogEntries[$changeLogEntry.ReleaseVersion] = $changeLogEntry } else { if ($changeLogEntry) { + if ($line.Trim() -match "^###\s(?.*)") + { + $sectionName = $matches["sectionName"].Trim() + $changeLogEntry.Sections[$sectionName] = @() + $changeLogEntry.ReleaseContent += $line + continue + } + + if ($sectionName) + { + $changeLogEntry.Sections[$sectionName] += $line + } + $changeLogEntry.ReleaseContent += $line } } @@ -195,7 +208,19 @@ function New-ChangeLogEntry { return $null } - if (!$Content) { $Content = @() } + if (!$Content) { + $Content = @() + $Content += "" + $Content += "### Features Added" + $Content += "" + $Content += "### Breaking Changes" + $Content += "" + $Content += "### Key Bugs Fixed" + $Content += "" + $Content += "### Fixed" + $Content += "" + $Content += "" + } $newChangeLogEntry = [pscustomobject]@{ ReleaseVersion = $Version