From 90d05b0ecf870b7f6a8fe9a72cb4bcbe5f160588 Mon Sep 17 00:00:00 2001 From: azurepowershell Date: Thu, 4 Jan 2024 09:00:17 +0000 Subject: [PATCH] Sync tools folder from main branch to generation branch --- .azure-pipelines/code-gen.yml | 58 +++++++++++-------------- .azure-pipelines/code-oob.yml | 12 +++-- .github/policies/resourceManagement.yml | 23 ++++++++-- 3 files changed, 55 insertions(+), 38 deletions(-) diff --git a/.azure-pipelines/code-gen.yml b/.azure-pipelines/code-gen.yml index 122cd6c8a480..e29ae3ad5daf 100644 --- a/.azure-pipelines/code-gen.yml +++ b/.azure-pipelines/code-gen.yml @@ -75,36 +75,30 @@ jobs: } git checkout src/${{ parameters.ServiceName }}; git checkout -b codegen/${{ parameters.ServiceName }} origin/${{ parameters.TargetBranch }}; - - task: PowerShell@2.232.1 + - pwsh: | + #Uninstall-Module -Name PackageManagement -AllVersions + Install-Module -Name PowerShellGet -RequiredVersion 2.2.3 -Force; + Install-Module -Name platyPS -RequiredVersion 0.14.2 -Force; + Install-Module -Name Az.Accounts -Force; + Import-Module .\tools\Gen2Master\MoveFromGeneration2Master.ps1; + Move-Generation2Master -SourcePath .\artifacts\src\${{ parameters.ServiceName }} -DestPath .\src\${{ parameters.ServiceName }}; + git config user.email "65331932+azure-powershell-bot@users.noreply.github.com"; + git config user.name "azure-powershell-bot"; + git add ./src; + git add tools/CreateMappings_rules.json; + git commit -m "Move ${{ parameters.ServiceName }} to ${{ parameters.TargetBranch }}"; + git remote set-url origin https://azure-powershell-bot:$(GithubToken)@github.com/Azure/azure-powershell.git; + git push origin codegen/${{ parameters.ServiceName }} --force; displayName: Create codegen/${{ parameters.ServiceName }} branch - inputs: - targetType: inline - script: >- - #Uninstall-Module -Name PackageManagement -AllVersions - Install-Module -Name PowerShellGet -RequiredVersion 2.2.3 -Force; - Install-Module -Name platyPS -RequiredVersion 0.14.2 -Force; - Install-Module -Name Az.Accounts -Force; - Import-Module .\tools\Gen2Master\MoveFromGeneration2Master.ps1; - Move-Generation2Master -SourcePath .\artifacts\src\${{ parameters.ServiceName }} -DestPath .\src\${{ parameters.ServiceName }}; - git config user.email "65331932+azure-powershell-bot@users.noreply.github.com"; - git config user.name "azure-powershell-bot"; - git add ./src; - git add tools/CreateMappings_rules.json; - git commit -m "Move ${{ parameters.ServiceName }} to ${{ parameters.TargetBranch }}"; - git remote set-url origin https://azure-powershell-bot:$(GithubToken)@github.com/Azure/azure-powershell.git; - git push origin codegen/${{ parameters.ServiceName }} --force; - - task: PowerShell@2 - displayName: Create PR to main branch - inputs: - targetType: inline - script: >- - $SourceBranch = "$(Build.SourceBranch)" - $SourceBranch = $SourceBranch.Replace("refs/heads/", "") - $Title = "Migrate ${{ parameters.ServiceName }} from $SourceBranch to ${{ parameters.TargetBranch }}" - $HeadBranch = "codegen/${{ parameters.ServiceName }}" - $BaseBranch = "${{ parameters.TargetBranch }}" - $Description = "Migrate ${{ parameters.ServiceName }} from $SourceBranch to ${{ parameters.TargetBranch }} - The last commit of src/${{ parameters.ServiceName }} in $SourceBranch is: - $(git log -1 origin/$SourceBranch -- ./src/${{ parameters.ServiceName }}) - " - ./tools/Github/CreatePR.ps1 -Title $Title -HeadBranch $HeadBranch -BaseBranch $BaseBranch -BotAccessToken $(GithubToken) -Description $Description + - pwsh: | + $SourceBranch = "$(Build.SourceBranch)" + $SourceBranch = $SourceBranch.Replace("refs/heads/", "") + $Title = "Migrate ${{ parameters.ServiceName }} from $SourceBranch to ${{ parameters.TargetBranch }}" + $HeadBranch = "codegen/${{ parameters.ServiceName }}" + $BaseBranch = "${{ parameters.TargetBranch }}" + $Description = "Migrate ${{ parameters.ServiceName }} from $SourceBranch to ${{ parameters.TargetBranch }} + The last commit of src/${{ parameters.ServiceName }} in $SourceBranch is: + $(git log -1 origin/$SourceBranch -- ./src/${{ parameters.ServiceName }}) + " + ./tools/Github/CreatePR.ps1 -Title $Title -HeadBranch $HeadBranch -BaseBranch $BaseBranch -BotAccessToken $(GithubToken) -Description $Description + displayName: Create PR to main branch \ No newline at end of file diff --git a/.azure-pipelines/code-oob.yml b/.azure-pipelines/code-oob.yml index 6013e13cdf12..87a819541a16 100644 --- a/.azure-pipelines/code-oob.yml +++ b/.azure-pipelines/code-oob.yml @@ -74,7 +74,7 @@ stages: `````` - Install the latest Az.Accounts module unless the OOB build requires a specific version. ``````powershell - Install-Module Az.Accounts -Repository PSGallery + Install-Module Az.Accounts -Repository PSGallery `````` - Use Az.Tools.Installer to install the OOB build. ``````powershell @@ -118,7 +118,6 @@ stages: displayName: Create PR to main branch condition: and(succeeded(), eq(variables['NeedBumpUp'], 'true')) - - task: PowerShell@2 displayName: publish oob tools inputs: @@ -127,6 +126,13 @@ stages: Copy-Item .\tools\ModulePublisher.psd1 -Destination OOB Copy-Item .\tools\ModulePublisher.psm1 -Destination OOB Copy-Item .\tools\NuGet.exe -Destination OOB + + - task: ManifestGeneratorTask@0 + displayName: 'Generation Task' + inputs: + PackageName: 'Azure PowerShell - ${{ parameters.ServiceName }}' + BuildDropPath: '$(System.ArtifactsDirectory)/OOB' + - task: PublishBuildArtifacts@1 inputs: PathtoPublish: OOB @@ -172,4 +178,4 @@ stages: $moduleName = $jsonObject.ModuleName $context = New-AzStorageContext -StorageAccountName "$(TestStorageAccountName)" $package = Get-Item "$(System.ArtifactsDirectory)/artifacts/Az.$moduleName.$versionNumber.nupkg" - $package | Set-AzStorageBlobContent -Container "public" -Context $context -Force \ No newline at end of file + $package | Set-AzStorageBlobContent -Container "public" -Context $context -Force diff --git a/.github/policies/resourceManagement.yml b/.github/policies/resourceManagement.yml index 5eac96cb9373..c4f48ff965e1 100644 --- a/.github/policies/resourceManagement.yml +++ b/.github/policies/resourceManagement.yml @@ -2861,7 +2861,9 @@ configuration: then: - mentionUsers: mentionees: - - fwsuppgithub + - gopimsft + - gimotwanMSFT + - avripintoms replyTemplate: Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc ${mentionees}. assignMentionees: False - if: @@ -3028,6 +3030,22 @@ configuration: - vpngwsuppgithub replyTemplate: Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc ${mentionees}. assignMentionees: False + - if: + - or: + - labelAdded: + label: Service Attention + - labelAdded: + label: Nginx + - hasLabel: + label: Service Attention + - hasLabel: + label: Nginx + then: + - mentionUsers: + mentionees: + - limingu + replyTemplate: Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc ${mentionees}. + assignMentionees: False - if: - or: - labelAdded: @@ -3175,8 +3193,7 @@ configuration: then: - mentionUsers: mentionees: - - pvrk - - adityabalaji-msft + - Daya-Patil replyTemplate: Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc ${mentionees}. assignMentionees: False - if: