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 repository #12269

Merged
merged 1 commit into from
Jun 30, 2020
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
4 changes: 2 additions & 2 deletions eng/common/pipelines/templates/steps/verify-changelog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ parameters:
steps:
- task: Powershell@2
inputs:
filePath: /eng/common/scripts/Verify-ChangeLog.ps1
filePath: $(Build.SourcesDirectory)/eng/common/scripts/Verify-ChangeLog.ps1
arguments: >
-PackageName ${{ parameters.PackageName }}
-ServiceName ${{ parameters.ServiceName }}
-RepoRoot $(Build.SourcesDirectory)
-RepoName $(Build.Repository.Name)
-ForRelease ${{ parameters.ForRelease }}
-ForRelease $${{ parameters.ForRelease }}
pwsh: true
workingDirectory: $(Pipeline.Workspace)
displayName: Verify ChangeLog / Release Notes
Expand Down
2 changes: 1 addition & 1 deletion eng/common/scripts/Verify-ChangeLog.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ if ([System.String]::IsNullOrEmpty($Language))
}

$PackageProp = Get-PkgProperties -PackageName $PackageName -ServiceName $ServiceName -Language $Language -RepoRoot $RepoRoot
Confirm-ChangeLog -ChangeLogLocation $PackageProp.pkgChangeLogPath -VersionString $PackageProp.pkgReadMePath -ForRelease $ForRelease
Confirm-ChangeLogEntry -ChangeLogLocation $PackageProp.pkgChangeLogPath -VersionString $PackageProp.pkgVersion -ForRelease $ForRelease
11 changes: 6 additions & 5 deletions eng/common/scripts/modules/ChangeLog-Operations.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -85,29 +85,30 @@ function Confirm-ChangeLogEntry {
[boolean]$ForRelease = $false
)

$changeLogEntries = Get-ChangeLogEntry -ChangeLogLocation $ChangeLogLocation -VersionString $VersionString
$changeLogEntry = Get-ChangeLogEntry -ChangeLogLocation $ChangeLogLocation -VersionString $VersionString

if ([System.String]::IsNullOrEmpty($changeLogEntries.ReleaseStatus)) {
if ([System.String]::IsNullOrEmpty($changeLogEntry.ReleaseStatus)) {
Write-Host ("##[error]Changelog '{0}' has wrong release note title" -f $ChangeLogLocation)
Write-Host "##[info]Ensure the release date is included i.e. (yyyy-MM-dd) or (Unreleased) if not yet released"
exit 1
}

if ($ForRelease -eq $True) {
$CurrentDate = Get-Date -Format "yyyy-MM-dd"
if ($changeLogEntries.ReleaseStatus -ne "($CurrentDate)") {
if ($changeLogEntry.ReleaseStatus -ne "($CurrentDate)") {
Write-Host ("##[warning]Incorrect Date: Please use the current date in the Changelog '{0}' before releasing the package" -f $ChangeLogLocation)
exit 1
}

if ([System.String]::IsNullOrWhiteSpace($changeLogEntries.ReleaseContent)) {
if ([System.String]::IsNullOrWhiteSpace($changeLogEntry.ReleaseContent)) {
Write-Host ("##[error]Empty Release Notes for '{0}' in '{1}'" -f $VersionString, $ChangeLogLocation)
Write-Host "##[info]Please ensure there is a release notes entry before releasing the package."
exit 1
}
}

Write-Host ($changeLogEntries | Format-Table | Out-String)
Write-Host $changeLogEntry.ReleaseTitle
Write-Host $changeLogEntry.ReleaseContent
}

Export-ModuleMember -Function 'Get-ChangeLogEntries'
Expand Down