Skip to content

Commit

Permalink
Enable ChangeLog verification (#13130)
Browse files Browse the repository at this point in the history
* enable changelog verification on the pipeline

* Enable Local ChangeLog Verification
  • Loading branch information
chidozieononiwu committed Jul 1, 2020
1 parent 7cebfa4 commit 6cfee9f
Show file tree
Hide file tree
Showing 11 changed files with 31 additions and 85 deletions.
8 changes: 2 additions & 6 deletions eng/Directory.Build.Data.targets
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,13 @@
<PropertyGroup>
<PowerShellExe Condition=" '$(PowerShellExe)'=='' ">"%ProgramFiles%\PowerShell\6\pwsh.exe"</PowerShellExe>
<PowerShellExe Condition="!Exists('$(PowerShellExe)')">pwsh</PowerShellExe>
<GetReleaseNotesScriptPath Condition=" '$(GetReleaseNotesScriptPath)'=='' ">$(MSBuildThisFileDirectory)/common/Extract-ReleaseNotes.ps1</GetReleaseNotesScriptPath>
<ValidateReleaseNotesScriptPath Condition=" '$(ValidateReleaseNotesScriptPath)'=='' ">$(MSBuildThisFileDirectory)common/scripts/Verify-ChangeLog.ps1</ValidateReleaseNotesScriptPath>
<ChangeLogPath>$([MSBuild]::NormalizeDirectory($(MSBuildProjectDirectory)/../))CHANGELOG.md</ChangeLogPath>
</PropertyGroup>
<Exec Condition="Exists('$(ChangeLogPath)')" ContinueOnError="true" ConsoleToMSBuild="true" Command="$(PowerShellExe) -NonInteractive -executionpolicy Unrestricted -File $(GetReleaseNotesScriptPath) $(ChangeLogPath) $(_VersionInProject)">
<Output TaskParameter="ConsoleOutput" ItemName="ExtractedReleaseNotesTemp" />
<Exec Condition="Exists('$(ChangeLogPath)')" ContinueOnError="true" ConsoleToMSBuild="true" Command="$(PowerShellExe) -NonInteractive -executionpolicy Unrestricted -File $(ValidateReleaseNotesScriptPath) -ChangeLogLocation $(ChangeLogPath) -VersionString $(_VersionInProject)">
<Output TaskParameter="ExitCode" PropertyName="SetReleaseNotesErrorCode" />
</Exec>
<Error Condition="Exists('$(ChangeLogPath)') and '$(SetReleaseNotesErrorCode)' != '0'" Text="No entry for version [$(_VersionInProject)] found in the ChangeLog [$(ChangeLogPath)]. @(ExtractedReleaseNotesTemp)" />
<ItemGroup Condition="Exists('$(ChangeLogPath)')">
<ExtractedReleaseNotes Condition="'$(SetReleaseNotesErrorCode)'=='0'" Include="@(ExtractedReleaseNotesTemp)" />
</ItemGroup>
</Target>

<!-- This allows us to build .NET Framework targets on non-windows
Expand Down
65 changes: 0 additions & 65 deletions eng/common/Extract-ReleaseNotes.ps1

This file was deleted.

24 changes: 17 additions & 7 deletions eng/common/scripts/Verify-ChangeLog.ps1
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Wrapper Script for ChangeLog Verification
param (
[Parameter(Mandatory=$true)]
[String]$ChangeLogLocation,
[String]$VersionString,
[string]$PackageName,
[Parameter(Mandatory=$true)]
[string]$ServiceName,
[string]$RepoRoot,
[ValidateSet("net","java","js","python")]
Expand All @@ -11,12 +11,22 @@ param (
[boolean]$ForRelease=$False
)

Import-Module "${PSScriptRoot}/modules/common-manifest.psd1"
. (Join-Path $PSScriptRoot SemVer.ps1)
Import-Module (Join-Path $PSScriptRoot modules ChangeLog-Operations.psm1)

if ([System.String]::IsNullOrEmpty($Language))
if ((Test-Path $ChangeLogLocation) -and -not([System.String]::IsNullOrEmpty($VersionString)))
{
$Language = $RepoName.Substring($RepoName.LastIndexOf('-') + 1)
Confirm-ChangeLogEntry -ChangeLogLocation $ChangeLogLocation -VersionString $VersionString -ForRelease $ForRelease
}
else
{
Import-Module (Join-Path $PSScriptRoot modules Package-Properties.psm1)
if ([System.String]::IsNullOrEmpty($Language))
{
$Language = $RepoName.Substring($RepoName.LastIndexOf('-') + 1)
}

$PackageProp = Get-PkgProperties -PackageName $PackageName -ServiceName $ServiceName -Language $Language -RepoRoot $RepoRoot
Confirm-ChangeLogEntry -ChangeLogLocation $PackageProp.pkgChangeLogPath -VersionString $PackageProp.pkgVersion -ForRelease $ForRelease
}

$PackageProp = Get-PkgProperties -PackageName $PackageName -ServiceName $ServiceName -Language $Language -RepoRoot $RepoRoot
Confirm-ChangeLogEntry -ChangeLogLocation $PackageProp.pkgChangeLogPath -VersionString $PackageProp.pkgVersion -ForRelease $ForRelease
5 changes: 5 additions & 0 deletions eng/pipelines/templates/stages/archetype-net-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,11 @@ stages:
deploy:
steps:
- checkout: self
- template: /eng/common/pipelines/templates/steps/verify-changelog.yml
parameters:
PackageName: ${{artifact.name}}
ServiceName: ${{parameters.ServiceDirectory}}
ForRelease: true
- template: /eng/pipelines/templates/steps/stage-artifacts.yml
parameters:
SourceFolder: ${{parameters.ArtifactName}}-signed
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Release History

## 1.0.0-preview.1
## 1.0.0-preview.1 (Unreleased)

### New features

Expand Down
2 changes: 1 addition & 1 deletion sdk/search/Microsoft.Azure.Search/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Every minor version release targets the same (GA) REST API version as that of th

Features and improvements in a GA SDK are considered generally available.

## 10.1.0
## 10.1.0 (2019-10-29)

### Breaking Changes

Expand Down
2 changes: 1 addition & 1 deletion sdk/testcommon/Azure.Graph.Rbac/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Release History

## 1.0.0-preview.1
## 1.0.0-preview.1 (Unreleased)

### New Features
- For API version with tag 1.6
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Release History

## 1.0.0-preview.1
## 1.0.0-preview.1 (Unreleased)

### New Features
- Initial preview of Azure Management SDK based on Azure.Core
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Release History

## 1.0.0-preview.1
## 1.0.0-preview.1 (Unreleased)

### New Features
- Initial preview of Azure Management SDK based on Azure.Core
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Release History

## 0.1.6-preview.1
## 0.1.6-preview.1 (Unreleased)

### New Features
- For API version 2017-05-10
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Release History

## 1.0.0-preview.1
## 1.0.0-preview.1 (Unreleased)

### New Features
- Initial preview of Azure Management SDK based on Azure.Core

0 comments on commit 6cfee9f

Please sign in to comment.