diff --git a/eng/common/scripts/ChangeLog-Operations.ps1 b/eng/common/scripts/ChangeLog-Operations.ps1 index 43dba5d74e6f..316369d9090d 100644 --- a/eng/common/scripts/ChangeLog-Operations.ps1 +++ b/eng/common/scripts/ChangeLog-Operations.ps1 @@ -2,7 +2,7 @@ . "${PSScriptRoot}\logging.ps1" . "${PSScriptRoot}\SemVer.ps1" -$RELEASE_TITLE_REGEX = "(?^\#+.*(?\b\d+\.\d+\.\d+([^0-9\s][^\s:]+)?)(\s+(?\(Unreleased\)|\(\d{4}-\d{2}-\d{2}\)))?)" +$RELEASE_TITLE_REGEX = "(?^\#+.*(?\b\d+\.\d+\.\d+([^0-9\s][^\s:]+)?)(\s+(?\(.*\)))?)" $CHANGELOG_UNRELEASED_STATUS = "(Unreleased)" $CHANGELOG_DATE_FORMAT = "yyyy-MM-dd" @@ -13,7 +13,7 @@ function Get-ChangeLogEntries { [String]$ChangeLogLocation ) - $changeLogEntries = @{} + $changeLogEntries = [Ordered]@{} if (!(Test-Path $ChangeLogLocation)) { LogError "ChangeLog[${ChangeLogLocation}] does not exist" return $null @@ -57,7 +57,7 @@ function Get-ChangeLogEntry { ) $changeLogEntries = Get-ChangeLogEntries -ChangeLogLocation $ChangeLogLocation - if ($changeLogEntries -and $changeLogEntries.ContainsKey($VersionString)) { + if ($changeLogEntries -and $changeLogEntries.Contains($VersionString)) { return $changeLogEntries[$VersionString] } return $null diff --git a/eng/common/scripts/SemVer.ps1 b/eng/common/scripts/SemVer.ps1 index 4e804e765e8d..11af926010ea 100644 --- a/eng/common/scripts/SemVer.ps1 +++ b/eng/common/scripts/SemVer.ps1 @@ -181,7 +181,7 @@ class AzureEngSemanticVersion { { $versions = $versionStrings | ForEach-Object { [AzureEngSemanticVersion]::ParseVersionString($_) } $sortedVersions = [AzureEngSemanticVersion]::SortVersions($versions) - return ($sortedVersions | ForEach-Object { $_.ToString() }) + return ($sortedVersions | ForEach-Object { $_.RawVersion }) } static [AzureEngSemanticVersion[]] SortVersions([AzureEngSemanticVersion[]] $versions) diff --git a/eng/common/scripts/Update-ChangeLog.ps1 b/eng/common/scripts/Update-ChangeLog.ps1 index 8f7c88e51cd2..75628a7449ff 100644 --- a/eng/common/scripts/Update-ChangeLog.ps1 +++ b/eng/common/scripts/Update-ChangeLog.ps1 @@ -89,8 +89,7 @@ LogDebug "The latest release note entry in the changelog is for version [$($Late $LatestsSorted = [AzureEngSemanticVersion]::SortVersionStrings(@($LatestVersion, $Version)) if ($LatestsSorted[0] -ne $Version) { - LogWarning "Version [$Version] is older than the latestversion [$LatestVersion] in the changelog. Please use a more recent version." - exit(0) + LogWarning "Version [$Version] is older than the latestversion [$LatestVersion] in the changelog. Consider using a more recent version." } if ($ReplaceLatestEntryTitle) @@ -99,7 +98,7 @@ if ($ReplaceLatestEntryTitle) LogDebug "Resetting latest entry title to [$($newChangeLogEntry.ReleaseTitle)]" $ChangeLogEntries.Remove($LatestVersion) if ($newChangeLogEntry) { - $ChangeLogEntries[$Version] = $newChangeLogEntry + $ChangeLogEntries.Insert(0, $Version, $newChangeLogEntry) } else { LogError "Failed to create new changelog entry" @@ -117,7 +116,7 @@ else LogDebug "Adding new ChangeLog entry for Version [$Version]" $newChangeLogEntry = New-ChangeLogEntry -Version $Version -Status $ReleaseStatus if ($newChangeLogEntry) { - $ChangeLogEntries[$Version] = $newChangeLogEntry + $ChangeLogEntries.Insert(0, $Version, $newChangeLogEntry) } else { LogError "Failed to create new changelog entry"