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

Clientmodel 3p pageable #21

Closed
wants to merge 51 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
28cd2f8
expect-continue header compat switch (#43888)
jaschrep-msft May 9, 2024
8903196
Link to AzurePipelinesCredential API ref page (#43956)
scottaddie May 9, 2024
f282354
Link to mocking guidance in XML docs for credential types (#43960)
scottaddie May 9, 2024
557d56a
Reduce memory allocation in HttpMessageSanitizer (#43818)
pharring May 9, 2024
9f81762
Enable validation in CI (#43957)
JoshLove-msft May 10, 2024
4000f32
Update Generator Version 3.0.0-beta.20240509.2 (#43979)
azure-sdk May 10, 2024
b09f1bd
Increment package version after release of Azure.ResourceManager.Self…
azure-sdk May 10, 2024
5b2e768
prepare release for Azure.ResourceManager.Compute (#43977)
ArcturusZhang May 10, 2024
0958aef
Increment version for maps releases (#43984)
azure-sdk May 10, 2024
87239dd
Increment package version after release of Azure.ResourceManager.Comp…
azure-sdk May 10, 2024
c4418cd
chore: add tsg link in error messages (#43597)
jorgerangel-msft May 10, 2024
46f3067
Add pageables
annelo-msft May 11, 2024
d515bc8
Update AutoRest C# version to 3.0.0-beta.20240510.1 (#43989)
azure-sdk May 11, 2024
b3b6c8a
remove custom code for ResourceData (#43991)
live1206 May 11, 2024
14f1ccd
Adding WebPubSubService provisioning (#43027)
vicancy May 11, 2024
7c5d478
Update AutoRest C# version to 3.0.0-beta.20240511.1 (#43997)
azure-sdk May 12, 2024
fffa7d7
Increment package version after release of Azure.Communication.Progra…
azure-sdk May 13, 2024
209d5cf
Make RequestOptions.BufferResponse non-nullable (#43990)
annelo-msft May 13, 2024
119a357
add ClientPage<T>
annelo-msft May 13, 2024
b716566
STG 93 API View Comments (#43999)
seanmcc-msft May 13, 2024
4685b90
Storage STG 93 GA Release (#44007)
seanmcc-msft May 13, 2024
f04919f
Update ci.yml (#44001)
vicancy May 13, 2024
52fa4fa
pageables implement enumerators
annelo-msft May 13, 2024
d98bfa6
give page a response constructor
annelo-msft May 13, 2024
fcfcb1f
Update AutoRest C# version to 3.0.0-beta.20240513.2 (#44014)
azure-sdk May 14, 2024
903d0a8
Bumped Batch swagger and chanaged release date (#44022)
seanmcc-msft May 14, 2024
8d0a33c
Switch ApiScan to use Azure CLI auth (#43912)
weshaggard May 14, 2024
2a0e020
ClientModel: AsyncResultCollection<T> and SSE event collection implem…
annelo-msft May 14, 2024
02d70f1
Merge remote-tracking branch 'upstream/main' into clientmodel-3p-page…
annelo-msft May 14, 2024
0cfb0b2
updates post merging main branch
annelo-msft May 14, 2024
08ffb83
Add hello world test for pageable collections
annelo-msft May 15, 2024
209d468
wip: tests
annelo-msft May 15, 2024
f2d11b2
Correct test proxy swagger (#44012)
JoshLove-msft May 15, 2024
01fb9b8
Fix issue #43813 (#43996)
welovej May 15, 2024
2866346
Added variable to skip spec location chk (#44032)
azure-sdk May 15, 2024
9637250
All credentials have parameterless ctor (#43962)
christothes May 15, 2024
db277dc
[CODEOWNERS] Remove invalid member (#44047)
jsquire May 15, 2024
3a73be2
Changed Blob Batch release date (#44049)
seanmcc-msft May 15, 2024
c355f8e
Merge remote-tracking branch 'upstream/main' into clientmodel-3p-page…
annelo-msft May 15, 2024
e92091e
some API updates
annelo-msft May 15, 2024
94fae1d
make page non-abstract
annelo-msft May 15, 2024
b0de24c
add test for continuation token
annelo-msft May 15, 2024
329c709
add tests for async pageable
annelo-msft May 15, 2024
a1cf4d9
remove nonnull constraint from T on pageables
annelo-msft May 15, 2024
364d6bd
add comments to public types
annelo-msft May 15, 2024
12381ff
thread through response updates
annelo-msft May 15, 2024
948e69a
export API
annelo-msft May 15, 2024
2f0c30c
update comments per pr fb
annelo-msft May 15, 2024
607f905
Expose factory method for creating ResultPage instead of constructor
annelo-msft May 16, 2024
44124b1
update CHANGELOG
annelo-msft May 16, 2024
3d37512
nit
annelo-msft May 16, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -202,10 +202,10 @@
# ServiceOwners: @ryogok @TFR258 @tburns10 @areddish @toothache

# PRLabel: %Cognitive - Face
/sdk/cognitiveservices/Vision.Face/ @JinyuID @dipidoo @SteveMSFT @msyache @longli0 @ShaoAnLin @lulululululu
/sdk/cognitiveservices/Vision.Face/ @JinyuID @dipidoo @SteveMSFT @msyache @longli0 @lulululululu

# ServiceLabel: %Cognitive - Face
# ServiceOwners: @JinyuID @dipidoo @SteveMSFT @msyache @longli0 @ShaoAnLin @lulululululu
# ServiceOwners: @JinyuID @dipidoo @SteveMSFT @msyache @longli0 @lulululululu

# PRLabel: %Cognitive - Form Recognizer
/sdk/documentintelligence/ @kinelski @pallavit @joseharriaga
Expand Down
28 changes: 12 additions & 16 deletions common/ManagementTestShared/Redesign/ManagementRecordedTestBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -73,44 +73,40 @@ private void Initialize()
protected void IgnoreNetworkDependencyVersions()
{
// Ignore the api-version of Network operations
UriRegexSanitizers.Add(new UriRegexSanitizer(
@"/providers\/Microsoft.Network\/(.*?)\?api-version=(?<group>[a-z0-9-]+)", "**"
)
UriRegexSanitizers.Add(new UriRegexSanitizer(@"/providers\/Microsoft.Network\/(.*?)\?api-version=(?<group>[a-z0-9-]+)")
{
GroupForReplace = "group"
GroupForReplace = "group",
Value = "**"
});
}

protected void IgnoreAuthorizationDependencyVersions()
{
// Ignore the api-version of Authorization operations
UriRegexSanitizers.Add(new UriRegexSanitizer(
@"/providers\/Microsoft.Authorization\/(.*?)\?api-version=(?<group>[a-z0-9-]+)", "**"
)
UriRegexSanitizers.Add(new UriRegexSanitizer(@"/providers\/Microsoft.Authorization\/(.*?)\?api-version=(?<group>[a-z0-9-]+)")
{
GroupForReplace = "group"
GroupForReplace = "group",
Value = "**"
});
}

protected void IgnoreKeyVaultDependencyVersions()
{
// Ignore the api-version of KeyVault operations
UriRegexSanitizers.Add(new UriRegexSanitizer(
@"/providers\/Microsoft.KeyVault\/(.*?)\?api-version=(?<group>[a-z0-9-]+)", "**"
)
UriRegexSanitizers.Add(new UriRegexSanitizer(@"/providers\/Microsoft.KeyVault\/(.*?)\?api-version=(?<group>[a-z0-9-]+)")
{
GroupForReplace = "group"
GroupForReplace = "group",
Value = "**"
});
}

protected void IgnoreManagedIdentityDependencyVersions()
{
// Ignore the api-version of ManagedIdentity operations
UriRegexSanitizers.Add(new UriRegexSanitizer(
@"/providers\/Microsoft.ManagedIdentity\/(.*?)\?api-version=(?<group>[a-z0-9-]+)", "**"
)
UriRegexSanitizers.Add(new UriRegexSanitizer(@"/providers\/Microsoft.ManagedIdentity\/(.*?)\?api-version=(?<group>[a-z0-9-]+)")
{
GroupForReplace = "group"
GroupForReplace = "group",
Value = "**"
});
}

Expand Down
5 changes: 3 additions & 2 deletions eng/Packages.Data.props
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,8 @@
<PackageReference Update="Azure.ResourceManager.Redis" Version="1.3.1" />
<PackageReference Update="Azure.ResourceManager.Resources" Version="1.7.1" />
<PackageReference Update="Azure.ResourceManager.Search" Version="1.2.2" />
<PackageReference Update="Azure.ResourceManager.ServiceBus" Version="1.0.1" />
<PackageReference Update="Azure.ResourceManager.ServiceBus" Version="1.0.1" />
<PackageReference Update="Azure.ResourceManager.WebPubSub" Version="1.2.0-beta.1" />
<PackageReference Update="Azure.ResourceManager.SignalR" Version="1.1.1" />
<PackageReference Update="Azure.ResourceManager.Sql" Version="1.2.1" />
<PackageReference Update="Azure.ResourceManager.Storage" Version="1.2.1" />
Expand Down Expand Up @@ -223,7 +224,7 @@
All should have PrivateAssets="All" set so they don't become package dependencies
-->
<ItemGroup>
<PackageReference Update="Microsoft.Azure.AutoRest.CSharp" Version="3.0.0-beta.20240508.5" PrivateAssets="All" />
<PackageReference Update="Microsoft.Azure.AutoRest.CSharp" Version="3.0.0-beta.20240513.2" PrivateAssets="All" />
<PackageReference Update="Azure.ClientSdk.Analyzers" Version="0.1.1-dev.20240429.1" PrivateAssets="All" />
<PackageReference Update="coverlet.collector" Version="3.2.0" PrivateAssets="All" />
<PackageReference Update="Microsoft.CodeAnalysis.NetAnalyzers" Version="7.0.4" PrivateAssets="All" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,4 @@ steps:
displayName: Verify REST API spec location for "${{ parameters.PackageName }}"
env:
GH_TOKEN: $(azuresdk-github-pat)
condition: and(succeededOrFailed(), ne(variables['Skip.Verify-RestApiSpecLocation'], 'true'))
28 changes: 14 additions & 14 deletions eng/emitter-package-lock.json

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

6 changes: 3 additions & 3 deletions eng/emitter-package.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{
"main": "dist/src/index.js",
"dependencies": {
"@azure-tools/typespec-csharp": "0.2.0-beta.20240508.5"
"@azure-tools/typespec-csharp": "0.2.0-beta.20240513.2"
},
"devDependencies": {
"@typespec/versioning": "0.55.0",
"@typespec/openapi": "0.55.0",
"@azure-tools/typespec-azure-core": "0.41.0",
"@typespec/rest": "0.55.0",
"@typespec/http": "0.55.0",
"@typespec/openapi": "0.55.0",
"@typespec/rest": "0.55.0",
"@azure-tools/typespec-client-generator-core": "0.41.8",
"@typespec/compiler": "0.55.0"
}
Expand Down
30 changes: 28 additions & 2 deletions eng/pipelines/aggregate-reports.yml
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,26 @@ stages:
-WorkingDirectory '$(Build.ArtifactStagingDirectory)'
-NupkgFilesDestination 'nupkgFiles'

- task: AzureCLI@2
displayName: Azure CLI Login
inputs:
azureSubscription: azure-sdk-apiscan
scriptType: pscore
scriptLocation: inlineScript
addSpnToEnvironment: true
inlineScript: |
az --version
az account show -o json
Write-Host "##vso[task.setvariable variable=ARM_CLIENT_ID;issecret=true]$($env:servicePrincipalId)"
Write-Host "##vso[task.setvariable variable=ARM_TENANT_ID;issecret=true]$($env:tenantId)"
Write-Host "##vso[task.setvariable variable=ARM_OIDC_TOKEN;issecret=true]$($env:idToken)"

- pwsh: |
# Need to re-login with the az login so that it presists and can be used in the APISca task
az login --service-principal -u $(ARM_CLIENT_ID) --tenant $(ARM_TENANT_ID) --allow-no-subscriptions --federated-token $(ARM_OIDC_TOKEN)
az account show -o json
displayName: Persist CLI Login for ApiScan usage

- task: securedevelopmentteam.vss-secure-development-tools.build-task-apiscan.APIScan@2
displayName: 'Run APIScan'
inputs:
Expand All @@ -179,8 +199,14 @@ stages:
preserveLogsFolder: true
verbosityLevel: standard
env:
# azure-sdk-apiscan (81109e5f-0620-423c-a37a-c22fbf8973a7)
AzureServicesAuthConnectionString: runAs=App;AppId=81109e5f-0620-423c-a37a-c22fbf8973a7;TenantId=72f988bf-86f1-41af-91ab-2d7cd011db47;AppKey=$(azure-sdk-apiscan-client-secret)
AzureServicesAuthConnectionString: RunAs=Developer;DeveloperTool=AzureCli

- pwsh: |
az account show -o json
az logout
az account clear
displayName: Logout of Azure CLI
condition: succeededOrFailed()

- task: securedevelopmentteam.vss-secure-development-tools.build-task-postanalysis.PostAnalysis@2
displayName: 'Post Analysis (ApiScan)'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ namespace Azure.ResourceManager.ApiManagement.Models
public partial class RequestReportRecordContract : IUtf8JsonSerializable, IJsonModel<RequestReportRecordContract>
{
[MethodImpl(MethodImplOptions.AggressiveInlining)]
private void SerializeBackendResponseCodeValue(Utf8JsonWriter writer)
private void SerializeBackendResponseCodeValue(Utf8JsonWriter writer, ModelReaderWriterOptions options)
{
writer.WriteStringValue(BackendResponseCode);
}
Expand Down

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 @@ -52,10 +52,10 @@ private void IgnoreApiVersionInEventHubOperations()
{
// Ignore the api-version of EventHub operations
UriRegexSanitizers.Add(new UriRegexSanitizer(
@"/providers/Microsoft.EventHub/namespaces/([\S]+)?pi-version=(?<group>[a-z0-9-]+)", "**"
)
@"/providers/Microsoft.EventHub/namespaces/([\S]+)?pi-version=(?<group>[a-z0-9-]+)")
{
GroupForReplace = "group"
GroupForReplace = "group",
Value = "**"
});
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -200,10 +200,8 @@ public virtual async Task<Response<ConfigurationSetting>> AddConfigurationSettin
case 200:
case 201:
return await CreateResponseAsync(response, cancellationToken).ConfigureAwait(false);
case 412:
throw new RequestFailedException(response, null, new ConfigurationRequestFailedDetailsParser());
default:
throw new RequestFailedException(response);
throw new RequestFailedException(response, null, new ConfigurationRequestFailedDetailsParser());
}
}
catch (Exception e)
Expand Down Expand Up @@ -239,10 +237,8 @@ public virtual Response<ConfigurationSetting> AddConfigurationSetting(Configurat
case 200:
case 201:
return CreateResponse(response);
case 412:
throw new RequestFailedException(response, null, new ConfigurationRequestFailedDetailsParser());
default:
throw new RequestFailedException(response);
throw new RequestFailedException(response, null, new ConfigurationRequestFailedDetailsParser());
}
}
catch (Exception e)
Expand Down Expand Up @@ -309,10 +305,9 @@ public virtual async Task<Response<ConfigurationSetting>> SetConfigurationSettin
return response.Status switch
{
200 => await CreateResponseAsync(response, cancellationToken).ConfigureAwait(false),
409 => throw new RequestFailedException(response, null, new ConfigurationRequestFailedDetailsParser()),

// Throws on 412 if resource was modified.
_ => throw new RequestFailedException(response),
_ => throw new RequestFailedException(response, null, new ConfigurationRequestFailedDetailsParser()),
};
}
catch (Exception e)
Expand Down Expand Up @@ -352,10 +347,9 @@ public virtual Response<ConfigurationSetting> SetConfigurationSetting(Configurat
return response.Status switch
{
200 => CreateResponse(response),
409 => throw new RequestFailedException(response, null, new ConfigurationRequestFailedDetailsParser()),

// Throws on 412 if resource was modified.
_ => throw new RequestFailedException(response),
_ => throw new RequestFailedException(response, null, new ConfigurationRequestFailedDetailsParser()),
};
}
catch (Exception e)
Expand Down Expand Up @@ -441,10 +435,9 @@ private async Task<Response> DeleteConfigurationSettingAsync(string key, string
{
200 => response,
204 => response,
409 => throw new RequestFailedException(response, null, new ConfigurationRequestFailedDetailsParser()),

// Throws on 412 if resource was modified.
_ => throw new RequestFailedException(response)
_ => throw new RequestFailedException(response, null, new ConfigurationRequestFailedDetailsParser()),
};
}
catch (Exception e)
Expand All @@ -470,10 +463,9 @@ private Response DeleteConfigurationSetting(string key, string label, MatchCondi
{
200 => response,
204 => response,
409 => throw new RequestFailedException(response, null, new ConfigurationRequestFailedDetailsParser()),

// Throws on 412 if resource was modified.
_ => throw new RequestFailedException(response)
_ => throw new RequestFailedException(response, null, new ConfigurationRequestFailedDetailsParser()),
};
}
catch (Exception e)
Expand Down Expand Up @@ -596,7 +588,7 @@ internal virtual async Task<Response<ConfigurationSetting>> GetConfigurationSett
{
200 => await CreateResponseAsync(response, cancellationToken).ConfigureAwait(false),
304 => CreateResourceModifiedResponse(response),
_ => throw new RequestFailedException(response),
_ => throw new RequestFailedException(response, null, new ConfigurationRequestFailedDetailsParser())
};
}
catch (Exception e)
Expand Down Expand Up @@ -633,7 +625,7 @@ internal virtual Response<ConfigurationSetting> GetConfigurationSetting(string k
{
200 => CreateResponse(response),
304 => CreateResourceModifiedResponse(response),
_ => throw new RequestFailedException(response),
_ => throw new RequestFailedException(response, null, new ConfigurationRequestFailedDetailsParser())
};
}
catch (Exception e)
Expand Down Expand Up @@ -1386,7 +1378,7 @@ private async ValueTask<Response<ConfigurationSetting>> SetReadOnlyAsync(string
200 => async
? await CreateResponseAsync(response, cancellationToken).ConfigureAwait(false)
: CreateResponse(response),
_ => throw new RequestFailedException(response)
_ => throw new RequestFailedException(response, null, new ConfigurationRequestFailedDetailsParser()),
};
}
catch (Exception e)
Expand Down Expand Up @@ -1469,22 +1461,24 @@ private static RequestContext CreateRequestContext(ErrorOptions errorOptions, Ca

private class ConfigurationRequestFailedDetailsParser : RequestFailedDetailsParser
{
private const string TroubleshootingMessage =
"For troubleshooting information, see https://aka.ms/azsdk/net/appconfiguration/troubleshoot.";
public override bool TryParse(Response response, out ResponseError error, out IDictionary<string, string> data)
{
switch (response.Status)
{
case 409:
error = new ResponseError(null, "The setting is read only");
error = new ResponseError(null, $"The setting is read only. {TroubleshootingMessage}");
data = null;
return true;
case 412:
error = new ResponseError(null, "Setting was already present.");
error = new ResponseError(null, $"Setting was already present. {TroubleshootingMessage}");
data = null;
return true;
default:
error = null;
error = new ResponseError(null, TroubleshootingMessage);
data = null;
return false;
return true;
}
}
}
Expand Down
Loading