Skip to content

Commit e069da0

Browse files
azure-powershell-botazurepowershell
and
azurepowershell
authored
Sync tools folder from main branch to generation branch (#24228)
Co-authored-by: azurepowershell <azurepowershell@ms.com>
1 parent 67d6122 commit e069da0

File tree

7 files changed

+87
-24
lines changed

7 files changed

+87
-24
lines changed

.azure-pipelines/code-gen.yml

Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -75,21 +75,25 @@ jobs:
7575
}
7676
git checkout src/${{ parameters.ServiceName }};
7777
git checkout -b codegen/${{ parameters.ServiceName }} origin/${{ parameters.TargetBranch }};
78-
- pwsh: |
79-
#Uninstall-Module -Name PackageManagement -AllVersions
80-
Install-Module -Name PowerShellGet -RequiredVersion 2.2.3 -Force;
81-
Install-Module -Name platyPS -RequiredVersion 0.14.2 -Force;
82-
Install-Module -Name Az.Accounts -Force;
83-
Import-Module .\tools\Gen2Master\MoveFromGeneration2Master.ps1;
84-
Move-Generation2Master -SourcePath .\artifacts\src\${{ parameters.ServiceName }} -DestPath .\src\${{ parameters.ServiceName }};
85-
git config user.email "65331932+azure-powershell-bot@users.noreply.github.com";
86-
git config user.name "azure-powershell-bot";
87-
git add ./src;
88-
git add tools/CreateMappings_rules.json;
89-
git commit -m "Move ${{ parameters.ServiceName }} to ${{ parameters.TargetBranch }}";
90-
git remote set-url origin https://azure-powershell-bot:$(GithubToken)@github.com/Azure/azure-powershell.git;
91-
git push origin codegen/${{ parameters.ServiceName }} --force;
92-
displayName: Create codegen/${{ parameters.ServiceName }} branch
78+
- task: PowerShell@2
79+
displayName: 'Create codegen/${{ parameters.ServiceName }} branch'
80+
inputs:
81+
targetType: 'inline'
82+
script: |
83+
#Uninstall-Module -Name PackageManagement -AllVersions;
84+
Install-Module -Name PowerShellGet -RequiredVersion 2.2.3 -Force;
85+
Install-Module -Name platyPS -RequiredVersion 0.14.2 -Force;
86+
Install-Module -Name Az.Accounts -Force;
87+
Import-Module .\tools\Gen2Master\MoveFromGeneration2Master.ps1;
88+
Move-Generation2Master -SourcePath .\artifacts\src\${{ parameters.ServiceName }} -DestPath .\src\${{ parameters.ServiceName }};
89+
git config user.email "65331932+azure-powershell-bot@users.noreply.github.com";
90+
git config user.name "azure-powershell-bot";
91+
git add src;
92+
git add tools/CreateMappings_rules.json;
93+
git commit -m "Move ${{ parameters.ServiceName }} to ${{ parameters.TargetBranch }}";
94+
git remote set-url origin https://azure-powershell-bot:$(GithubToken)@github.com/Azure/azure-powershell.git;
95+
git push origin codegen/${{ parameters.ServiceName }} --force;
96+
arguments: '-RequiredPsVersion $(PSVersion)'
9397
- pwsh: |
9498
$SourceBranch = "$(Build.SourceBranch)"
9599
$SourceBranch = $SourceBranch.Replace("refs/heads/", "")
@@ -101,4 +105,4 @@ jobs:
101105
$(git log -1 origin/$SourceBranch -- ./src/${{ parameters.ServiceName }})
102106
"
103107
./tools/Github/CreatePR.ps1 -Title $Title -HeadBranch $HeadBranch -BaseBranch $BaseBranch -BotAccessToken $(GithubToken) -Description $Description
104-
displayName: Create PR to main branch
108+
displayName: Create PR to main branch

.azure-pipelines/code-sign.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ jobs:
301301
inputs:
302302
command: custom
303303
custom: msbuild
304-
arguments: 'build.proj /t:Publish /p:Configuration=Release;NuGetKey=$(NuGetKey);GenerateDocumentationFile=false'
304+
arguments: 'build.proj /t:Publish /p:Configuration=Release;NuGetKey=$(NuGetKey);GenerateDocumentationFile=false;TargetModule=${{ parameters.TargetModule }}'
305305

306306
- pwsh: |
307307
#this task won't be triggered unless $AzureStack was set to true

.github/policies/resourceManagement.yml

Lines changed: 51 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -430,6 +430,22 @@ configuration:
430430
- Azure/deployments-owners
431431
replyTemplate: Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc ${mentionees}.
432432
assignMentionees: False
433+
- if:
434+
- or:
435+
- labelAdded:
436+
label: Service Attention
437+
- labelAdded:
438+
label: arm-bicep
439+
- hasLabel:
440+
label: Service Attention
441+
- hasLabel:
442+
label: arm-bicep
443+
then:
444+
- mentionUsers:
445+
mentionees:
446+
- Azure/deployments-owners
447+
replyTemplate: Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc ${mentionees}.
448+
assignMentionees: False
433449
- if:
434450
- or:
435451
- labelAdded:
@@ -692,6 +708,22 @@ configuration:
692708
- maertendMSFT
693709
replyTemplate: Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc ${mentionees}.
694710
assignMentionees: False
711+
- if:
712+
- or:
713+
- labelAdded:
714+
label: Service Attention
715+
- labelAdded:
716+
label: CloudService
717+
- hasLabel:
718+
label: Service Attention
719+
- hasLabel:
720+
label: CloudService
721+
then:
722+
- mentionUsers:
723+
mentionees:
724+
- bberera
725+
replyTemplate: Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc ${mentionees}.
726+
assignMentionees: False
695727
- if:
696728
- or:
697729
- labelAdded:
@@ -2031,7 +2063,7 @@ configuration:
20312063
then:
20322064
- mentionUsers:
20332065
mentionees:
2034-
- Elsie4ever
2066+
- Elsie4ever,MohinderAtwal
20352067
replyTemplate: Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc ${mentionees}.
20362068
assignMentionees: False
20372069
- if:
@@ -2197,7 +2229,7 @@ configuration:
21972229
then:
21982230
- mentionUsers:
21992231
mentionees:
2200-
- varunkch (Azure Cli route to zhoxing-ms)
2232+
- RamyaElangovanP
22012233
replyTemplate: Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc ${mentionees}.
22022234
assignMentionees: False
22032235
- if:
@@ -3327,7 +3359,7 @@ configuration:
33273359
then:
33283360
- mentionUsers:
33293361
mentionees:
3330-
- chiragg4u
3362+
- venu-l
33313363
replyTemplate: Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc ${mentionees}.
33323364
assignMentionees: False
33333365
- if:
@@ -3628,6 +3660,22 @@ configuration:
36283660
- azureSQLGitHub
36293661
replyTemplate: Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc ${mentionees}.
36303662
assignMentionees: False
3663+
- if:
3664+
- or:
3665+
- labelAdded:
3666+
label: Service Attention
3667+
- labelAdded:
3668+
label: StackHCIVM
3669+
- hasLabel:
3670+
label: Service Attention
3671+
- hasLabel:
3672+
label: StackHCIVM
3673+
then:
3674+
- mentionUsers:
3675+
mentionees:
3676+
- arc-enabled-vms-on-hci Team
3677+
replyTemplate: Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc ${mentionees}.
3678+
assignMentionees: False
36313679
- if:
36323680
- or:
36333681
- labelAdded:

build.proj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@
4444
<!-- Flags -->
4545
<CodeSign Condition ="'$(CodeSign)' == ''">false</CodeSign>
4646
<SkipHelp Condition ="'$(SkipHelp)' != 'true'">false</SkipHelp>
47-
<TargetBuild Condition="Exists($(TargetModule))">true</TargetBuild>
48-
<TargetBuild Condition="!Exists($(TargetModule))">false</TargetBuild>
47+
<TargetBuild Condition="'$(TargetModule)' != ''">true</TargetBuild>
48+
<TargetBuild Condition="'$(TargetModule)' == ''">false</TargetBuild>
4949

5050

5151
<!-- Set this true only if you want to test the CodeSign workflow locally -->

tools/AzPreview/AzPreview.psd1

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ RequiredModules = @(@{ModuleName = 'Az.Accounts'; ModuleVersion = '2.15.1'; },
7676
@{ModuleName = 'Az.Cdn'; RequiredVersion = '3.1.1'; },
7777
@{ModuleName = 'Az.ChangeAnalysis'; RequiredVersion = '0.1.0'; },
7878
@{ModuleName = 'Az.CloudService'; RequiredVersion = '2.0.0'; },
79+
@{ModuleName = 'Az.CodeSigning'; RequiredVersion = '0.1.0'; },
7980
@{ModuleName = 'Az.CognitiveServices'; RequiredVersion = '1.14.1'; },
8081
@{ModuleName = 'Az.Communication'; RequiredVersion = '0.2.0'; },
8182
@{ModuleName = 'Az.Compute'; RequiredVersion = '7.1.1'; },

tools/CreateMappings_rules.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -863,5 +863,9 @@
863863
{
864864
"module": "ManagedNetworkFabric",
865865
"alias": "Managed Network Fabric"
866+
},
867+
{
868+
"module": "CodeSigning",
869+
"alias": "Code Signing"
866870
}
867871
]

tools/Gen2Master/MoveFromGeneration2Master.ps1

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,12 @@ Function Move-Generation2Master {
2424

2525
process {
2626
#Region Handle the module whoes folder is a subfolder of the module folder.
27-
$ModuleName = $SourcePath.Replace('/', '\').Split('\src\')[1].Split('\')[0]
27+
if (-not (Test-Path -Path $SourcePath)) {
28+
Write-Error "The source path $SourcePath does not exist." -ForegroundColor Red
29+
return
30+
}
31+
$SourceFolder = Get-Item -Path $SourcePath
32+
$ModuleName = $SourceFolder.Name
2833

2934
$DestParentPath = $DestPath
3035
While ("" -ne $DestParentPath) {
@@ -43,6 +48,7 @@ Function Move-Generation2Master {
4348
New-Item "$DestPath\$ModuleName\help" -ItemType Directory
4449
Update-MappingJson $ModuleName
4550
}
51+
$DestPath = (Get-Item -Path $DestPath).FullName
4652
$Dir2Copy = @{
4753
'custom' = 'custom'
4854
'examples' = 'examples'
@@ -68,7 +74,7 @@ Function Move-Generation2Master {
6874
$Psd1Metadata = Import-LocalizedData -BaseDirectory "$PSScriptRoot/Templates" -FileName "Module.psd1"
6975
}
7076
foreach ($submoduleDir in $submoduleDirs) {
71-
$psd1File = Get-ChildItem -Filter *.psd1 -File -Path $submoduleDir
77+
$psd1File = Get-ChildItem -Filter *.psd1 -File -Path $submoduleDir.FullName
7278
write-host ("psd1 file name {0}" -f $psd1File.Name)
7379
$submoduleName = $psd1File.Name.Split('.')[-2]
7480
Foreach ($Dir in $Dir2Copy.GetEnumerator()) {

0 commit comments

Comments
 (0)