Skip to content

Commit cede8dc

Browse files
Sync eng/common directory with azure-sdk-tools for PR 1633 (Azure#15610)
* Update format of new Changelog Entry * Add parsing of changelog sections * Update ChangeLog Logic Co-authored-by: Chidozie Ononiwu <chononiw@microsoft.com>
1 parent cc8bdaf commit cede8dc

File tree

1 file changed

+27
-2
lines changed

1 file changed

+27
-2
lines changed

eng/common/scripts/ChangeLog-Operations.ps1

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,19 +40,32 @@ function Get-ChangeLogEntriesFromContent {
4040
$changeLogEntries = [Ordered]@{}
4141
try {
4242
# walk the document, finding where the version specifiers are and creating lists
43-
$changeLogEntry = $null
4443
foreach ($line in $changeLogContent) {
4544
if ($line -match $RELEASE_TITLE_REGEX) {
4645
$changeLogEntry = [pscustomobject]@{
4746
ReleaseVersion = $matches["version"]
4847
ReleaseStatus = $matches["releaseStatus"]
4948
ReleaseTitle = "## {0} {1}" -f $matches["version"], $matches["releaseStatus"]
5049
ReleaseContent = @()
50+
Sections = @{}
5151
}
5252
$changeLogEntries[$changeLogEntry.ReleaseVersion] = $changeLogEntry
5353
}
5454
else {
5555
if ($changeLogEntry) {
56+
if ($line.Trim() -match "^###\s(?<sectionName>.*)")
57+
{
58+
$sectionName = $matches["sectionName"].Trim()
59+
$changeLogEntry.Sections[$sectionName] = @()
60+
$changeLogEntry.ReleaseContent += $line
61+
continue
62+
}
63+
64+
if ($sectionName)
65+
{
66+
$changeLogEntry.Sections[$sectionName] += $line
67+
}
68+
5669
$changeLogEntry.ReleaseContent += $line
5770
}
5871
}
@@ -195,7 +208,19 @@ function New-ChangeLogEntry {
195208
return $null
196209
}
197210

198-
if (!$Content) { $Content = @() }
211+
if (!$Content) {
212+
$Content = @()
213+
$Content += ""
214+
$Content += "### Features Added"
215+
$Content += ""
216+
$Content += "### Breaking Changes"
217+
$Content += ""
218+
$Content += "### Key Bugs Fixed"
219+
$Content += ""
220+
$Content += "### Fixed"
221+
$Content += ""
222+
$Content += ""
223+
}
199224

200225
$newChangeLogEntry = [pscustomobject]@{
201226
ReleaseVersion = $Version

0 commit comments

Comments
 (0)