Skip to content

Commit 3e6013b

Browse files
committed
Merge branch 'main' into legacy-typing
2 parents f3d814b + 5c604ce commit 3e6013b

File tree

186 files changed

+42272
-3480
lines changed

Some content is hidden

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

186 files changed

+42272
-3480
lines changed

.github/CODEOWNERS

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,3 +69,9 @@
6969
/src/swift @tjprescott
7070
/src/java/apiview-java-processor @JonathanGiles
7171
/src/go @jhendrixMSFT @chlowell @RickWinter
72+
73+
74+
###########
75+
# Pylint checkers
76+
###########
77+
/tools/pylint-extensions/azure-pylint-guidelines-checker @l0lawrence

eng/common/TestResources/SubConfig-Helpers.ps1

Lines changed: 68 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,8 @@ function ShouldMarkValueAsSecret([string]$serviceName, [string]$key, [string]$va
8282
"TenantId",
8383
"TestApplicationId",
8484
"TestApplicationOid",
85-
"ProvisionerApplicationId"
85+
"ProvisionerApplicationId",
86+
"ProvisionerApplicationOid"
8687
)
8788

8889
$serviceDirectoryPrefix = BuildServiceDirectoryPrefix $serviceName
@@ -129,7 +130,7 @@ function SetSubscriptionConfiguration([object]$subscriptionConfiguration)
129130
return $subscriptionConfiguration
130131
}
131132

132-
function UpdateSubscriptionConfiguration([object]$subscriptionConfigurationBase, [object]$subscriptionConfiguration)
133+
function UpdateSubscriptionConfiguration([object]$subscriptionConfigurationBase, [object]$subscriptionConfiguration, [array]$allowedValues)
133134
{
134135
foreach ($pair in $subscriptionConfiguration.GetEnumerator()) {
135136
if ($pair.Value -is [Hashtable]) {
@@ -140,13 +141,13 @@ function UpdateSubscriptionConfiguration([object]$subscriptionConfigurationBase,
140141
# Mark values as secret so we don't print json blobs containing secrets in the logs.
141142
# Prepend underscore to the variable name, so we can still access the variable names via environment
142143
# variables if they get set subsequently.
143-
if (ShouldMarkValueAsSecret "AZURE_" $nestedPair.Name $nestedPair.Value) {
144+
if (ShouldMarkValueAsSecret "AZURE_" $nestedPair.Name $nestedPair.Value $allowedValues) {
144145
Write-Host "##vso[task.setvariable variable=_$($nestedPair.Name);issecret=true;]$($nestedPair.Value)"
145146
}
146147
$subscriptionConfigurationBase[$pair.Name][$nestedPair.Name] = $nestedPair.Value
147148
}
148149
} else {
149-
if (ShouldMarkValueAsSecret "AZURE_" $pair.Name $pair.Value) {
150+
if (ShouldMarkValueAsSecret "AZURE_" $pair.Name $pair.Value $allowedValues) {
150151
Write-Host "##vso[task.setvariable variable=_$($pair.Name);issecret=true;]$($pair.Value)"
151152
}
152153
$subscriptionConfigurationBase[$pair.Name] = $pair.Value
@@ -155,3 +156,66 @@ function UpdateSubscriptionConfiguration([object]$subscriptionConfigurationBase,
155156

156157
return $subscriptionConfigurationBase
157158
}
159+
160+
# Helper function for processing sub config files from a pipeline file list yaml parameter
161+
function UpdateSubscriptionConfigurationWithFiles([object]$baseSubConfig, [string]$fileListJson) {
162+
if (!$fileListJson) {
163+
return $baseSubConfig
164+
}
165+
166+
$finalConfig = $baseSubConfig
167+
168+
$subConfigFiles = $fileListJson | ConvertFrom-Json -AsHashtable
169+
foreach ($file in $subConfigFiles) {
170+
# In some cases, $file could be an empty string. Get-Content will fail
171+
# if $file is an empty string, so skip those cases.
172+
if (!$file) {
173+
continue
174+
}
175+
176+
Write-Host "Merging sub config from file: $file"
177+
$subConfig = Get-Content $file | ConvertFrom-Json -AsHashtable
178+
$allowedValues = @()
179+
# Since the keys are all coming from a file in github, we know every key should not be marked
180+
# as a secret. Set up these exclusions here to make pipeline log debugging easier.
181+
foreach ($pair in $subConfig.GetEnumerator()) {
182+
if ($pair.Value -is [Hashtable]) {
183+
foreach($nestedPair in $pair.Value.GetEnumerator()) {
184+
$allowedValues += $nestedPair.Name
185+
}
186+
} else {
187+
$allowedValues += $pair.Name
188+
}
189+
}
190+
$finalConfig = UpdateSubscriptionConfiguration $finalConfig $subConfig $allowedValues
191+
}
192+
193+
return $finalConfig
194+
}
195+
196+
# Helper function for processing stringified json sub configs from pipeline parameter data
197+
function BuildAndSetSubscriptionConfig([string]$baseSubConfigJson, [string]$additionalSubConfigsJson, [string]$subConfigFilesJson) {
198+
$finalConfig = @{}
199+
if ($baseSubConfigJson) {
200+
$baseSubConfig = $baseSubConfigJson | ConvertFrom-Json -AsHashtable
201+
202+
Write-Host "Setting base sub config"
203+
$finalConfig = SetSubscriptionConfiguration $baseSubConfig
204+
}
205+
206+
if ($additionalSubConfigsJson) {
207+
$subConfigs = $additionalSubConfigsJson | ConvertFrom-Json -AsHashtable
208+
209+
foreach ($subConfig in $subConfigs) {
210+
Write-Host "Merging sub config from list"
211+
$finalConfig = UpdateSubscriptionConfiguration $finalConfig $subConfig
212+
}
213+
}
214+
215+
Write-Host "Merging sub config from files"
216+
$finalConfig = UpdateSubscriptionConfigurationWithFiles $finalConfig $subConfigFilesJson
217+
218+
Write-Host ($finalConfig | ConvertTo-Json)
219+
$serialized = $finalConfig | ConvertTo-Json -Compress
220+
Write-Host "##vso[task.setvariable variable=SubscriptionConfiguration;]$serialized"
221+
}

eng/common/TestResources/build-test-resource-config.yml

Lines changed: 4 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -37,50 +37,17 @@ steps:
3737
- pwsh: |
3838
. ./eng/common/TestResources/SubConfig-Helpers.ps1
3939
40-
$finalConfig = @{}
41-
$baseSubConfigRaw = @'
40+
$baseSubConfigJson = @'
4241
${{ parameters.SubscriptionConfiguration }}
4342
'@.Trim()
44-
if ($baseSubConfigRaw) {
45-
$baseSubConfig = $baseSubConfigRaw | ConvertFrom-Json -AsHashtable
4643
47-
Write-Host "Setting base sub config"
48-
$finalConfig = SetSubscriptionConfiguration $baseSubConfig
49-
}
50-
51-
$subConfigJsonsRaw = @'
44+
$additionalSubConfigsJson = @'
5245
${{ convertToJson(parameters.SubscriptionConfigurations) }}
5346
'@.Trim() -replace '"{', '{' -replace '}"', '}'
5447
55-
if ($subConfigJsonsRaw) {
56-
$subConfigs = $subConfigJsonsRaw | ConvertFrom-Json -AsHashtable
57-
58-
foreach ($subConfig in $subConfigs) {
59-
Write-Host "Merging sub config from list"
60-
$finalConfig = UpdateSubscriptionConfiguration $finalConfig $subConfig
61-
}
62-
}
63-
64-
$subConfigFilesRaw = @'
48+
$subConfigFilesJson = @'
6549
${{ convertToJson(parameters.SubscriptionConfigurationFilePaths) }}
6650
'@.Trim()
6751
68-
if ($subConfigFilesRaw) {
69-
$subConfigFiles = $subConfigFilesRaw | ConvertFrom-Json -AsHashtable
70-
foreach ($file in $subConfigFiles) {
71-
# In some cases, $file could be an empty string. Get-Content will fail
72-
# if $file is an empty string, so skip those cases.
73-
if (!$file) {
74-
continue
75-
}
76-
77-
Write-Host "Merging sub config from file: $file"
78-
$subConfig = Get-Content $file | ConvertFrom-Json -AsHashtable
79-
$finalConfig = UpdateSubscriptionConfiguration $finalConfig $subConfig
80-
}
81-
}
82-
83-
Write-Host ($finalConfig | ConvertTo-Json)
84-
$serialized = $finalConfig | ConvertTo-Json -Compress
85-
Write-Host "##vso[task.setvariable variable=SubscriptionConfiguration;]$serialized"
52+
BuildAndSetSubscriptionConfig $baseSubConfigJson $additionalSubConfigsJson $subConfigFilesJson
8653
displayName: Merge subscription configurations
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"SubscriptionId": "44b2f395-b47b-462a-9a40-6ec719b6b910",
3+
"TenantId": "3d0a72e2-8b06-4528-98df-1391c6f12c11",
4+
"TestApplicationId": "5296eef3-d187-4e3e-bd80-7a05c38c389b",
5+
"TestApplicationSecret": "",
6+
"TestApplicationOid": "0d7672d5-e1db-42d4-a85e-add73010cfe5",
7+
"ProvisionerApplicationId": "5296eef3-d187-4e3e-bd80-7a05c38c389b",
8+
"ProvisionerApplicationSecret": "",
9+
"ProvisionerApplicationOid": "0d7672d5-e1db-42d4-a85e-add73010cfe5",
10+
"Environment": "AzureChinaCloud",
11+
"AzureSubscription": "azuresdkchina"
12+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"SubscriptionId": "23fddbc8-cb64-4b59-ba97-4c9f77c212e4",
3+
"TenantId": "72f988bf-86f1-41af-91ab-2d7cd011db47",
4+
"TestApplicationId": "f850650c-1fcf-4489-b46f-71af2e30d360",
5+
"TestApplicationSecret": "",
6+
"TestApplicationOid": "30511c9d-ba1a-4c7b-b422-5b543da11b3f",
7+
"ProvisionerApplicationId": "f850650c-1fcf-4489-b46f-71af2e30d360",
8+
"ProvisionerApplicationSecret": "",
9+
"ProvisionerApplicationOid": "30511c9d-ba1a-4c7b-b422-5b543da11b3f",
10+
"Environment": "AzureCloud",
11+
"AzureSubscription": "Azure SDK Test Resources - Preview"
12+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"SubscriptionId": "4ad9eeaf-9573-4288-8357-1445436f34cd",
3+
"TenantId": "63296244-ce2c-46d8-bc36-3e558792fbee",
4+
"TestApplicationId": "48104cb1-6c74-4857-a8b6-f44d5cf43438",
5+
"TestApplicationSecret": "",
6+
"TestApplicationOid": "431d66d1-2713-4135-a0b6-28ea5abd3411",
7+
"ProvisionerApplicationId": "48104cb1-6c74-4857-a8b6-f44d5cf43438",
8+
"ProvisionerApplicationSecret": "",
9+
"ProvisionerApplicationOid": "431d66d1-2713-4135-a0b6-28ea5abd3411",
10+
"Environment": "AzureUSGovernment",
11+
"AzureSubscription": "azuresdkgov"
12+
}

eng/common/pipelines/templates/steps/set-daily-docs-branch-name.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ parameters:
66
steps:
77
- pwsh: |
88
$branchName = $env:DAILYDOCSBRANCHNAMEOVERRIDE
9-
if (!$branchName) {
10-
$branchName = "daily/$(Get-Date -Format 'yyyy-MM-dd')"
9+
if (!$branchName) {
10+
$branchName = "daily/$(Get-Date -Format 'yyyy-MM-dd')-ignore-build"
1111
}
1212
Write-Host "Daily Branch Name: $branchName"
1313
Write-Host "##vso[task.setvariable variable=${{ parameters.DailyBranchVariableName }};]$branchName"
Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
-----BEGIN CERTIFICATE-----
2-
MIIDZzCCAk+gAwIBAgIUXjY6UxqL53TvxH8dtPNZm6/getIwDQYJKoZIhvcNAQEL
3-
BQAwFDESMBAGA1UEAwwJbG9jYWxob3N0MB4XDTIzMDcyODIxMDM1MloXDTI0MDcy
4-
NzIxMDM1MlowFDESMBAGA1UEAwwJbG9jYWxob3N0MIIBIjANBgkqhkiG9w0BAQEF
5-
AAOCAQ8AMIIBCgKCAQEAsTPe57bim6NTmBHS1ldLAr7dnMT7AMtfttfjqPzggDgR
6-
kNKj/mi5Xd86AOR6QfLMMipdL2NpPTZP557t4V1oVgODv+M3SiKRriY01TNbL9K5
7-
zjYlPDik1BzKJgHiLmHPmuKsWslTTMO86nau5YNzKfaOIFbiV5uTUCLTZh3NspDo
8-
OaIeJ4Efud/6bHQkbIXggAt2TFjVum+jMXLYeyA8ZjwFgW1ENAlOOV5Gm8eFjkIt
9-
OhQSZLlLc9BnJkOAhT0v6Xq0oRwCm0YW42+JFzmIvjK0cU/sFmjDqzKAxhtWexz7
10-
WT7KDiJU+GNsZmm8KjeU0EaQpzpK8q/MEbNRX1OqrQIDAQABo4GwMIGtMA8GA1Ud
2+
MIIDZzCCAk+gAwIBAgIUUGsnTw0cjASpYrNVxo7S41oMGtUwDQYJKoZIhvcNAQEL
3+
BQAwFDESMBAGA1UEAwwJbG9jYWxob3N0MB4XDTI0MDcyODA2NTAzOFoXDTI1MDcy
4+
ODA2NTAzOFowFDESMBAGA1UEAwwJbG9jYWxob3N0MIIBIjANBgkqhkiG9w0BAQEF
5+
AAOCAQ8AMIIBCgKCAQEAs9w2heE1VvnZcD3aR3jLgI/tiwjJScf+ljOMor9lxcIA
6+
80NvcnfH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z3xbi/4LA6QuU
16+
dZ33z44Lt4AzOiyvR7AGojytM2UYimtBBOFvi9CZuyrMC6ls4SLy6c/Rq1ATmyet
17+
QfkT1a7awC1cJUn7jeuHfly7hnYqrw+67HFY7Ajugv+Uwu6wCessKloWM127AZj/
18+
V0Gw0rblOmX+uX7fvH3BrYOkrNiHQdzCYZ1P1WU7eWm55JgBfaCrheNZ4L5TVeB2
19+
uTZPnlsBKQ23qgZ0dtcJzL0scC7zSuYI+qm1QNNyz13K+1ORXPQGQJXULlt7UeHB
20+
ZYN060pO6IO4Ti8=
2121
-----END CERTIFICATE-----
0 Bytes
Binary file not shown.

eng/common/testproxy/onboarding/generate-assets-json.ps1

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ In that case, the assets.json should live alongside the ci.yml in the sdk/<Servi
1414
1515
Generated assets.json file contents
1616
- AssetsRepo: "Azure/azure-sdk-assets" - This is the assets repository, aka where your recordings will live after this script runs.
17-
- AssetsRepoPrefixPath: "<language>" - this is will be computed from repository it's being run in.
17+
- AssetsRepoPrefixPath: "<language>" - this is will be computed from repository it's being run in.
1818
- TagPrefix: "<language>/<ServiceDirectory>" or "<language>/<ServiceDirectory>/<library>" or deeper if things
1919
are nested in such a manner. All tags created for this assets.json will start with this name.
2020
- Tag: "" - Initially empty, as nothing has yet been pushed.
@@ -81,6 +81,7 @@ $LangRecordingDirs = @{"cpp" = "recordings";
8181
. (Join-Path $PSScriptRoot "common-asset-functions.ps1")
8282

8383
Test-Exe-In-Path -ExeToLookFor $GitExe
84+
8485
$language = Get-Repo-Language
8586

8687
# If the initial push is being performed, ensure that test-proxy is
@@ -89,7 +90,7 @@ $language = Get-Repo-Language
8990
if ($InitialPush) {
9091
$proxyPresent = Test-Exe-In-Path -ExeToLookFor $TestProxyExe -ExitOnError $false
9192

92-
# try to fall back
93+
# try to fall back
9394
if (-not $proxyPresent) {
9495
$StandaloneTestProxyExe = "Azure.Sdk.Tools.TestProxy"
9596

@@ -107,6 +108,17 @@ if ($InitialPush) {
107108
Write-Error "The user has selected option InitialPush to push their assets, neither $TestProxyExe nor standalone executable $StandaloneTestProxyExe are installed on this machine."
108109
exit 1
109110
}
111+
112+
# if we're pushing, we also need to confirm that the necessary git configuration items are set
113+
$result = git config --get user.name
114+
if ($LASTEXITCODE -ne 0 -or !$result){
115+
Write-Error "The git config setting `"user.name`" is unset. Set it to your git user name via 'git config --global user.name `"<setting>`'"
116+
}
117+
118+
$result = git config --get user.email
119+
if ($LASTEXITCODE -ne 0 -or !$result){
120+
Write-Error "The git config setting `"user.email`" is unset. Set it to your git email via 'git config --global user.email `"<setting>`'"
121+
}
110122
}
111123

112124
if ($TestProxyExe -eq "test-proxy" -or $TestProxyExe.StartsWith("Azure.Sdk.Tools.TestProxy")) {

0 commit comments

Comments
 (0)