Skip to content

Commit fab2e0c

Browse files
azure-powershell-botazurepowershell
andauthored
Sync tools folder from main branch to generation branch (#23776)
Co-authored-by: azurepowershell <[email protected]>
1 parent fc6d21f commit fab2e0c

File tree

5 files changed

+605
-7
lines changed

5 files changed

+605
-7
lines changed

src/Az.Shared.props

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
<GenerateAssemblyTitleAttribute>false</GenerateAssemblyTitleAttribute>
1717
<GenerateAssemblyVersionAttribute>false</GenerateAssemblyVersionAttribute>
1818
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
19+
<!-- Suppress known NuGet package vulnerabilities to unblock build as we track this kind of security issues internally. -->
20+
<WarningsNotAsErrors>NU1901;NU1902;NU1903;NU1904</WarningsNotAsErrors>
1921
<WarningsAsErrors />
2022
</PropertyGroup>
2123

tools/RunVersionController.ps1

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -164,10 +164,10 @@ function Update-ChangeLog
164164
[Parameter(Mandatory = $true)]
165165
[string[]]$Content,
166166
[Parameter(Mandatory = $true)]
167-
[string]$RootPath
167+
[string]$FilePath
168168
)
169169

170-
$ChangeLogFile = Get-Item -Path "$RootPath\ChangeLog.md"
170+
$ChangeLogFile = Get-Item -Path $FilePath
171171
$ChangeLogContent = Get-Content -Path $ChangeLogFile.FullName
172172
($Content + $ChangeLogContent) | Set-Content -Path $ChangeLogFile.FullName -Encoding UTF8
173173
}
@@ -295,7 +295,7 @@ function Bump-AzVersion
295295
}
296296

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

300300
New-CommandMappingFile
301301

@@ -392,8 +392,26 @@ function Update-AzPreviewChangelog
392392
$changeLog += "#### $updatedModule $($moduleMetadata.ModuleVersion)"
393393
$changeLog += $moduleReleaseNotes + "`n"
394394
}
395-
Update-ChangeLog -Content $changeLog -RootPath $rootPath/tools/AzPreview
395+
Update-ChangeLog -Content $changeLog -FilePath "$rootPath/tools/AzPreview/ChangeLog.md"
396+
}
396397

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

399417
function New-CommandMappingFile
@@ -502,6 +520,7 @@ switch ($PSCmdlet.ParameterSetName)
502520
# Refresh AzPreview.psd1
503521
Update-AzPreview
504522
Update-AzPreviewChangelog
523+
Update-AzSyntaxChangelog
505524
# We need to generate the upcoming-breaking-changes.md after the process of bump version in minor release
506525
if ([PSVersion]::MINOR -Eq $versionBump)
507526
{
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Text;
5+
using System.Threading.Tasks;
6+
7+
namespace VersionController.Netcore.Models
8+
{
9+
public enum ChangeType
10+
{
11+
CmdletAdd,
12+
CmdletRemove,
13+
CmdletSupportsShouldProcessChange,
14+
CmdletSupportsPagingChange,
15+
AliasAdd,
16+
AliasRemove,
17+
ParameterAdd,
18+
ParameterRemove,
19+
ParameterAliasAdd,
20+
ParameterAliasRemove,
21+
ParameterTypeChange,
22+
ParameterAttributeChange,
23+
ParameterSetAdd,
24+
ParameterSetRemove,
25+
ParameterSetAttributePropertyChange,
26+
OutputTypeChange
27+
}
28+
public class CmdletDiffInformation
29+
{
30+
public string ModuleName { get; set; }
31+
public string CmdletName { get; set; }
32+
public ChangeType Type { get; set; }
33+
public string ParameterSetName { get; set; }
34+
public string ParameterName { get; set; }
35+
public List<string> Before { get; set; }
36+
public List<string> After { get; set; }
37+
public string PropertyName { get; set; }
38+
}
39+
}

0 commit comments

Comments
 (0)