Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

get master #11193

Merged
merged 68 commits into from
May 1, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
68 commits
Select commit Hold shift + click to select a range
c740ce2
[DataLake][Bug]Upload is not working with umask and permissions (#10845)
xiafu-msft Apr 22, 2020
d5508e6
Add force generation to SwaggerToSdk (#10933)
lmazuel Apr 22, 2020
fd77736
[formrecognizer] edits to docstrings (#11003)
kristapratico Apr 22, 2020
269715f
updating setup template (#11022)
Apr 23, 2020
a77ebda
[formrecognizer] handle unsupervised pages better with service bug (#…
kristapratico Apr 23, 2020
0013ab6
Increment package version after release of azure_ai_formrecognizer (#…
azure-sdk Apr 23, 2020
f3b5e44
add regular endpoint in new env variable (#11031)
iscai-msft Apr 23, 2020
2d1bd2b
Update Ubuntu VM Image to 18.04 (#11032)
scbedd Apr 23, 2020
f0c3be4
fixing merge error (#11039)
Apr 24, 2020
ace5cc1
Fixing compute test (#11036)
Apr 24, 2020
d26c102
Servicebus - Track2 - Remove timeout from Send (#11002)
KieranBrantnerMagee Apr 24, 2020
a4f47e1
rename SearchIndexClient -> SearchClient (#10964)
bryevdv Apr 24, 2020
157e7dd
Implementation for Datasources operations (#11012)
rakshith91 Apr 24, 2020
b279394
[ServiceBus] Update for readme and sample (#11047)
yunhaoling Apr 24, 2020
38d3956
Fix pip link in azure-keyvault-secrets readme (#11056)
chlowell Apr 27, 2020
94b0ea5
fixed alternative document input samples (#11078)
iscai-msft Apr 27, 2020
ce8cfad
Add sync/async samples to demonstrate consuming from a number of sess…
KieranBrantnerMagee Apr 27, 2020
91d96a8
[ServiceBus] Settle non-deferred message through receiver link (#10800)
yunhaoling Apr 27, 2020
4d431bc
Search README issues (#11082)
bryevdv Apr 27, 2020
0d910f6
Update README.md (#11084)
bryevdv Apr 27, 2020
c038e81
[ServiceBus] Remove exception from __init__.py (#11080)
yunhaoling Apr 27, 2020
6ab5359
Pin astroid to 2.3.3 to fix pylint failure (#11088)
praveenkuttappan Apr 27, 2020
e6ddd44
Lint error in cosmos (#11092)
Apr 28, 2020
102339a
Fix TYPING cycles if TYPE_CHECKING manually forced (#10799)
lmazuel Apr 28, 2020
dbcd00f
Improve mypy typing for azure core (#10653)
rakshith91 Apr 28, 2020
e51b936
Accept authority option with or without scheme (#11050)
chlowell Apr 28, 2020
d022ad0
Split Search Service Client (#11090)
bryevdv Apr 28, 2020
083d936
[text analytics] Add how to get json response to sample (#11102)
iscai-msft Apr 28, 2020
5d2b7b0
ARM default whitelist headers (#10940)
lmazuel Apr 28, 2020
5b403bf
update version (#11106)
xiangyan99 Apr 29, 2020
9c6868f
Return pageable for Search list_indexes (#11125)
bryevdv Apr 29, 2020
0953395
Adjust README with comments from the per-release doc review. (#11110)
KieranBrantnerMagee Apr 29, 2020
41488f0
[Event Hubs] add enqueueTime to Process span links (#10932)
YijunXieMS Apr 29, 2020
8de4f3c
remove formatter in samples/readme.md to prevent preview samples bein…
yunhaoling Apr 29, 2020
3b87219
[DataLake]Update ChangeLog (#11133)
xiafu-msft Apr 29, 2020
e971a44
Add capability to send multiple events in one Send() call. (#11093)
KieranBrantnerMagee Apr 29, 2020
998b4e5
Set time out to 90 mins for regression test (#11105)
praveenkuttappan Apr 29, 2020
d8b9e85
Autorest check to run tests in autorestv3 branch for core (#11131)
praveenkuttappan Apr 29, 2020
da01687
Add DeleteAfter tag to Search test resource groups (#11136)
bryevdv Apr 29, 2020
67b483f
Increment version for storage releases (#11138)
azure-sdk Apr 30, 2020
96ec2d7
[Event Hubs] `EventHubProducerClient.send_batch` accepts a list of Ev…
YijunXieMS Apr 30, 2020
6393fa4
add ServiceDirectory to usage of remove-test-resources.yml (#11117)
danieljurek Apr 30, 2020
02dfd05
resume subscriptions test (#11111)
changlong-liu Apr 30, 2020
9bbad33
Adding test for signalr (#11146)
Apr 30, 2020
8c819a4
update live tests yml + add form (#11139)
kristapratico Apr 30, 2020
c815f57
[Service Bus] Exception Handling review (#11060)
YijunXieMS Apr 30, 2020
5e293e8
[form recognizer] add repr (#11150)
iscai-msft Apr 30, 2020
bcc52fd
[ServiceBus] Support for scheduling and cancellation (#11095)
yunhaoling Apr 30, 2020
85af1b1
identity_vscode_credential (#10840)
xiangyan99 Apr 30, 2020
7aed937
Sync eng/common directory with azure-sdk-tools repository (#11007)
azure-sdk Apr 30, 2020
2cf49d0
ChangeLog generics for autorest v5 (#10885)
lmazuel Apr 30, 2020
48567d4
[Event Hubs] Add params in stress test command line for receive batch…
YijunXieMS May 1, 2020
0974b40
Storageache cjf (#11122)
chenjianfei2017 May 1, 2020
b835a91
added AzureKeyCredential link to readme (#11089)
iscai-msft May 1, 2020
13abbc5
Fix core auth (#11177)
lmazuel May 1, 2020
e8f9637
[formrecognizer] increase test coverage (#11096)
kristapratico May 1, 2020
c8ade95
Release edits for Search (#11178)
bryevdv May 1, 2020
c62ccaa
update readme with note about service version support (#11180)
kristapratico May 1, 2020
505f7fe
[Event Hubs] Fix a bug that sets owner level 0 (#11172)
YijunXieMS May 1, 2020
bfdc8e7
[ServiceBus] Docstring and Changelog adjustment (#11166)
YijunXieMS May 1, 2020
c1a245d
Identity use pbyte (#11173)
xiangyan99 May 1, 2020
98bb6e9
EnvironmentCredential correctly initializes UsernamePasswordCredentia…
chlowell May 1, 2020
1d28b02
User authentication API for applications (#10612)
chlowell May 1, 2020
933710c
[Event Hubs] Version/Docs adjustment for 5.1.0 (#11179)
YijunXieMS May 1, 2020
d5ba8a4
[form recognizer] Add some stuff that .net has to our samples (#11187)
iscai-msft May 1, 2020
f94fc3f
re-enable schedule tests in session (#11184)
yunhaoling May 1, 2020
de0977e
add helpers for search fields (#11164)
bryevdv May 1, 2020
0a90eca
Define match conditions for CreateOrUpdate and Delete operations (#11…
rakshith91 May 1, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
3 changes: 2 additions & 1 deletion eng/autorest_req.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ pytest-cov==2.8.1
pytest-asyncio==0.10.0; python_version >= '3.5'
isodate==0.6.0
msrest==0.6.13
aiohttp==3.6.2
aiohttp==3.6.2
wheel
93 changes: 71 additions & 22 deletions eng/common/TestResources/New-TestResources.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,10 @@ param (
[switch] $CI = ($null -ne $env:SYSTEM_TEAMPROJECTID),

[Parameter()]
[switch] $Force
[switch] $Force,

[Parameter()]
[switch] $OutFile
)

# By default stop for any error.
Expand Down Expand Up @@ -108,7 +111,8 @@ trap {
}

# Enumerate test resources to deploy. Fail if none found.
$root = [System.IO.Path]::Combine("$PSScriptRoot/../../../sdk", $ServiceDirectory) | Resolve-Path
$repositoryRoot = "$PSScriptRoot/../../.." | Resolve-Path
$root = [System.IO.Path]::Combine($repositoryRoot, "sdk", $ServiceDirectory) | Resolve-Path
$templateFileName = 'test-resources.json'
$templateFiles = @()

Expand Down Expand Up @@ -172,19 +176,20 @@ if ($TestApplicationId -and !$TestApplicationOid) {
}
}


# If the ServiceDirectory is an absolute path use the last directory name
# (e.g. D:\foo\bar\ -> bar)
$serviceName = if (Split-Path -IsAbsolute $ServiceDirectory) {
Split-Path -Leaf $ServiceDirectory
} else {
$ServiceDirectory
}

# Format the resource group name based on resource group naming recommendations and limitations.
$resourceGroupName = if ($CI) {
$BaseName = 't' + (New-Guid).ToString('n').Substring(0, 16)
Write-Verbose "Generated base name '$BaseName' for CI build"

# If the ServiceDirectory is an absolute path use the last directory name
# (e.g. D:\foo\bar\ -> bar)
$serviceName = if (Split-Path -IsAbsolute $ServiceDirectory) {
Split-Path -Leaf $ServiceDirectory
} else {
$ServiceDirectory
}

"rg-{0}-$BaseName" -f ($serviceName -replace '[\\\/:]', '-').Substring(0, [Math]::Min($serviceName.Length, 90 - $BaseName.Length - 4)).Trim('-')
} else {
"rg-$BaseName"
Expand Down Expand Up @@ -281,12 +286,21 @@ foreach ($templateFile in $templateFiles) {
Write-Verbose "Successfully deployed template '$templateFile' to resource group '$($resourceGroup.ResourceGroupName)'"
}

if ($deployment.Outputs.Count -and !$CI) {
# Write an extra new line to isolate the environment variables for easy reading.
Log "Persist the following environment variables based on your detected shell ($shell):`n"
$serviceDirectoryPrefix = $serviceName.ToUpperInvariant() + "_"

$context = Get-AzContext;

# Add default values
$deploymentOutputs = @{
"$($serviceDirectoryPrefix)CLIENT_ID" = $TestApplicationId;
"$($serviceDirectoryPrefix)CLIENT_SECRET" = $TestApplicationSecret;
"$($serviceDirectoryPrefix)TENANT_ID" = $context.Tenant.Id;
"$($serviceDirectoryPrefix)SUBSCRIPTION_ID" = $context.Subscription.Id;
"$($serviceDirectoryPrefix)RESOURCE_GROUP" = $resourceGroup.ResourceGroupName;
"$($serviceDirectoryPrefix)LOCATION" = $resourceGroup.Location;
"$($serviceDirectoryPrefix)ENVIRONMENT" = $context.Environment.Name;
}

$deploymentOutputs = @{}
foreach ($key in $deployment.Outputs.Keys) {
$variable = $deployment.Outputs[$key]

Expand All @@ -295,23 +309,54 @@ foreach ($templateFile in $templateFiles) {

if ($variable.Type -eq 'String' -or $variable.Type -eq 'SecureString') {
$deploymentOutputs[$key] = $variable.Value
}
}

if ($OutFile)
{
if (!$IsWindows)
{
Write-Host "File option is supported only on Windows"
}

$outputFile = "$templateFile.env"

$environmentText = $deploymentOutputs | ConvertTo-Json;
$bytes = ([System.Text.Encoding]::UTF8).GetBytes($environmentText)
$protectedBytes = [Security.Cryptography.ProtectedData]::Protect($bytes, $null, [Security.Cryptography.DataProtectionScope]::CurrentUser)

Set-Content $outputFile -Value $protectedBytes -AsByteStream -Force

Write-Host "Test environment settings`n $environmentText`nstored into encrypted $outputFile"
}
else
{

if (!$CI) {
# Write an extra new line to isolate the environment variables for easy reading.
Log "Persist the following environment variables based on your detected shell ($shell):`n"
}

foreach ($key in $deploymentOutputs.Keys)
{
$value = $deploymentOutputs[$key]

if ($CI) {
# Treat all ARM template output variables as secrets since "SecureString" variables do not set values.
# In order to mask secrets but set environment variables for any given ARM template, we set variables twice as shown below.
Write-Host "Setting variable '$key': ***"
Write-Host "##vso[task.setvariable variable=_$key;issecret=true;]$($variable.Value)"
Write-Host "##vso[task.setvariable variable=$key;]$($variable.Value)"
Write-Host "##vso[task.setvariable variable=_$key;issecret=true;]$($value)"
Write-Host "##vso[task.setvariable variable=$key;]$($value)"
} else {
Write-Host ($shellExportFormat -f $key, $variable.Value)
Write-Host ($shellExportFormat -f $key, $value)
}
}
}

if ($key) {
# Isolate the environment variables for easy reading.
Write-Host "`n"
$key = $null
if ($key) {
# Isolate the environment variables for easy reading.
Write-Host "`n"
$key = $null
}
}

$postDeploymentScript = $templateFile | Split-Path | Join-Path -ChildPath 'test-resources-post.ps1'
Expand Down Expand Up @@ -442,6 +487,10 @@ Deployment (CI/CD) build (only Azure Pipelines is currently supported).
.PARAMETER Force
Force creation of resources instead of being prompted.

.PARAMETER OutFile
Save test environment settings into a test-resources.json.env file next to test-resources.json. File is protected via DPAPI. Supported only on windows.
The environment file would be scoped to the current repository directory.

.EXAMPLE
Connect-AzAccount -Subscription "REPLACE_WITH_SUBSCRIPTION_ID"
$testAadApp = New-AzADServicePrincipal -Role Owner -DisplayName 'azure-sdk-live-test-app'
Expand Down
16 changes: 16 additions & 0 deletions eng/common/TestResources/Remove-TestResources.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ param (
[Parameter(ParameterSetName = 'Default+Provisioner', Mandatory = $true)]
[Parameter(ParameterSetName = 'ResourceGroup+Provisioner', Mandatory = $true)]
[string] $ProvisionerApplicationSecret,

[Parameter()]
[string] $ServiceDirectory,

[Parameter()]
[ValidateSet('AzureCloud', 'AzureUSGovernment', 'AzureChinaCloud')]
Expand Down Expand Up @@ -116,6 +119,15 @@ if (!$ResourceGroupName) {
$ResourceGroupName = "rg-$BaseName"
}

if (![string]::IsNullOrWhiteSpace($ServiceDirectory)) {
$root = [System.IO.Path]::Combine("$PSScriptRoot/../../../sdk", $ServiceDirectory) | Resolve-Path
$preRemovalScript = Join-Path -Path $root -ChildPath 'remove-test-resources-pre.ps1'
if (Test-Path $preRemovalScript) {
Log "Invoking pre resource removal script '$preRemovalScript'"
&$preRemovalScript -ResourceGroupName $ResourceGroupName @PSBoundParameters
}
}

Log "Deleting resource group '$ResourceGroupName'"
if (Retry { Remove-AzResourceGroup -Name "$ResourceGroupName" -Force:$Force }) {
Write-Verbose "Successfully deleted resource group '$ResourceGroupName'"
Expand Down Expand Up @@ -157,6 +169,10 @@ A service principal ID to provision test resources when a provisioner is specifi
.PARAMETER ProvisionerApplicationSecret
A service principal secret (password) to provision test resources when a provisioner is specified.

.PARAMETER ServiceDirectory
A directory under 'sdk' in the repository root - optionally with subdirectories
specified - in which to discover pre removal script named 'remove-test-resources-pre.json'.

.PARAMETER Environment
Name of the cloud environment. The default is the Azure Public Cloud
('PublicCloud')
Expand Down
16 changes: 16 additions & 0 deletions eng/common/TestResources/Remove-TestResources.ps1.md
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,22 @@ Accept pipeline input: False
Accept wildcard characters: False
```

### -ServiceDirectory
A directory under 'sdk' in the repository root - optionally with subdirectories
specified - specified - in which to discover pre removal script named 'remove-test-resources-pre.json'.

```yaml
Type: String
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -Environment
Name of the cloud environment.
The default is the Azure Public Cloud
Expand Down
6 changes: 6 additions & 0 deletions eng/common/TestResources/remove-test-resources.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
# Assumes steps in deploy-test-resources.yml was run previously. Requires
# environment variable: AZURE_RESOURCEGROUP_NAME and Az PowerShell module

parameters:
ServiceDirectory: ''

steps:
- pwsh: >
eng/common/TestResources/Remove-TestResources.ps1
Expand All @@ -15,6 +18,7 @@ steps:
-SubscriptionId '$(azure-subscription-id)'
-ProvisionerApplicationId '$(aad-azure-sdk-test-client-id)'
-ProvisionerApplicationSecret '$(aad-azure-sdk-test-client-secret)'
-ServiceDirectory '${{ parameters.ServiceDirectory }}'
-Environment 'AzureCloud'
-Force
-Verbose
Expand All @@ -29,6 +33,7 @@ steps:
-SubscriptionId '$(azure-subscription-id-gov)'
-ProvisionerApplicationId '$(aad-azure-sdk-test-client-id-gov)'
-ProvisionerApplicationSecret '$(aad-azure-sdk-test-client-secret-gov)'
-ServiceDirectory '${{ parameters.ServiceDirectory }}'
-Environment 'AzureUSGovernment'
-Force
-Verbose
Expand All @@ -43,6 +48,7 @@ steps:
-SubscriptionId '$(azure-subscription-id-cn)'
-ProvisionerApplicationId '$(aad-azure-sdk-test-client-id-cn)'
-ProvisionerApplicationSecret '$(aad-azure-sdk-test-client-secret-cn)'
-ServiceDirectory '${{ parameters.ServiceDirectory }}'
-Environment 'AzureChinaCloud'
-Force
-Verbose
Expand Down
6 changes: 6 additions & 0 deletions eng/common/pipelines/templates/steps/bypass-local-dns.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@

steps:
# https://github.com/actions/virtual-environments/issues/798
- script: sudo ln -sf /run/systemd/resolve/resolv.conf /etc/resolv.conf
displayName: Bypass local DNS server to workaround issue resolving cognitiveservices names
condition: and(succeededOrFailed(), eq(variables['OSVmImage'], 'ubuntu-18.04'))
85 changes: 85 additions & 0 deletions eng/common/scripts/copy-readmes-to-docs.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
# Example Usage: ./copy-readmes-to-docs.ps1 -CodeRepo C:/repo/sdk-for-python -DocRepo C:/repo/azure-docs-sdk-python
# run the link updating script before this to get links fixed to the release
# Highly recommended that you use Powershell Core.
# git reset --hard origin/smoke-test on the doc repo prior to running this

param (
[String]$CodeRepo,
[String]$DocRepo,
[String]$TargetServices
)

$PACKAGE_README_REGEX = ".*[\/\\]sdk[\\\/][^\/\\]+[\\\/][^\/\\]+[\/\\]README\.md"

Write-Host "repo is $CodeRepo"

$date = Get-Date -Format "MM/dd/yyyy"

if ($CodeRepo -Match "net")
{
$lang = ".NET"
$TARGET_FOLDER = Join-Path -Path $DocRepo -ChildPath "api/overview/azure"
$metadataUri = "https://raw.githubusercontent.com/Azure/azure-sdk/master/_data/releases/latest/dotnet-packages.csv"
}
if ($CodeRepo -Match "python"){
$lang = "Python"
$TARGET_FOLDER = Join-Path -Path $DocRepo -ChildPath "docs-ref-services"
$metadataUri = "https://raw.githubusercontent.com/Azure/azure-sdk/master/_data/releases/latest/python-packages.csv"
}
if ($CodeRepo -Match "java"){
$lang = "Java"
$TARGET_FOLDER = Join-Path -Path $DocRepo -ChildPath "docs-ref-services"
$metadataUri = "https://raw.githubusercontent.com/Azure/azure-sdk/master/_data/releases/latest/java-packages.csv"
}
if ($CodeRepo -Match "js"){
$lang = "JavaScript"
$TARGET_FOLDER = Join-Path -Path $DocRepo -ChildPath "docs-ref-services"
$metadataUri = "https://raw.githubusercontent.com/Azure/azure-sdk/master/_data/releases/latest/js-packages.csv"
}



$metadataResponse = Invoke-WebRequest -Uri $metadataUri | ConvertFrom-Csv

if ([string]::IsNullOrWhiteSpace($TargetServices))
{
$selectedServices = $metadataResponse | ForEach-Object -Process {$_.RepoPath} | Get-Unique
}
else {
$selectedServices = $TargetServices -Split "," | % { return $_.Trim() }
}


foreach($service in $selectedServices){
$readmePath = Join-Path -Path $CodeRepo -ChildPath "sdk/$service"
Write-Host "Examining: $readmePath"

$libraries = $metadataResponse | Where-Object { $_.RepoPath -eq $service }

foreach($library in $libraries){

$package = $library.Package
$version = If ([string]::IsNullOrWhiteSpace($library.VersionGA)) {$library.VersionPreview} Else {$library.VersionGA}

$file = Join-Path -Path $readmePath -ChildPath "/$package/README.md" | Get-Item
Write-Host "`tOutputting $($file.FullName)"

$fileContent = Get-Content $file

$fileContent = $fileContent -Join "`n"

$fileMatch = (Select-String -InputObject $fileContent -Pattern 'Azure .+? (client|plugin|shared) library for (JavaScript|Java|Python|\.NET)').Matches[0]

$header = "---`r`ntitle: $fileMatch`r`nkeywords: Azure, $lang, SDK, API, $service, $package`r`nauthor: maggiepint`r`nms.author: magpint`r`nms.date: $date`r`nms.topic: article`r`nms.prod: azure`r`nms.technology: azure`r`nms.devlang: $lang`r`nms.service: $service`r`n---`r`n"

$fileContent = $fileContent -replace $fileMatch, "$fileMatch - Version $version `r`n"

$fileContent = "$header $fileContent"

$readmeName = "$($file.Directory.Name.Replace('azure-','').Replace('Azure.', '').ToLower())-readme.md"

$readmeOutputLocation = Join-Path $TARGET_FOLDER -ChildPath $readmeName

Set-Content -Path $readmeOutputLocation -Value $fileContent
}
}
Loading