Skip to content
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
2 changes: 2 additions & 0 deletions src/Az.Shared.props
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
<GenerateAssemblyTitleAttribute>false</GenerateAssemblyTitleAttribute>
<GenerateAssemblyVersionAttribute>false</GenerateAssemblyVersionAttribute>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<!-- Suppress known NuGet package vulnerabilities to unblock build as we track this kind of security issues internally. -->
<WarningsNotAsErrors>NU1901;NU1902;NU1903;NU1904</WarningsNotAsErrors>
<WarningsAsErrors />
</PropertyGroup>

Expand Down
27 changes: 23 additions & 4 deletions tools/RunVersionController.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -164,10 +164,10 @@ function Update-ChangeLog
[Parameter(Mandatory = $true)]
[string[]]$Content,
[Parameter(Mandatory = $true)]
[string]$RootPath
[string]$FilePath
)

$ChangeLogFile = Get-Item -Path "$RootPath\ChangeLog.md"
$ChangeLogFile = Get-Item -Path $FilePath
$ChangeLogContent = Get-Content -Path $ChangeLogFile.FullName
($Content + $ChangeLogContent) | Set-Content -Path $ChangeLogFile.FullName -Encoding UTF8
}
Expand Down Expand Up @@ -295,7 +295,7 @@ function Bump-AzVersion
}

Update-ModuleManifest -Path "$PSScriptRoot\Az\Az.psd1" -ModuleVersion $newVersion -ReleaseNotes $releaseNotes
Update-ChangeLog -Content $changeLog -RootPath $rootPath
Update-ChangeLog -Content $changeLog -FilePath "$rootPath\ChangeLog.md"

New-CommandMappingFile

Expand Down Expand Up @@ -392,8 +392,26 @@ function Update-AzPreviewChangelog
$changeLog += "#### $updatedModule $($moduleMetadata.ModuleVersion)"
$changeLog += $moduleReleaseNotes + "`n"
}
Update-ChangeLog -Content $changeLog -RootPath $rootPath/tools/AzPreview
Update-ChangeLog -Content $changeLog -FilePath "$rootPath/tools/AzPreview/ChangeLog.md"
}

function Update-AzSyntaxChangelog
{
Write-Host "starting revise SyntaxChangelog"
$rootPath = "$PSScriptRoot\.."
$NewVersion = (Import-PowerShellDataFile "$PSScriptRoot\Az\Az.psd1").ModuleVersion
Update-ChangeLog -Content "## $NewVersion - $Release" -FilePath "$rootPath\documentation\SyntaxChangelog.md"
$changeLog = Get-Content "$rootPath\documentation\SyntaxChangelog.md" -Raw
$regex = '####\s+(Az\.\w+)\s+(?![\d\.])'
$matches = Select-String -Pattern $regex -InputObject $changelog -AllMatches
foreach ($match in $matches.Matches) {
$moduleName = $match.Groups[1].Value
$moduleMetadata = Get-ModuleMetadata -Module $moduleName -RootPath $rootPath
$newVersion = $moduleMetadata.ModuleVersion
$replacement = "#### $moduleName $newVersion `r`n"
$changelog = $changelog -replace [regex]::Escape($match.Value), $replacement
}
Set-Content -Path "$rootPath\documentation\SyntaxChangelog.md" -Value $changelog
}

function New-CommandMappingFile
Expand Down Expand Up @@ -502,6 +520,7 @@ switch ($PSCmdlet.ParameterSetName)
# Refresh AzPreview.psd1
Update-AzPreview
Update-AzPreviewChangelog
Update-AzSyntaxChangelog
# We need to generate the upcoming-breaking-changes.md after the process of bump version in minor release
if ([PSVersion]::MINOR -Eq $versionBump)
{
Expand Down
39 changes: 39 additions & 0 deletions tools/VersionController/Models/CmdletDiffInfomation.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace VersionController.Netcore.Models
{
public enum ChangeType
{
CmdletAdd,
CmdletRemove,
CmdletSupportsShouldProcessChange,
CmdletSupportsPagingChange,
AliasAdd,
AliasRemove,
ParameterAdd,
ParameterRemove,
ParameterAliasAdd,
ParameterAliasRemove,
ParameterTypeChange,
ParameterAttributeChange,
ParameterSetAdd,
ParameterSetRemove,
ParameterSetAttributePropertyChange,
OutputTypeChange
}
public class CmdletDiffInformation
{
public string ModuleName { get; set; }
public string CmdletName { get; set; }
public ChangeType Type { get; set; }
public string ParameterSetName { get; set; }
public string ParameterName { get; set; }
public List<string> Before { get; set; }
public List<string> After { get; set; }
public string PropertyName { get; set; }
}
}
Loading