Skip to content

Commit e1ba710

Browse files
Fixed merge conflict
2 parents dd281cd + 0f22721 commit e1ba710

File tree

9,536 files changed

+1469238
-96864
lines changed

Some content is hidden

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

9,536 files changed

+1469238
-96864
lines changed

.azure-pipelines/code-gen.yml

Lines changed: 130 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,130 @@
1+
# Variable 'BotAccessToken' was defined in the Variables tab
2+
# Multi-job configuration must be converted to matrix strategy: https://docs.microsoft.com/en-us/azure/devops/pipelines/process/phases?view=azure-devops&tabs=yaml#multi-job-configuration
3+
parameters:
4+
- name: TargetBranch
5+
displayName: Branch this module will generated to
6+
type: string
7+
default: main
8+
- name: ServiceName
9+
displayName: Service to generate
10+
type: string
11+
default: null
12+
13+
resources:
14+
repositories:
15+
- repository: self
16+
type: git
17+
ref: refs/heads/generation
18+
jobs:
19+
- job: Job_1
20+
displayName: "Service: ${{ parameters.ServiceName }}"
21+
timeoutInMinutes: 90
22+
pool:
23+
name: pool-windows-2019
24+
steps:
25+
- checkout: self
26+
- task: NodeTool@0
27+
displayName: Use Node 14.15.5
28+
inputs:
29+
versionSpec: 14.15.5
30+
- task: Npm@1
31+
displayName: Install autorest
32+
inputs:
33+
command: custom
34+
verbose: false
35+
customCommand: install -g autorest@latest
36+
- task: PowerShell@2
37+
displayName: Generate
38+
inputs:
39+
targetType: inline
40+
script: >-
41+
$subModuleFolders = Get-ChildItem -Directory -Filter *.Autorest;
42+
43+
if ($subModuleFolders -eq $null) {
44+
autorest --max-memory-size=8192;
45+
} else {
46+
$subModuleFolders | foreach-object { cd $_.FullName; autorest --max-memory-size=8192};
47+
}
48+
workingDirectory: src/${{ parameters.ServiceName }}
49+
50+
- task: PowerShell@2
51+
displayName: Build
52+
inputs:
53+
targetType: inline
54+
script: >-
55+
$subModuleFolders = Get-ChildItem -Directory -Filter *.Autorest;
56+
57+
if ($subModuleFolders -eq $null) {
58+
./build-module.ps1;
59+
} else {
60+
$subModuleFolders | foreach-object { cd $_.FullName; ./build-module.ps1; cd ..}
61+
}
62+
63+
mkdir ../../artifacts/src/${{ parameters.ServiceName }};
64+
65+
cp -r ./* ../../artifacts/src/${{ parameters.ServiceName }};
66+
pwsh: true
67+
workingDirectory: src/${{ parameters.ServiceName }}
68+
- task: PowerShell@2
69+
displayName: Checkout main branch
70+
inputs:
71+
targetType: inline
72+
script: >-
73+
if ((Test-Path src/${{ parameters.ServiceName }}))
74+
{
75+
rm -r src/${{ parameters.ServiceName }};
76+
}
77+
git checkout src/${{ parameters.ServiceName }};
78+
git checkout -b codegen/${{ parameters.ServiceName }} origin/${{ parameters.TargetBranch }};
79+
- pwsh: |
80+
#Uninstall-Module -Name PackageManagement -AllVersions
81+
Install-Module -Name PowerShellGet -RequiredVersion 2.2.3 -Force;
82+
Install-Module -Name platyPS -RequiredVersion 0.14.2 -Force;
83+
Install-Module -Name Az.Accounts -Force;
84+
Import-Module .\tools\Gen2Master\MoveFromGeneration2Master.ps1;
85+
$subModuleFolders = Get-ChildItem .\artifacts\src\${{ parameters.ServiceName }} -Directory -Filter *.Autorest;
86+
if ($subModuleFolders -eq $null) {
87+
Move-Generation2Master -SourcePath .\artifacts\src\${{ parameters.ServiceName }} -DestPath .\src\${{ parameters.ServiceName }};
88+
} else {
89+
Move-Generation2MasterHybrid -SourcePath .\artifacts\src\${{ parameters.ServiceName }} -DestPath .\src\${{ parameters.ServiceName }};
90+
}
91+
git config user.email "[email protected]";
92+
git config user.name "azure-powershell-bot";
93+
git add ./src;
94+
git add tools/CreateMappings_rules.json;
95+
git commit -m "Move ${{ parameters.ServiceName }} to ${{ parameters.TargetBranch }}";
96+
git remote set-url origin https://azure-powershell-bot:$(BotAccessToken)@github.com/Azure/azure-powershell.git;
97+
git push origin codegen/${{ parameters.ServiceName }} --force;
98+
displayName: Create codegen/${{ parameters.ServiceName }} branch
99+
- pwsh: |
100+
$Headers = @{"Accept" = "application/vnd.github+json"; "Authorization" = "Bearer $(BotAccessToken)"}
101+
$PrBody = @'
102+
<!-- DO NOT DELETE THIS TEMPLATE -->
103+
104+
## Description
105+
106+
<!-- Please add a brief description of the changes made in this PR. If you have an ongoing or finished cmdlet design, please paste the link below. -->
107+
108+
## Checklist
109+
110+
- [x] Check this box to confirm: **I have read the [_Submitting Changes_](../blob/main/CONTRIBUTING.md#submitting-changes) section of [`CONTRIBUTING.md`](../blob/main/CONTRIBUTING.md) and reviewed the following information:**
111+
112+
* **SHOULD** select appropriate branch. Cmdlets from Autorest.PowerShell should go to [`generation`](https://github.com/Azure/azure-powershell/tree/generation) branch.
113+
* **SHOULD** make the title of PR clear and informative, and in the present imperative tense.
114+
* **SHOULD** update `ChangeLog.md` file(s) appropriately
115+
* For any service, the `ChangeLog.md` file can be found at `src/{{SERVICE}}/{{SERVICE}}/ChangeLog.md`
116+
* A snippet outlining the change(s) made in the PR should be written under the `## Upcoming Release` header in the past tense. Add changelog in description section if PR goes into [`generation`](https://github.com/Azure/azure-powershell/tree/generation) branch.
117+
* Should **not** change `ChangeLog.md` if no new release is required, such as fixing test case only.
118+
* **SHOULD** have approved design review for the changes in [this repository](https://github.com/Azure/azure-powershell-cmdlet-review-pr) ([_Microsoft internal only_](../blob/main/CONTRIBUTING.md#onboarding)) with following situations
119+
* Create new module from scratch
120+
* Create new resource types which are not easy to conform to [Azure PowerShell Design Guidelines](../blob/main/documentation/development-docs/design-guidelines)
121+
* Create new resource type which name doesn't use module name as prefix
122+
* Have design question before implementation
123+
* **SHOULD** regenerate markdown help files if there is cmdlet API change. [Instruction](../blob/main/documentation/development-docs/help-generation.md#updating-all-markdown-files-in-a-module)
124+
* **SHOULD** have proper test coverage for changes in pull request.
125+
* **SHOULD NOT** introduce [breaking changes](../blob/main/documentation/breaking-changes/breaking-changes-definition.md) in Az minor release except preview version.
126+
* **SHOULD NOT** adjust version of module manually in pull request
127+
'@
128+
$RequestBody = @{"title" = "Migrate ${{ parameters.ServiceName }} from generation to ${{ parameters.TargetBranch }}"; "body" = $PrBody; "head" = "codegen/${{ parameters.ServiceName }}"; "base" = "${{ parameters.TargetBranch }}" }
129+
Invoke-WebRequest -Uri https://api.github.com/repos/Azure/azure-powershell/pulls -method POST -Headers $Headers -Body ($RequestBody | ConvertTo-Json)
130+
displayName: Create PR to main branch

.azure-pipelines/daily-build.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ jobs:
8383
FolderPath: 'artifacts'
8484
Pattern: |
8585
Release/**/Microsoft*Azure*PowerShell*Cmdlets*.dll
86+
Release/**/Microsoft.Azure.PowerShell.*.Sdk.dll
8687
Release/**/Az.*.private.dll
8788
Release/**/Microsoft.Azure.PowerShell.Authentication.dll
8889
Release/**/Microsoft.Azure.PowerShell.Authentication.ResourceManager.dll

.azure-pipelines/release-test.yml

Lines changed: 31 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,18 @@ parameters:
1515
displayName: Windows PowerShell Version
1616
type: string
1717
default: 5.1.14
18-
- name: ps6
19-
displayName: PowerShell 6 Version
20-
type: string
21-
default: 6.2.4
2218
- name: ps7
23-
displayName: PowerShell 7 Version
19+
displayName: PowerShell 7.0.x Version
2420
type: string
25-
default: 7.0.3
21+
default: 7.0.8
22+
- name: ps7_1
23+
displayName: PowerShell 7.1.x Version
24+
type: string
25+
default: 7.1.5
26+
- name: ps7_2
27+
displayName: PowerShell 7.2.x Version
28+
type: string
29+
default: 7.2.0
2630
- name: latest_ps
2731
displayName: PowerShell Latest Version
2832
type: string
@@ -40,15 +44,21 @@ jobs:
4044

4145
- template: util/smoke-test-steps.yml
4246
parameters:
43-
name: 'Win_PS6_2_4_SmokeTest'
47+
name: 'Win_PS7_0_X_SmokeTest'
4448
vmImage: ${{ parameters.win_image }}
45-
psVersion: ${{ parameters.ps6 }}
49+
psVersion: ${{ parameters.ps7 }}
4650

4751
- template: util/smoke-test-steps.yml
4852
parameters:
49-
name: 'Win_PS7_0_3_SmokeTest'
53+
name: 'Win_PS7_1_X_SmokeTest'
5054
vmImage: ${{ parameters.win_image }}
51-
psVersion: ${{ parameters.ps7 }}
55+
psVersion: ${{ parameters.ps7_1 }}
56+
57+
- template: util/smoke-test-steps.yml
58+
parameters:
59+
name: 'Win_PS7_2_X_SmokeTest'
60+
vmImage: ${{ parameters.win_image }}
61+
psVersion: ${{ parameters.ps7_2 }}
5262

5363
- template: util/smoke-test-steps.yml
5464
parameters:
@@ -58,33 +68,33 @@ jobs:
5868

5969
- template: util/smoke-test-steps.yml
6070
parameters:
61-
name: 'Linux_PS6_2_4_SmokeTest'
71+
name: 'Linux_PS7_0_X_SmokeTest'
6272
vmImage: ${{ parameters.linux_image }}
63-
psVersion: ${{ parameters.ps6 }}
73+
psVersion: ${{ parameters.ps7 }}
6474

6575
- template: util/smoke-test-steps.yml
6676
parameters:
67-
name: 'Linux_PS7_0_3_SmokeTest'
77+
name: 'Linux_PS7_1_X_SmokeTest'
6878
vmImage: ${{ parameters.linux_image }}
69-
psVersion: ${{ parameters.ps7 }}
79+
psVersion: ${{ parameters.ps7_1 }}
7080

7181
- template: util/smoke-test-steps.yml
7282
parameters:
73-
name: 'Linux_Latest_PS_SmokeTest'
83+
name: 'Linux_PS7_2_X_SmokeTest'
7484
vmImage: ${{ parameters.linux_image }}
75-
psVersion: ${{ parameters.latest_ps }}
85+
psVersion: ${{ parameters.ps7_2 }}
7686

7787
- template: util/smoke-test-steps.yml
7888
parameters:
79-
name: 'MacOS_PS6_2_4_SmokeTest'
80-
vmImage: ${{ parameters.macOS_image }}
81-
psVersion: ${{ parameters.ps6 }}
89+
name: 'Linux_Latest_PS_SmokeTest'
90+
vmImage: ${{ parameters.linux_image }}
91+
psVersion: ${{ parameters.latest_ps }}
8292

8393
- template: util/smoke-test-steps.yml
8494
parameters:
85-
name: 'MacOS_PS7_0_3_SmokeTest'
95+
name: 'MacOS_PS7_2_X_SmokeTest'
8696
vmImage: ${{ parameters.macOS_image }}
87-
psVersion: ${{ parameters.ps7 }}
97+
psVersion: ${{ parameters.ps7_2 }}
8898

8999
- template: util/smoke-test-steps.yml
90100
parameters:

.azure-pipelines/security-tools.yml

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
# Variable 'IsGenerateBased' was defined in the Variables tab
2+
# Variable 'NugetSecurityAnalysisWarningLevel' was defined in the Variables tab
3+
# Variable 'OCTOKITPAT' was defined in the Variables tab
4+
# Cron Schedules have been converted using UTC Time Zone and may need to be updated for your location
5+
schedules:
6+
- cron: 0 4 * * 1,2,3,4,5
7+
branches:
8+
include:
9+
- main
10+
resources:
11+
repositories:
12+
- repository: self
13+
type: git
14+
ref: refs/heads/main
15+
jobs:
16+
- job: Job_1
17+
displayName: Main
18+
timeoutInMinutes: 120
19+
pool:
20+
name: pool-windows-2019
21+
steps:
22+
- checkout: self
23+
fetchTags: false
24+
- task: PowerShell@2
25+
displayName: Install platyPS
26+
inputs:
27+
targetType: inline
28+
script: Install-Module platyPS -Force -Confirm:$false -Scope CurrentUser
29+
pwsh: true
30+
- task: NodeTool@0
31+
displayName: Install Node 14.17.1
32+
condition: eq(variables.IsGenerateBased, true)
33+
inputs:
34+
versionSpec: 14.17.1
35+
- task: PowerShell@2
36+
displayName: Install autorest
37+
condition: eq(variables.IsGenerateBased, true)
38+
inputs:
39+
targetType: inline
40+
script: npm install autorest@latest;$env:NODE_OPTIONS="--max-old-space-size=65536"
41+
- task: PowerShell@2
42+
displayName: Build
43+
inputs:
44+
targetType: inline
45+
script: dotnet msbuilc build.proj /t:"Build;GenerateHelp" /p:"PullRequestNumber=$(System.PullRequest.PullRequestNumber);IsSecurityCheck=true"
46+
env:
47+
OCTOKITPAT: $(OCTOKITPAT)
48+
- task: securedevelopmentteam.vss-secure-development-tools.build-task-credscan.CredScan@2
49+
displayName: Run CredScan
50+
condition: in(variables['system.pullRequest.targetBranch'], 'generation', 'main')
51+
inputs:
52+
toolMajorVersion: V2
53+
outputFormat: sarif
54+
scanFolder: SecurityTmp
55+
suppressionsFile: tools/SecurityTools/CredScanSuppressions.json
56+
debugMode: false
57+
folderSuppression: false
58+
- task: PowerShell@2
59+
displayName: Cleanup Build
60+
inputs:
61+
targetType: inline
62+
script: ./tools/CleanupBuild.ps1
63+
pwsh: true
64+
- task: PoliCheck@1
65+
displayName: Run PoliCheck
66+
inputs:
67+
targetArgument: $(Build.SourcesDirectory)/artifacts/Debug
68+
result: $(Build.SourcesDirectory)/artifacts/result/PoliCheck.xml
69+
optionsFTPATH: tools/SecurityTools/PoliCheckFileExtensions.xml
70+
- task: PublishPipelineArtifact@0
71+
displayName: Save artifacts
72+
condition: succeededOrFailed()
73+
inputs:
74+
artifactName: artifacts
75+
targetPath: artifacts
76+
...

.azure-pipelines/util/analyze-steps.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,13 +49,17 @@ steps:
4949
command: custom
5050
custom: msbuild
5151
arguments: 'build.proj /t:GenerateHelp /p:Configuration=${{ parameters.configuration }};PullRequestNumber=$(System.PullRequest.PullRequestNumber)'
52+
env:
53+
OCTOKITPAT: $(OCTOKITPAT)
5254

5355
- task: DotNetCoreCLI@2
5456
displayName: 'Static Analysis'
5557
inputs:
5658
command: custom
5759
custom: msbuild
5860
arguments: 'build.proj /t:StaticAnalysis /p:Configuration=${{ parameters.configuration }};PullRequestNumber=$(System.PullRequest.PullRequestNumber)'
61+
env:
62+
OCTOKITPAT: $(OCTOKITPAT)
5963

6064
- template: publish-artifacts-steps.yml
6165
parameters:

.azure-pipelines/util/build-steps.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ steps:
4949
command: custom
5050
custom: msbuild
5151
arguments: 'build.proj /t:Build /p:Configuration=${{ parameters.configuration }};TestFramework=${{ parameters.testFramework }};PullRequestNumber=$(System.PullRequest.PullRequestNumber)'
52+
env:
53+
OCTOKITPAT: $(OCTOKITPAT)
5254

5355
- task: PowerShell@2
5456
displayName: Build-AzPredictor

.azure-pipelines/util/test-steps.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ steps:
3636
command: custom
3737
custom: msbuild
3838
arguments: 'build.proj /t:${{ parameters.testTarget }} /p:Configuration=${{ parameters.configuration }};TestFramework=${{ parameters.testFramework }};PullRequestNumber=$(System.PullRequest.PullRequestNumber)'
39+
env:
40+
OCTOKITPAT: $(OCTOKITPAT)
3941

4042
- powershell: |
4143
Install-Module -Name Pester -RequiredVersion 4.10.1 -Force -SkipPublisherCheck

.github/fabricbot.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2568,7 +2568,7 @@
25682568
],
25692569
"mentionees": [
25702570
"wonner",
2571-
"zesluo"
2571+
"yanjungao718"
25722572
]
25732573
},
25742574
{

NuGet.Config

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<clear />
55
<!-- Do not add any additional feeds if new packages are needed they need to come from nuget.org or our azure-sdk-for-net DevOps feed -->
66
<add key="local-feed" value="tools/LocalFeed" />
7-
<add key="azure-powershell" value="https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-powershell/nuget/v3/index.json" />
7+
<add key="azure-powershell" value="https://pkgs.dev.azure.com/azclitools/public/_packaging/azure-powershell/nuget/v3/index.json" />
88
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" />
99
</packageSources>
1010
<disabledPackageSources>

0 commit comments

Comments
 (0)