Skip to content

Commit

Permalink
Update Collect ChangeLogLogic
Browse files Browse the repository at this point in the history
  • Loading branch information
chidozieononiwu committed Feb 1, 2021
1 parent b5a0df1 commit 4586f60
Showing 1 changed file with 21 additions and 6 deletions.
27 changes: 21 additions & 6 deletions eng/common/scripts/Collect-ChangeLogs.ps1
Original file line number Diff line number Diff line change
@@ -1,26 +1,41 @@
[CmdletBinding()]
param(
[Parameter(Mandatory=$true)]
[ValidateRange(1, 12)]
[int] $Month
[String] $FromDate # In the format "yyyy-MM-dd"
)

. (Join-Path $PSScriptRoot common.ps1)

$releaseHighlights = @{}

$date = Get-Date -Month $month -Format "yyyy-MM"
$date += "-\d\d"
if ($FromDate -as [DateTime])
{
$date = ([DateTime]$FromDate).ToString($CHANGELOG_DATE_FORMAT)
}
else {
LogWarning "Invalid date passed. Switch to using the current date"
$date = Get-Date -Format $CHANGELOG_DATE_FORMAT
}

$allPackageProps = Get-AllPkgProperties

foreach ($packageProp in $allPackageProps) {
$changeLogEntries = Get-ChangeLogEntries -ChangeLogLocation $packageProp.ChangeLogPath
$changeLogLocation = $packageProp.ChangeLogPath
if (!(Test-Path $changeLogLocation))
{
continue
}
$changeLogEntries = Get-ChangeLogEntries -ChangeLogLocation $changeLogLocation
$packageName = $packageProp.Name
$serviceDirectory = $packageProp.ServiceDirectory

foreach ($changeLogEntry in $changeLogEntries.Values) {
if ($changeLogEntry.ReleaseStatus -notmatch $date)
if ([System.String]::IsNullOrEmpty($changeLogEntry.ReleaseStatus))
{
continue;
}
$ReleaseStatus = $changeLogEntry.ReleaseStatus.Trim("(",")")
if (!($ReleaseStatus -as [DateTime]) -or $ReleaseStatus -lt $date)
{
continue;
}
Expand Down

0 comments on commit 4586f60

Please sign in to comment.