Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/Azure/azure-sdk-for-net i…
Browse files Browse the repository at this point in the history
…nto feature/mgmt-track2
  • Loading branch information
m-nash committed May 4, 2021
2 parents c7f7289 + 32d3cf2 commit fa267f0
Show file tree
Hide file tree
Showing 720 changed files with 37,175 additions and 27,112 deletions.
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@

# ServiceLabel: %Attestation %Service Attention
/sdk/attestation/ @anilba06 @larryosterman
/sdk/attestation/azure-security-attestation @azure/ @larryosterman @Azure/azure-sdk-write-attestation @anilba06
/sdk/attestation/azure-security-attestation @larryosterman @Azure/azure-sdk-write-attestation @anilba06

# ServiceLabel: %Authorization %Service Attention
/sdk/authorization/Microsoft.Azure.Management.Authorization/ @darshanhs90 @AshishGargMicrosoft
Expand Down
6 changes: 3 additions & 3 deletions eng/Packages.Data.props
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@
All should have PrivateAssets="All" set so they don't become pacakge dependencies
-->
<ItemGroup>
<PackageReference Update="Microsoft.Azure.AutoRest.CSharp" Version="3.0.0-beta.20210428.2" PrivateAssets="All" />
<PackageReference Update="Microsoft.Azure.AutoRest.CSharp" Version="3.0.0-beta.20210503.1" PrivateAssets="All" />
<PackageReference Update="Azure.ClientSdk.Analyzers" Version="0.1.1-dev.20210322.2" PrivateAssets="All" />
<PackageReference Update="coverlet.collector" Version="1.3.0" PrivateAssets="All" />
<PackageReference Update="Microsoft.CodeAnalysis.FxCopAnalyzers" Version="3.3.1" PrivateAssets="All" />
Expand Down Expand Up @@ -190,8 +190,8 @@
<PackageReference Update="Microsoft.CSharp" Version="4.6" />
<PackageReference Update="Microsoft.Extensions.Azure" Version="1.0.0" />
<PackageReference Update="Microsoft.Extensions.Configuration.Binder" Version="2.1.0" />
<PackageReference Update="Microsoft.Extensions.Configuration.Json" Version="2.1.0" />
<PackageReference Update="Microsoft.Extensions.Configuration" Version="2.1.0" />
<PackageReference Update="Microsoft.Extensions.Configuration.Json" Version="5.0.0" />
<PackageReference Update="Microsoft.Extensions.Configuration" Version="5.0.0" />
<PackageReference Update="Microsoft.Extensions.DependencyInjection" Version="2.1.0" />
<PackageReference Update="Microsoft.Extensions.PlatformAbstractions" Version="1.1.0" />
<PackageReference Update="Microsoft.NET.Test.Sdk" Version="16.8.0" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,7 @@ steps:
echo "##vso[task.setvariable variable=SetDevVersion]$setDailyDevBuild"
displayName: "Setup Versioning Properties"
condition: eq(variables['SetDevVersion'], '')
- pwsh: |
echo "##vso[task.setvariable variable=SetDevVersion;isOutput=true]$(SetDevVersion)"
name: VersioningProperties
displayName: "Export Versioning Properties"
16 changes: 13 additions & 3 deletions eng/common/scripts/ChangeLog-Operations.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
. "${PSScriptRoot}\logging.ps1"
. "${PSScriptRoot}\SemVer.ps1"

$RELEASE_TITLE_REGEX = "(?<releaseNoteTitle>^\#+.*(?<version>\b\d+\.\d+\.\d+([^0-9\s][^\s:]+)?)(\s+(?<releaseStatus>\(.*\)))?)"
$RELEASE_TITLE_REGEX = "(?<releaseNoteTitle>^\#+\s+(?<version>$([AzureEngSemanticVersion]::SEMVER_REGEX))(\s+(?<releaseStatus>\(.+\))))"
$CHANGELOG_UNRELEASED_STATUS = "(Unreleased)"
$CHANGELOG_DATE_FORMAT = "yyyy-MM-dd"

Expand Down Expand Up @@ -120,7 +120,17 @@ function Confirm-ChangeLogEntry {
else {
$status = $changeLogEntry.ReleaseStatus.Trim().Trim("()")
try {
[DateTime]$status
$releaseDate = [DateTime]$status
if ($status -ne ($releaseDate.ToString($CHANGELOG_DATE_FORMAT)))
{
LogError "Date must be in the format $($CHANGELOG_DATE_FORMAT)"
return $false
}
if (((Get-Date).AddMonths(-1) -gt $releaseDate) -or ($releaseDate -gt (Get-Date).AddMonths(1)))
{
LogError "The date must be within +/- one month from today."
return $false
}
}
catch {
LogError "Invalid date [ $status ] passed as status for Version [$($changeLogEntry.ReleaseVersion)]."
Expand Down Expand Up @@ -212,4 +222,4 @@ function Set-ChangeLogContent {
}

Set-Content -Path $ChangeLogLocation -Value $changeLogContent
}
}
8 changes: 4 additions & 4 deletions eng/mgmt/mgmtmetadata/cosmos-db_resource-manager.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ AutoRest installed successfully.
Commencing code generation
Generating CSharp code
Executing AutoRest command
cmd.exe /c autorest.cmd https://github.com/Azure/azure-rest-api-specs/blob/master/specification/cosmos-db/resource-manager/readme.md --csharp --version=v2 --reflect-api-versions --csharp-sdks-folder=C:\Users\frross\source\repos\azure-sdk-for-net\sdk
2021-03-04 18:04:13 UTC
cmd.exe /c autorest.cmd https://github.com/Azure/azure-rest-api-specs/blob/master/specification/cosmos-db/resource-manager/readme.md --csharp --version=v2 --reflect-api-versions --csharp-sdks-folder=D:\azure-sdk-for-net\sdk
2021-04-27 17:09:09 UTC
Azure-rest-api-specs repository information
GitHub fork: Azure
Branch: master
Commit: 270f39439e03cc7549a8dc1a0f07e73443af42f9
Commit: c1f66424b3b3636ec4cdb6c911dc75ca9abbe146
AutoRest information
Requested version: v2
Bootstrapper version: autorest@2.0.4413
Bootstrapper version: autorest@3.1.4
7 changes: 4 additions & 3 deletions eng/mgmt/mgmtmetadata/maintenance_resource-manager.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@ AutoRest installed successfully.
Commencing code generation
Generating CSharp code
Executing AutoRest command
cmd.exe /c autorest.cmd https://github.com/Azure/azure-rest-api-specs/blob/master/specification/maintenance/resource-manager/readme.md --csharp --version=v2 --reflect-api-versions --csharp-sdks-folder=D:\NetSDK\azure-sdk-for-net\sdk
2020-07-31 04:41:40 UTC
cmd.exe /c autorest.cmd https://github.com/Azure/azure-rest-api-specs/blob/master/specification/maintenance/resource-manager/readme.md --csharp --version=v2 --reflect-api-versions --override-client-name=MaintenanceManagementClient --title=MaintenanceManagementClient --csharp.output-folder='$(csharp-sdks-folder)/maintenance/Microsoft.Azure.Management.Maintenance/src/Generated/' --csharp-sdks-folder=E:\Github\ARM\azure-sdk-for-net\sdk
Autorest CSharp Version: 2.3.82
2021-04-30 12:38:05 UTC
Azure-rest-api-specs repository information
GitHub fork: Azure
Branch: master
Commit: 3d12d70d765934c2f59d1d1d3eb4485719c04361
Commit: c2ea3a3ccd14293b4bd1d17e684ef9129f0dc604
AutoRest information
Requested version: v2
Bootstrapper version: autorest@2.0.4413
4 changes: 4 additions & 0 deletions eng/pipelines/templates/stages/archetype-net-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ stages:
- stage: Release_${{artifact.safeName}}
displayName: 'Release: ${{artifact.name}}'
dependsOn: Signing
variables:
SetDevVersion: $[stageDependencies.Build.Build.outputs['VersioningProperties.SetDevVersion']]
condition: and(succeeded(), ne(variables['SetDevVersion'], 'true'), ne(variables['Skip.Release'], 'true'), ne(variables['Build.Repository.Name'], 'Azure/azure-sdk-for-net-pr'))
jobs:
- deployment: TagRepository
Expand Down Expand Up @@ -239,6 +241,8 @@ stages:

- stage: Integration
dependsOn: Signing
variables:
SetDevVersion: $[stageDependencies.Build.Build.outputs['VersioningProperties.SetDevVersion']]
jobs:
- job: PublishPackages
condition: and(eq(variables['SetDevVersion'], 'true'), eq(variables['System.TeamProject'], 'internal'))
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.

Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ internal partial class InternalPurchasePhoneNumbersOperation
{
internal InternalPurchasePhoneNumbersOperation(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, Request request, Response response)
{
_operation = new OperationInternals<Response>(this, clientDiagnostics, pipeline, request, response, OperationFinalStateVia.Location, "PurchasePhoneNumbersOperation");
_operation = new OperationInternals(clientDiagnostics, pipeline, request, response, OperationFinalStateVia.Location, "PurchasePhoneNumbersOperation");

if (response.Headers.TryGetValue<string>("operation-id", out var id))
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ internal partial class InternalReleasePhoneNumberOperation
{
internal InternalReleasePhoneNumberOperation(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, Request request, Response response)
{
_operation = new OperationInternals<Response>(this, clientDiagnostics, pipeline, request, response, OperationFinalStateVia.Location, "ReleasePhoneNumberOperation");
_operation = new OperationInternals(clientDiagnostics, pipeline, request, response, OperationFinalStateVia.Location, "ReleasePhoneNumberOperation");

if (response.Headers.TryGetValue<string>("operation-id", out var id))
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,17 +38,17 @@ public override async ValueTask<Response> UpdateStatusAsync(CancellationToken ca
/// <inheritdoc />
public override async ValueTask<Response> WaitForCompletionResponseAsync(CancellationToken cancellationToken = default)
{
Response<Response> response = await _operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false);
Response response = await _operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false);

return response.GetRawResponse();
return response;
}

/// <inheritdoc />
public override async ValueTask<Response> WaitForCompletionResponseAsync(TimeSpan pollingInterval, CancellationToken cancellationToken)
{
Response<Response> response = await _operation.WaitForCompletionAsync(pollingInterval, cancellationToken).ConfigureAwait(false);
Response response = await _operation.WaitForCompletionResponseAsync(pollingInterval, cancellationToken).ConfigureAwait(false);

return response.GetRawResponse();
return response;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -38,17 +38,17 @@ public override async ValueTask<Response> UpdateStatusAsync(CancellationToken ca
/// <inheritdoc />
public override async ValueTask<Response> WaitForCompletionResponseAsync(CancellationToken cancellationToken = default)
{
Response<Response> response = await _operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false);
Response response = await _operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false);

return response.GetRawResponse();
return response;
}

/// <inheritdoc />
public override async ValueTask<Response> WaitForCompletionResponseAsync(TimeSpan pollingInterval, CancellationToken cancellationToken)
{
Response<Response> response = await _operation.WaitForCompletionAsync(pollingInterval, cancellationToken).ConfigureAwait(false);
Response response = await _operation.WaitForCompletionResponseAsync(pollingInterval, cancellationToken).ConfigureAwait(false);

return response.GetRawResponse();
return response;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -175,15 +175,17 @@ public async Task UpdateCapabilitiesAsync()
var number = GetTestPhoneNumber();

var client = CreateClient();
var updateOperation = await client.StartUpdateCapabilitiesAsync(number, PhoneNumberCapabilityType.Outbound, PhoneNumberCapabilityType.Outbound);
var phoneNumber = await client.GetPurchasedPhoneNumberAsync(number);
PhoneNumberCapabilityType callingCapabilityType = phoneNumber.Value.Capabilities.Calling == PhoneNumberCapabilityType.Inbound ? PhoneNumberCapabilityType.Outbound : PhoneNumberCapabilityType.Inbound;
PhoneNumberCapabilityType smsCapabilityType = phoneNumber.Value.Capabilities.Sms == PhoneNumberCapabilityType.InboundOutbound ? PhoneNumberCapabilityType.Outbound : PhoneNumberCapabilityType.InboundOutbound;

var updateOperation = await client.StartUpdateCapabilitiesAsync(number, callingCapabilityType, smsCapabilityType);
await updateOperation.WaitForCompletionAsync();

Assert.IsTrue(updateOperation.HasCompleted);
Assert.IsNotNull(updateOperation.Value);
Assert.AreEqual(number, updateOperation.Value.PhoneNumber);
Assert.AreEqual(PhoneNumberCapabilityType.Outbound, updateOperation.Value.Capabilities.Calling);
Assert.AreEqual(PhoneNumberCapabilityType.Outbound, updateOperation.Value.Capabilities.Sms);
Assert.AreEqual(200, updateOperation.GetRawResponse().Status);
}

[Test]
Expand All @@ -193,7 +195,11 @@ public void UpdateCapabilities()
var number = GetTestPhoneNumber();

var client = CreateClient();
var updateOperation = client.StartUpdateCapabilities(number, PhoneNumberCapabilityType.Outbound, PhoneNumberCapabilityType.Outbound);
var phoneNumber = client.GetPurchasedPhoneNumber(number);
PhoneNumberCapabilityType callingCapabilityType = phoneNumber.Value.Capabilities.Calling == PhoneNumberCapabilityType.Inbound? PhoneNumberCapabilityType.Outbound : PhoneNumberCapabilityType.Inbound;
PhoneNumberCapabilityType smsCapabilityType = phoneNumber.Value.Capabilities.Sms == PhoneNumberCapabilityType.InboundOutbound ? PhoneNumberCapabilityType.Outbound : PhoneNumberCapabilityType.InboundOutbound;

var updateOperation = client.StartUpdateCapabilities(number, callingCapabilityType, smsCapabilityType);

while (!updateOperation.HasCompleted)
{
Expand All @@ -204,8 +210,7 @@ public void UpdateCapabilities()
Assert.IsTrue(updateOperation.HasCompleted);
Assert.IsNotNull(updateOperation.Value);
Assert.AreEqual(number, updateOperation.Value.PhoneNumber);
Assert.AreEqual(PhoneNumberCapabilityType.Outbound, updateOperation.Value.Capabilities.Calling);
Assert.AreEqual(PhoneNumberCapabilityType.Outbound, updateOperation.Value.Capabilities.Sms);
Assert.AreEqual(200, updateOperation.GetRawResponse().Status);
}
}
}
Loading

0 comments on commit fa267f0

Please sign in to comment.