Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sync eng/common directory with azure-sdk-tools for PR 1685 #1779

Merged
merged 1 commit into from
Jun 10, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions eng/common/scripts/ChangeLog-Operations.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,14 @@ function Get-ChangeLogEntriesFromContent {
return $null
}

$changelogEntry = $null
$sectionName = $null
$changeLogEntries = [Ordered]@{}
try {
# walk the document, finding where the version specifiers are and creating lists
foreach ($line in $changeLogContent) {
if ($line -match $RELEASE_TITLE_REGEX) {
$changeLogEntry = [pscustomobject]@{
$changeLogEntry = [pscustomobject]@{
ReleaseVersion = $matches["version"]
ReleaseStatus = $matches["releaseStatus"]
ReleaseTitle = "## {0} {1}" -f $matches["version"], $matches["releaseStatus"]
Expand Down Expand Up @@ -72,8 +74,8 @@ function Get-ChangeLogEntriesFromContent {
}
}
catch {
Write-Host "Error parsing Changelog."
Write-Host $_.Exception.Message
Write-Error "Error parsing Changelog."
Write-Error $_
}
return $changeLogEntries
}
Expand Down Expand Up @@ -208,7 +210,7 @@ function New-ChangeLogEntry {
return $null
}

if (!$Content) {
if (!$Content) {
$Content = @()
$Content += ""
$Content += "### Features Added"
Expand All @@ -222,7 +224,7 @@ function New-ChangeLogEntry {
$Content += ""
}

$newChangeLogEntry = [pscustomobject]@{
$newChangeLogEntry = [pscustomobject]@{
ReleaseVersion = $Version
ReleaseStatus = $Status
ReleaseTitle = "## $Version $Status"
Expand Down
9 changes: 5 additions & 4 deletions eng/common/scripts/Update-ChangeLog.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ param (
[String]$ChangelogPath,
[String]$ReleaseDate
)
Set-StrictMode -Version 3

. (Join-Path $PSScriptRoot common.ps1)

Expand All @@ -39,11 +40,11 @@ if ($ReleaseDate)
exit 1
}
}
elseif ($Unreleased)
elseif ($Unreleased)
{
$ReleaseStatus = $CHANGELOG_UNRELEASED_STATUS
}
else
else
{
$ReleaseStatus = "$(Get-Date -Format $CHANGELOG_DATE_FORMAT)"
$ReleaseStatus = "($ReleaseStatus)"
Expand All @@ -61,7 +62,7 @@ if ([string]::IsNullOrEmpty($ChangelogPath))
$ChangelogPath = $pkgProperties.ChangeLogPath
}

if (!(Test-Path $ChangelogPath))
if (!(Test-Path $ChangelogPath))
{
LogError "Changelog path [$ChangelogPath] is invalid."
exit 1
Expand Down Expand Up @@ -103,7 +104,7 @@ if ($LatestsSorted[0] -ne $Version) {
LogWarning "Version [$Version] is older than the latestversion [$LatestVersion] in the changelog. Consider using a more recent version."
}

if ($ReplaceLatestEntryTitle)
if ($ReplaceLatestEntryTitle)
{
$newChangeLogEntry = New-ChangeLogEntry -Version $Version -Status $ReleaseStatus -Content $ChangeLogEntries[$LatestVersion].ReleaseContent
LogDebug "Resetting latest entry title to [$($newChangeLogEntry.ReleaseTitle)]"
Expand Down
3 changes: 2 additions & 1 deletion eng/common/scripts/Verify-ChangeLog.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@ param (
[string]$ServiceDirectory,
[boolean]$ForRelease = $False
)
Set-StrictMode -Version 3

. (Join-Path $PSScriptRoot common.ps1)

$validChangeLog = $false
if ($ChangeLogLocation -and $VersionString)
if ($ChangeLogLocation -and $VersionString)
{
$validChangeLog = Confirm-ChangeLogEntry -ChangeLogLocation $ChangeLogLocation -VersionString $VersionString -ForRelease $ForRelease
}
Expand Down