Skip to content

Commit 38b318d

Browse files
authored
Merge pull request #22465 from yifanz7/mergestoragepreview
[Do Not Squash][Az.Storage] Merge latest changes from main to Az.Storage-preview
2 parents d90b53d + 4a2b95e commit 38b318d

File tree

5,343 files changed

+857184
-328497
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

5,343 files changed

+857184
-328497
lines changed

.azure-pipelines/code-oob.yml

Lines changed: 52 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
11
parameters:
2-
- name: TargetBranch
3-
displayName: Branch this module will generated to
4-
type: string
5-
default: main
62
- name: ServiceName
7-
displayName: Service to OOB release
3+
displayName: OOB release Service
84
type: string
95
default: Databricks
106
- name: Preview
11-
displayName: Is preview version
7+
displayName: Is preview version? (version is "x.y.z-preview" or major version is 0)
128
type: boolean
139
default: false
10+
variables:
11+
BumpUpBranch: none
1412
stages:
1513
- stage: OOBRelease
1614
displayName: OOBRelease
1715
jobs:
18-
- job: OOBRelease
16+
- job: BumpUpVersion
1917
timeoutInMinutes: 180
2018
pool: pool-windows-2019
19+
variables:
20+
NeedBumpUp: true
2121
steps:
2222
- task: DotNetCoreCLI@2
2323
displayName: Build
@@ -28,43 +28,26 @@ stages:
2828
- pwsh: |
2929
.\tools\RunVersionController.ps1 -ModuleName "Az.${{ parameters.ServiceName }}”
3030
displayName: 'Bump up version'
31-
- task: AzurePowerShell@5
32-
inputs:
33-
azureSubscription: '$(AzureSubscription)'
34-
ScriptType: 'InlineScript'
35-
azurePowerShellVersion: 'LatestVersion'
36-
inline: |
37-
Set-AzContext -Tenant $(TenantId) -SubscriptionId $(SubscriptionId)
38-
$Token = Get-AzKeyVaultSecret -VaultName $(KeyVaultName) -Name $(KeyVaultAccount) -AsPlainText
39-
git config user.email "[email protected]"
40-
git config user.name "azure-powershell-bot"
41-
git checkout -b codeoob/${{ parameters.ServiceName }}
42-
git add -A
43-
if (${{ parameters.Preview }} -eq $true) {
44-
git reset -- ./tools/Tools.Common/SerializedCmdlets/Az.${{ parameters.ServiceName }}.json
45-
}
46-
git commit -m "Bump up version for ${{ parameters.ServiceName }}"
47-
git remote set-url origin https://azure-powershell-bot:[email protected]/Azure/azure-powershell.git;
48-
git push origin codeoob/${{ parameters.ServiceName }} --force;
49-
$Title = "Migrate ${{ parameters.ServiceName }} from oob to main"
50-
$HeadBranch = "codeoob/${{ parameters.ServiceName }}"
51-
$BaseBranch = "${{ parameters.TargetBranch }}"
52-
$Description = "Migrate ${{ parameters.ServiceName }} from oob to ${{parameters.TargetBranch}}"
53-
./tools/Github/CreatePR.ps1 -Title $Title -HeadBranch $HeadBranch -BaseBranch $BaseBranch -BotAccessToken $Token -Description $Description -Draft $true
54-
displayName: Create PR to main branch
5531
- task: PowerShell@2
5632
displayName: get changelog info
33+
name: outputinfo
5734
inputs:
5835
targetType: 'inline'
5936
script: |
6037
$readme = Get-ChildItem -Path "./src/${{ parameters.ServiceName }}" -name ChangeLog.md -Recurse
6138
$mdContent = Get-Content -Path "src/${{ parameters.ServiceName }}/$readme" -Raw
6239
$pattern = '(?s)## Version (\d+\.\d+\.\d)+[\s\S]*?\n(.*?)(?=\n## Version \d+\.\d+\.\d+|$)'
6340
$matches = [regex]::Match($mdcontent, $pattern)
41+
$NeedBumpUp = $true
6442
if ($matches.Success) {
6543
$versionNumber = $matches.Groups[1].Value
6644
$versionChanges = $matches.Groups[2].Value.Trim()
6745
}
46+
if ($${{ parameters.Preview }} -and ([version]$versionNumber -ge [version]"1.0.0")) {
47+
$versionNumber += "-preview"
48+
echo "##vso[task.setvariable variable=NeedBumpUp]false"
49+
$NeedBumpUp = $false
50+
}
6851
$jsonData = @{
6952
ModuleName = "${{ parameters.ServiceName }}"
7053
VersionNumber = "$versionNumber"
@@ -99,6 +82,40 @@ stages:
9982
$readmePath = "OOB/README.md"
10083
$content | Out-File -FilePath $readmePath
10184
85+
if ($NeedBumpUp) {
86+
echo "##vso[task.setvariable variable=BumpUpBranch;isOutput=true]$(BranchPrefix)/${{ parameters.ServiceName }}"
87+
88+
} else {
89+
echo "##vso[task.setvariable variable=BumpUpBranch;isOutput=true]none"
90+
}
91+
- task: AzurePowerShell@5
92+
inputs:
93+
azureSubscription: '$(AzureSubscription)'
94+
ScriptType: 'InlineScript'
95+
azurePowerShellVersion: 'LatestVersion'
96+
inline: |
97+
Set-AzContext -Tenant $(TenantId) -SubscriptionId $(SubscriptionId)
98+
$Token = Get-AzKeyVaultSecret -VaultName $(KeyVaultName) -Name $(KeyVaultAccount) -AsPlainText
99+
git config user.email "$(GithubEmail)"
100+
git config user.name "$(GithubUsername)"
101+
git checkout -b $(BranchPrefix)/${{ parameters.ServiceName }}
102+
git add -A ':!OOB'
103+
if ($${{ parameters.Preview }}) {
104+
git reset -- ./tools/Tools.Common/SerializedCmdlets/Az.${{ parameters.ServiceName }}.json
105+
}
106+
git commit -m "Bump up version for ${{ parameters.ServiceName }}"
107+
git remote set-url origin https://azure-powershell-bot:[email protected]/Azure/azure-powershell.git;
108+
git push origin $(BranchPrefix)/${{ parameters.ServiceName }} --force;
109+
$Title = "${{ parameters.ServiceName }} OOB Release"
110+
$HeadBranch = "$(BranchPrefix)/${{ parameters.ServiceName }}"
111+
$BaseBranch = "$(Build.SourceBranch)"
112+
$BaseBranch = $BaseBranch.Replace("refs/heads/", "")
113+
$Description = "${{ parameters.ServiceName }} OOB Release"
114+
./tools/Github/CreatePR.ps1 -Title $Title -HeadBranch $HeadBranch -BaseBranch $BaseBranch -BotAccessToken $Token -Description $Description -Draft $true
115+
displayName: Create PR to main branch
116+
condition: and(succeeded(), eq(variables['NeedBumpUp'], 'true'))
117+
118+
102119
- task: PowerShell@2
103120
displayName: publish oob tools
104121
inputs:
@@ -112,11 +129,13 @@ stages:
112129
PathtoPublish: OOB
113130
ArtifactName: OOB
114131
- stage: Codesign
132+
variables:
133+
BumpUpBranch: $[stageDependencies.OOBRelease.BumpUpVersion.outputs['outputinfo.BumpUpBranch']]
115134
dependsOn: OOBRelease
116135
jobs:
117136
- template: ./code-sign.yml
118137
parameters:
119-
OOBBranch: codeoob/${{ parameters.ServiceName }}
138+
OOBBranch: $(BumpUpBranch)
120139
- job: PulishForTest
121140
dependsOn: Release
122141
steps:
@@ -148,7 +167,4 @@ stages:
148167
$moduleName = $jsonObject.ModuleName
149168
$context = New-AzStorageContext -StorageAccountName "$(TestStorageAccountName)"
150169
$package = Get-Item "$(System.ArtifactsDirectory)/artifacts/Az.$moduleName.$versionNumber.nupkg"
151-
$package | Set-AzStorageBlobContent -Container "public" -Context $context -Force
152-
153-
154-
170+
$package | Set-AzStorageBlobContent -Container "public" -Context $context -Force

.azure-pipelines/code-sign.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,11 @@ jobs:
1717
inputs:
1818
targetType: 'inline'
1919
script: |
20-
git remote set-url origin https://azure-powershell-bot:[email protected]/Azure/azure-powershell.git;
21-
git fetch origin
22-
git checkout -b ${{ parameters.OOBBranch }} origin/${{ parameters.OOBBranch }}
23-
condition: and(succeeded(), ne('${{ parameters.OOBBranch }}', 'none'))
20+
if ('${{ parameters.OOBBranch }}' -ne 'none') {
21+
git remote set-url origin https://azure-powershell-bot:[email protected]/Azure/azure-powershell.git;
22+
git fetch origin
23+
git checkout -b ${{ parameters.OOBBranch }} origin/${{ parameters.OOBBranch }}
24+
}
2425
- pwsh: 'Install-Module platyPS -Force -Confirm:$false -Scope CurrentUser'
2526
displayName: 'Install platyPS'
2627

.github/CODEOWNERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# To make sure Network PRs go to the right branch, e.g. network-april
2-
/src/Network/ @MikhailTryakhov @htippanaboya
2+
/src/Network/ @Joanna-Yang-Art @htippanaboya
33
/src/Compute/ @bilaakpan-ms @sandido @haagha @grizzlytheodore
44
/src/PolicyInsights/ @pilor
55

.github/fabricbot.json

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1635,25 +1635,25 @@
16351635
{
16361636
"labels": [
16371637
"Service Attention",
1638-
"Consumption- RIandShowBack"
1638+
"Consumption - Billing"
16391639
],
16401640
"mentionees": [
1641-
"ccmshowbackdevs"
1641+
"ccmbpxpcrew"
16421642
]
16431643
},
16441644
{
16451645
"labels": [
16461646
"Service Attention",
1647-
"Consumption-Billing"
1647+
"Consumption - Budget"
16481648
],
16491649
"mentionees": [
1650-
"ccmbpxpcrew"
1650+
"ccmaxpcrew"
16511651
]
16521652
},
16531653
{
16541654
"labels": [
16551655
"Service Attention",
1656-
"Consumption-Budget"
1656+
"Consumption - Consumption"
16571657
],
16581658
"mentionees": [
16591659
"ccmaxpcrew"
@@ -1662,28 +1662,28 @@
16621662
{
16631663
"labels": [
16641664
"Service Attention",
1665-
"Consumption-Consumption"
1665+
"Consumption - Query"
16661666
],
16671667
"mentionees": [
1668-
"ccmaxpcrew"
1668+
"ccmixpdevs"
16691669
]
16701670
},
16711671
{
16721672
"labels": [
16731673
"Service Attention",
1674-
"Consumption-Query"
1674+
"Consumption - UsageDetailsandExport"
16751675
],
16761676
"mentionees": [
1677-
"ccmixpdevs"
1677+
"TiagoCrewGitHubIssues"
16781678
]
16791679
},
16801680
{
16811681
"labels": [
16821682
"Service Attention",
1683-
"Consumption-UsageDetailsandExport"
1683+
"Consumption- RIandShowBack"
16841684
],
16851685
"mentionees": [
1686-
"TiagoCrewGitHubIssues"
1686+
"ccmshowbackdevs"
16871687
]
16881688
},
16891689
{
@@ -1751,7 +1751,7 @@
17511751
{
17521752
"labels": [
17531753
"Service Attention",
1754-
"Cost Management-Billing"
1754+
"Cost Management - Billing"
17551755
],
17561756
"mentionees": [
17571757
"ccmbpxpcrew"
@@ -1760,7 +1760,7 @@
17601760
{
17611761
"labels": [
17621762
"Service Attention",
1763-
"Cost Management-Budget"
1763+
"Cost Management - Budget"
17641764
],
17651765
"mentionees": [
17661766
"ccmaxpcrew"
@@ -1769,7 +1769,7 @@
17691769
{
17701770
"labels": [
17711771
"Service Attention",
1772-
"Cost Management-Query"
1772+
"Cost Management - Query"
17731773
],
17741774
"mentionees": [
17751775
"ccmixpdevs"
@@ -1778,7 +1778,7 @@
17781778
{
17791779
"labels": [
17801780
"Service Attention",
1781-
"Cost Management-RIandShowBack"
1781+
"Cost Management - RIandShowBack"
17821782
],
17831783
"mentionees": [
17841784
"ccmshowbackdevs"
@@ -1787,7 +1787,7 @@
17871787
{
17881788
"labels": [
17891789
"Service Attention",
1790-
"Cost Management-UsageDetailsAndExport"
1790+
"Cost Management - UsageDetailsAndExport"
17911791
],
17921792
"mentionees": [
17931793
"TiagoCrewGitHubIssues"
@@ -2847,7 +2847,7 @@
28472847
"Security"
28482848
],
28492849
"mentionees": [
2850-
"chlahav"
2850+
"zivraf"
28512851
]
28522852
},
28532853
{

.github/workflows/pr-labeled.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: pr-labeled
2+
run-name: Triggered by pr label
3+
env:
4+
GH_TOKEN: ${{ github.token }}
5+
PR: ${{ github.event.pull_request.html_url }}
6+
on:
7+
pull_request:
8+
types:
9+
- labeled
10+
jobs:
11+
process_labels:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v3
15+
with:
16+
sparse-checkout: |
17+
.github
18+
- name: process label
19+
shell: pwsh
20+
run: .github/workflows/script/PrLabeled.ps1 -LabelName "${{ github.event.label.name }}" -PrUrl $env:PR
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
param(
2+
[System.String]
3+
$LabelName,
4+
[System.String]
5+
$PrUrl
6+
)
7+
Write-Host "Processing PR $PrUrl with label $LabelName"
8+
9+
$CommentDict = @{
10+
"DO NOT SQUASH :no_entry_sign:" = @"
11+
‼️ Please merge this PR with commits! You can enable this option in the setting page.
12+
‼️ Remember close that option after merging this PR!
13+
"@
14+
"Do Not Merge :no_entry_sign:" = @"
15+
‼️ DO NOT MERGE THIS PR ‼️
16+
"@
17+
"Breaking Change Release" = @"
18+
To PR author,
19+
This PR was labeled "Breaking Change Release" because it contains breaking changes.
20+
According to our [policy](https://eng.ms/docs/cloud-ai-platform/azure-core/azure-management-and-platforms/control-plane-bburns/azure-cli-tools-azure-cli-powershell-and-terraform/azure-cli-tools/devguide/azps/breaking-change/breaking-changes-policy), breaking changes can only take place during major release and must be preannounced.
21+
Please follow our [guide](https://eng.ms/docs/cloud-ai-platform/azure-core/azure-management-and-platforms/control-plane-bburns/azure-cli-tools-azure-cli-powershell-and-terraform/azure-cli-tools/devguide/azps/breaking-change/breaking-changes-process) on the detailed steps.
22+
"@
23+
"needs-revision" = @"
24+
This PR was labeled "needs-revision" because it has unresolved review comments or CI failures.
25+
Please resolve all open review comments and make sure all CI checks are green. Refer to our guide (link TBD) to troubleshoot common CI failures.
26+
"@
27+
}
28+
29+
30+
function Test-LabelCommentIsAlreadyAdded {
31+
param(
32+
[System.String]
33+
$Comment,
34+
[System.String]
35+
$PrUrl
36+
)
37+
$existingComments = (gh pr view $PrUrl --json comments | ConvertFrom-Json).comments | Where-Object { $_.body -eq $comment }
38+
if ($existingComments.Count -gt 0) {
39+
return $true
40+
}
41+
return $false
42+
}
43+
44+
function Get-Comment {
45+
param(
46+
[System.String]
47+
$LabelName
48+
)
49+
if ($CommentDict.ContainsKey($LabelName)) {
50+
return $CommentDict[$LabelName]
51+
}
52+
return $null
53+
}
54+
55+
if ($CommentDict.ContainsKey($LabelName)) {
56+
$comment = Get-Comment -LabelName $LabelName
57+
Write-Host "Try to add comment: $comment"
58+
$isCommentAlreadyAdded = Test-LabelCommentIsAlreadyAdded -Comment $comment -PrUrl $PrUrl
59+
if ($isCommentAlreadyAdded) {
60+
Write-Host "Comment is already added"
61+
}
62+
else {
63+
gh pr comment $PrUrl --body $comment
64+
}
65+
}

0 commit comments

Comments
 (0)