Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Update AutoRest C# version #14407

Merged
merged 30 commits into from
Aug 25, 2020
Merged
Show file tree
Hide file tree
Changes from 18 commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
e5ef3c5
Update AutoRest C# version to https://github.com/Azure/autorest.cshar…
azure-sdk Aug 20, 2020
5d99161
Revert "Remove TemporaryUsePreviousGeneratorVersion (#14219)"
pakrym Aug 20, 2020
c8449af
Revert management, re-recode some libraries
pakrym Aug 20, 2020
d1f5e68
Use base64 values for tables
pakrym Aug 20, 2020
26a1c07
More records
pakrym Aug 20, 2020
a728636
Merge remote-tracking branch 'azure/master' into auto-update-autorest
pakrym Aug 20, 2020
d4081db
Pin Azure.Security.KeyVault.Administration to old generator
pakrym Aug 20, 2020
3a859be
Pin synapse, fix DT recording
pakrym Aug 20, 2020
0f9bc6d
Merge remote-tracking branch 'azure/master' into auto-update-autorest
pakrym Aug 20, 2020
47a7bea
Merge fixes
pakrym Aug 20, 2020
e9401e7
More recordings
pakrym Aug 21, 2020
e990e8a
Pin synapse
pakrym Aug 21, 2020
f7dca4d
DT
pakrym Aug 21, 2020
6e9036b
Merge remote-tracking branch 'azure/master' into auto-update-autorest
pakrym Aug 21, 2020
181b71b
Improve script
pakrym Aug 21, 2020
d2ad2eb
More recordings
pakrym Aug 21, 2020
3e06453
Merge remote-tracking branch 'azure/master' into auto-update-autorest
pakrym Aug 21, 2020
6ce691b
Merge
pakrym Aug 21, 2020
c78abbc
Merge remote-tracking branch 'azure/master' into auto-update-autorest
pakrym Aug 24, 2020
f129933
Rerecord template
pakrym Aug 24, 2020
36f9009
Revert recordings
pakrym Aug 25, 2020
64afe14
Generator version with a bug fix
pakrym Aug 25, 2020
b828ed4
DNS
pakrym Aug 25, 2020
1c948a7
recordings
pakrym Aug 25, 2020
6fcd15c
spaces
pakrym Aug 25, 2020
9d82b9d
Merge remote-tracking branch 'azure/master' into auto-update-autorest
pakrym Aug 25, 2020
73bcc23
textanalytics
pakrym Aug 25, 2020
ceaa740
textanalytics
pakrym Aug 25, 2020
ec5827c
Fix matcher
pakrym Aug 25, 2020
49f7987
Cosmos DB
pakrym Aug 25, 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
  •  
  •  
  •  
9 changes: 8 additions & 1 deletion eng/CodeGeneration.targets
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<PropertyGroup>
<_AutoRestVersion>https://github.com/Azure/autorest/releases/download/autorest-3.0.6236/autorest-3.0.6236.tgz</_AutoRestVersion>
<_AutoRestCoreVersion>3.0.6306</_AutoRestCoreVersion>
<_AutoRestCSharpVersion>https://github.com/Azure/autorest.csharp/releases/download/3.0.0-dev.20200811.1/autorest-csharp-v3-3.0.0-dev.20200811.1.tgz</_AutoRestCSharpVersion>
<_AutoRestCSharpVersion>https://github.com/Azure/autorest.csharp/releases/download/3.0.0-dev.20200820.1/autorest-csharp-v3-3.0.0-dev.20200820.1.tgz</_AutoRestCSharpVersion>
<_SupportsCodeGeneration Condition="'$(IsClientLibrary)' == 'true'">true</_SupportsCodeGeneration>
<_DefaultInputName Condition="Exists('$(MSBuildProjectDirectory)/autorest.md')">$(MSBuildProjectDirectory)/autorest.md</_DefaultInputName>
<AutoRestInput Condition="'$(AutoRestInput)' == ''">$(_DefaultInputName)</AutoRestInput>
Expand All @@ -18,6 +18,12 @@
<_GenerateCode Condition="'$(_SupportsCodeGeneration)' == 'true' AND '$(AutoRestInput)' != ''">true</_GenerateCode>
</PropertyGroup>

<PropertyGroup>
<_AutoRestVersion Condition="'$(TemporaryUsePreviousGeneratorVersion)' == 'true'">https://github.com/Azure/autorest/releases/download/autorest-3.0.6236/autorest-3.0.6236.tgz</_AutoRestVersion>
<_AutoRestCoreVersion Condition="'$(TemporaryUsePreviousGeneratorVersion)' == 'true'">3.0.6306</_AutoRestCoreVersion>
<_AutoRestCSharpVersion Condition="'$(TemporaryUsePreviousGeneratorVersion)' == 'true'">https://github.com/Azure/autorest.csharp/releases/download/3.0.0-dev.20200811.1/autorest-csharp-v3-3.0.0-dev.20200811.1.tgz</_AutoRestCSharpVersion>
</PropertyGroup>

<Target Name="GenerateCode" Condition="'$(_GenerateCode)' == 'true'" >
<ReadLinesFromFile File="$(AutoRestInput)">
<Output TaskParameter="Lines" ItemName="AutoRestInputLines"/>
Expand Down Expand Up @@ -50,3 +56,4 @@




Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: is the auto-updater adding a blank line to the end everytime it updates? Might be good to stop that eventually.

42 changes: 37 additions & 5 deletions eng/scripts/Download-DevOpsRecordings.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,35 @@
.\eng\scripts\Download-DevOpsRecordings.ps1 14153
#>
[CmdletBinding()]
param ([Parameter(Mandatory=$True)][int] $PR, [switch] $NoWait = $false)
param (
[Parameter(Mandatory=$True)][int] $PR,
[Parameter(ValueFromRemainingArguments=$true)][string[]]$SDKs,
[switch] $NoWait = $false)

$repoRoot = Resolve-Path "$PSScriptRoot/../..";
$artifactsPath = Join-Path $repoRoot "artifacts"
$commonParameter = @("--organization", "https://dev.azure.com/azure-sdk", "--project", "internal", "-o", "json", "--only-show-errors")

$token = (az account get-access-token --resource=https://management.core.windows.net/ -o json | ConvertFrom-Json).accessToken

function SkipBuild($build)
{
if (!$SDKs)
{
return $false;
}

foreach ($sdk in $SDKs)
{
if ($build.definition.name -eq "net - $sdk - tests")
{
return $false;
}
}

return $true;
}

Write-Host "Processing builds for PR $PR"

if ($NoWait)
Expand All @@ -36,11 +57,20 @@ else

foreach ($build in $builds)
{
if (SkipBuild($build)) { continue; }
if ($build.status -ne "completed")
{
Write-Host "Waiting for '$($build.definition.name)' ($($build.status)) to finish - https://dev.azure.com/azure-sdk/internal/_build/results?buildId=$($build.id)"
Write-Host "Waiting for '$($build.definition.name)' ($($build.status)) to finish - https://dev.azure.com/azure-sdk/internal/_build/results?buildId=$($build.id)" -ForegroundColor Blue
$allCompleted = $false;
}
elseif ($build.result -eq "succeeded")
{
Write-Host "Completed '$($build.definition.name)' ($($build.result)) - https://dev.azure.com/azure-sdk/internal/_build/results?buildId=$($build.id)" -ForegroundColor Green
}
else
{
Write-Warning "Non-successful '$($build.definition.name)' ($($build.result)) - https://dev.azure.com/azure-sdk/internal/_build/results?buildId=$($build.id)"
}
}

if (!$allCompleted)
Expand All @@ -56,6 +86,7 @@ $ProcessedDefinitions = @();

foreach ($build in $builds)
{
if (SkipBuild($build)) { continue; }
$definitionName = $build.definition.name;
if ($ProcessedDefinitions -contains $definitionName)
{
Expand All @@ -76,9 +107,10 @@ foreach ($build in $builds)
Write-Host "Downloading artifact $downloadUrl to '$destination'"
Invoke-WebRequest -Uri $downloadUrl -OutFile $destination -Headers @{Authorization="Bearer $token"}
Expand-Archive -Path $destination -DestinationPath $artifactsPath -Force

$sessionRecordsPaths = Join-Path $artifactsPath "SessionRecords" "sdk"
Copy-Item -Path $sessionRecordsPaths -Filter "*.json" -Recurse -Destination $repoRoot -Container -Force
Remove-Item $sessionRecordsPaths -Recurse -Force
}
}
}

$sessionRecordsPaths = Join-Path $artifactsPath "SessionRecords" "sdk"
Copy-Item -Path $sessionRecordsPaths -Filter "*.json" -Recurse -Destination $repoRoot -Container -Force
27 changes: 13 additions & 14 deletions eng/scripts/Start-DevOpsRecordings.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -22,26 +22,25 @@ param (
$invokeParameter = @("--organization", "https://dev.azure.com/azure-sdk", "-o", "json", "--only-show-errors")
$commonParameters = $invokeParameter + @( "--project", "internal")

if (!$NoCancel)
{
$builds = az pipelines runs list @commonParameters --tags Recording --branch "refs/pull/$PR/merge" --query-order FinishTimeDesc | ConvertFrom-Json;

$cancelPatchFile = New-TemporaryFile;
$builds = az pipelines runs list @commonParameters --tags Recording --branch "refs/pull/$PR/merge" --query-order FinishTimeDesc | ConvertFrom-Json;
$cancelPatchFile = New-TemporaryFile;
"{`"status`": `"Cancelling`"}" > $cancelPatchFile;
pakrym marked this conversation as resolved.
Show resolved Hide resolved

foreach ($build in $builds)
foreach ($sdk in $SDKs)
{
$pipeline = "net - $sdk - tests";
if (!$NoCancel)
{
if ($build.status -ne "completed")
foreach ($build in $builds)
{
Write-Warning "Cancelling existing recording run '$($build.definition.name)' before we start recordings - https://dev.azure.com/azure-sdk/internal/_build/results?buildId=$($build.id)"
az devops invoke @invokeParameter --area build --resource builds --route-parameters "buildId=$($build.id)" project=internal --in-file $cancelPatchFile --http-method patch > $null;
if (($build.status -ne "completed") -and ($build.definition.name -eq $pipeline))
{
Write-Warning "Cancelling existing recording run '$($build.definition.name)' before we start recordings - https://dev.azure.com/azure-sdk/internal/_build/results?buildId=$($build.id)"
az devops invoke @invokeParameter --area build --resource builds --route-parameters "buildId=$($build.id)" project=internal --in-file $cancelPatchFile --http-method patch > $null;
}
}

}
}

foreach ($sdk in $SDKs)
{
$pipeline = "net - $sdk - tests";
Write-Host "Starting pipeline '$pipeline' for PR $PR"
$build = az pipelines run --name $pipeline @commonParameters --branch "refs/pull/$PR/merge" --variables Record=true | ConvertFrom-Json;
az pipelines runs tag add @commonParameters --run-id $build.id --tags Recording > $null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,6 @@
</Description>
<PackageTags>azure;management;appconfiguration</PackageTags>
<NoWarn>$(NoWarn);AZC0001;AZC0008;</NoWarn>
<TemporaryUsePreviousGeneratorVersion>true</TemporaryUsePreviousGeneratorVersion>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is IsMgmtClientLibrary property that you can use to set this flag in the Directory.Build.Data.props file instead of modifying each of the csproj here.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I want to be able to undo this flag package by package instead all at once.

</PropertyGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
This is a beta preview vesion. This version uses a next-generation code generator that introduces important breaking changes, but also new features (such as intuitive authentication, custom HTTP pipeline, distributed tracing and much more).
</Description>
<PackageTags>azure;management;compute</PackageTags>
<TemporaryUsePreviousGeneratorVersion>true</TemporaryUsePreviousGeneratorVersion>
</PropertyGroup>

<PropertyGroup>
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ public DigitalTwinsTestEnvironment()
{
}

public string DigitalTwinHostname => GetRecordedVariable($"{TestSettings.AdtEnvironmentVariablesPrefix}_URL",
options => options.IsSecret(TestUrlSanitizer.FAKE_HOST));
public string DigitalTwinHostname => GetRecordedVariable($"{TestSettings.AdtEnvironmentVariablesPrefix}_URL", options => options.IsSecret(TestUrlSanitizer.FAKE_URL));
}
}
Loading