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

LLC investigation into casting Response type to models #3

Draft
wants to merge 9 commits into
base: users/annelo/synapse-rbac-llc
Choose a base branch
from

Conversation

annelo-msft
Copy link
Owner

@annelo-msft annelo-msft commented Aug 17, 2021

Implementing Response.Throw()

Investigation for Azure#23372

@@ -53,6 +53,10 @@ public HttpClientTransport(HttpClient client)
/// </summary>
public static readonly HttpClientTransport Shared = new HttpClientTransport();

internal ClientOptions? ClientOptions { get; set; }
Copy link
Owner Author

Choose a reason for hiding this comment

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

This doesn't have to be ClientOptions, it could just be HttpMessageSanitizer


namespace Azure.Core.Pipeline
{
internal class ResponseExceptionFactory
Copy link
Owner Author

Choose a reason for hiding this comment

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

This is essentially what's in ClientDiagnostics, just one approach to factoring out the logic (that I'm not committed to if we don't like it)

@@ -124,7 +122,7 @@ public async ValueTask<string> CreateRequestFailedMessageAsync(Response response
return CreateRequestFailedMessageWithContent(response, message, content, errorCode, additionalInfo);
}

public string CreateRequestFailedMessageWithContent(Response response, string? message, string? content, string? errorCode, IDictionary<string, string>? additionalInfo)
private string CreateRequestFailedMessageWithContent(Response response, string? message, string? content, string? errorCode, IDictionary<string, string>? additionalInfo)
Copy link
Owner Author

Choose a reason for hiding this comment

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

I found nothing that depends on this.


private static SynapseRoleAssignment DeserializeResponse(Response response)
{
throw new NotImplementedException();
Copy link
Owner Author

Choose a reason for hiding this comment

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

TODO: Implement this

throw new NotImplementedException();
#pragma warning restore CA1065 // Do not raise exceptions in unexpected locations

//response.Throw();
Copy link
Owner Author

Choose a reason for hiding this comment

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

If we don't use a throw statement here, we get an error that not all paths return a value

{
ClientRequestId = requestId ?? throw new ArgumentNullException(nameof(requestId));
ExceptionFactory = new ResponseExceptionFactory(options);
Copy link
Owner Author

Choose a reason for hiding this comment

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

We probably don't want an allocation here? I think I can refactor to achieve that.

@annelo-msft annelo-msft changed the base branch from users/annelo/synapse-rbac-llc to main August 23, 2021 15:43
@annelo-msft annelo-msft changed the base branch from main to users/annelo/synapse-rbac-llc August 23, 2021 15:43
annelo-msft pushed a commit that referenced this pull request Mar 1, 2022
* 12767912: Add isLocalInference in the public SDK

* Rename the variable

* Thick clent feature (#5)

* 12767907: Add a package dependency on Microsoft.RL

* Add RankProcessor

* Remove unused file

* Remove some key

* Toggle commented codes so that most tests can pass

* Getting the required config details for rankprocessor to enable livemode

* Updating the wrong variable name

* Cleanup

* Revert "12767907: Add a package dependency on Microsoft.RL"

This reverts commit c586920.

* Revert "Add RankProcessor"

This reverts commit 43967d3.

* Revert "Remove unused file"

This reverts commit 1e400a8.

* Revert "Toggle commented codes so that most tests can pass"

This reverts commit 7ec50ec.

* Delete DisposeHelper.cs

* Revert "Revert "12767907: Add a package dependency on Microsoft.RL""

This reverts commit d6df6b5.

* Cleanup after reverting

* generating client configuration using autorest

* Revert "generating client configuration using autorest"

This reverts commit 6b75695.

* Configuration details for livemodel

* cleanup

* cleanup

* Added ToDo comments

* correct the version in endpoints

Co-authored-by: Tejaswi Paruchuri <tparuchuri@microsoft.com>
Co-authored-by: Tparuchuri <86433817+Tparuchuri@users.noreply.github.com>

* 12768045: Add rank processor for single slot (#3)

Add RankProcessor

Remove unused file

Remove some key

Toggle commented codes so that most tests can pass

RankProcessor is working. Still need to clean up the codes

Add test json files

only construct LiveModel when localInference is true

Move rankprocessor to under model

Add latest generated files from autorest

Add autogenerated files from autorest

Fix the setting in DecisionContext

Remove wrong comment

Revert unexpected auto-generated file changes

Addressed a comment

Move suppression to GlobalSuppressions.cs

Remove the decoration in MultiSlotClient.cs

Refactor rankProcessor so that the actions is not modified and restored;
added a converter between sdk and Rl.Net; replace Newtonsoft.json with
System.Text.Json

Address comments

Refactor RlObjuectConverter; remove some unneeded setters, etc.

Added unit tests for RlObjectConverter, DecisionContext,
JsonRawStringListConverter

Remove unused using

* 13009290: Create RankProcessor class to Azure Personalizer client library for .NET for multi slot (#7)

* 13009290: Create RankProcessor class to Azure Personalizer client
              library for .NET for multi slot

* Address comments

* Subsampling

* Cleanup and added tests

* Cleanup and added tests

* cleanup

* cleanup

* Single SubSample rate

* Cleanup

* Cleanup

* Variable name

* 13192221: Point to the Rl.Net nuget package from SDK dev drop (#9)

* Adding test code for Model/Put api and moving to preview.3

* Johnhuang/13216589 reward activate local inference api (#10)

* Update API view file

* 13216589: Add local inference reward api
13216590: Add local inference activate api

* Fix the comments

* Remove IsDisposed method

* Revert "Update API view file"

This reverts commit 0a4dcbf.

* Remove MultiSlotClient class as it is never used

* Add more change after other PRs were merged

* Revert "Add more change after other PRs were merged"

This reverts commit 35a3120.

* 13225147: Update API view file for thick client (#11)

* 13225147: Update API view file for thick client

* Remove some suppressing warning

* Add more changes after 2 PRs were merged

* lazy load rank processor, refresh config  and relaod token on expiry (#12)

* lazy load rank processor, refresh config  and relaod token on expiry

* Comments & Cleanup

* Cleanup

* Addressed comments

* Cleanup

* Fix conflict

Co-authored-by: John Huang <johnhuang@microsoft.com>

* 13309375: Improve the tests by mocking LiveModel when test mode is (#14)

* 13309375: Improve the tests by mocking LiveModel when test mode is
	  Playback but using real LiveModel when test mode is Live

* Change some public classes to private

* Address those comments in the main PR

* Update Microsoft.RL version

* Rename some properties

* Update Microsoft.RL version

* Fix spelling check

* Remove the unneeded warning

* Update live model config

* Use similar method names for export and import apis

* Johnhuang/13170630 address thick client sdk review (#18)

* 13170630: Address comments from SDK review

* Update API view file

* Remove unnecessary file under Gerated folder

* Add more test for RLObjectConverter

* Remove unused parameter

* Remove unneeded comment

* Update recording sessions for tests that were changed in earlier commit. (#19)

Co-authored-by: Personalizer Team <personalizer@microsoft.com>

* Update api view file after model api change (#20)

* Rename modelStream to modelBody (#21)

* Update Microsoft.RL version

* 13678440: Some cosmetic change to address comments from DotNet team (#22)

* Update method names for Export/Import models as per suggestions. (#23)

* Update method names for Export/Import models as per suggestions.

* Updates after running codecheck.ps1 script

Co-authored-by: Personalizer Team <personalizer@microsoft.com>

Co-authored-by: Tejaswi Paruchuri <tparuchuri@microsoft.com>
Co-authored-by: Tparuchuri <86433817+Tparuchuri@users.noreply.github.com>
Co-authored-by: Personalizer Team <personalizer@microsoft.com>
Co-authored-by: Sharath Malladi <msharath@live.com>
annelo-msft pushed a commit that referenced this pull request Apr 26, 2023
…nd add test coverage (Azure#34743)

* generated code using autorest

* fix mongo collection functions in Custom/RestorableCosmosDBAccountResource.cs

* Fix breaking changes that coming from the safeflatten

* InAccount restore changes for all api kinds

* resolve build errors and update mongo db inaccount restore tests

* update session records

* resolve build errors after merge conflicts

* regenerated changes using dotnet build /t:GenerateCode

* update default values

* fix test with default identity

* updated with eng\scripts\CodeChecks.ps1 -ServiceDirectory cosmosdb

* update sesion records for failing pipeline

* update sesion records for failing pipeline

* update inaccount restore tests to use static time and session records for table and gremlin tests

* Update recording

* Update recording

* update session records for sql and mongo and disable mongo inaccount restore tests

* update generated files with latest

* updated test case for burst capacity

* update session records for database account operations

* updated test case to not enable burst capacity in account creation (#2)

* recorded all tests in DatabaseAccount (#3)

* updated test case to not enable burst capacity in account creation

* recorded all tests in DatabaseAccount

* session recordings of DatabaseAccountTests

* cross region restore updated test

* test recordings update

* updated recordings

* added new group cross region restore

* udpated recordings with playback verification

* updated RestorabledatabaseAccountTests groupo

* update session records for private end point tests

* Rename BackupResource to CassandraClusterBackupResource

* Update API

* update changelog for new sdk release

---------

Co-authored-by: Arthur Ma <arthurma@microsoft.com>
Co-authored-by: Wei Hu <huwe@microsoft.com>
Co-authored-by: Richa Sharma <richasharma@microsoft.com>
Co-authored-by: Richa Sharma <richasharma.amu@gmail.com>
Co-authored-by: dsapaliga <dsapaliga@microsoft.com>
annelo-msft pushed a commit that referenced this pull request Dec 15, 2023
* Update autorest.md file with latest swagger and allow model duplication

* Generate and upgrade sdk code

* Customize redis common configuration code to include aad-enabled

* Regenerate API file

* Customize redis common configuration code to include aad-enabled

* Mitigate breaking change

* Create empty test-resources.json

* Create FlushFunctionalTests.cs

* Update assets.json

* Add functional tests for aad (#2)

Adds functional tests for aad

* Update Channel Tests (#3)

* Oscarba/fix (#4)

* Update Channel Tests

* Update correct data type

* Push regenerated code

* UpdateChannelFix (#5)

* Update Channel Tests

* Update correct data type

* Update test

* Update tag for assets after push for recordings

* Address reviewer comments

* Update generatred code after mergin in main

* Update FTs for updated models

* Update AAD FT

* Update assets.json

* Update changelog

---------

Co-authored-by: Kanchan Joshi <kanchanjoshi@microsoft.com>
Co-authored-by: Austin Tolani <austintolani@microsoft.com>
Co-authored-by: Oscar Barbosa Aquino <32723476+Darfeikus@users.noreply.github.com>
annelo-msft pushed a commit that referenced this pull request Apr 4, 2024
* Update Generator Version 3.0.0-beta.20240404.1

* Update SDK codes he_mi_3

* Update SDK codes de_he_2

* Update SDK codes ad_co_0

* Update SDK codes sq_wo_6

* Update SDK codes mi_pu_4

* Update SDK codes pu_sq_5

* Update SDK codes co_de_1

* Build fix

* Build fix #2

* Build fix #3

---------

Co-authored-by: Alexander Sher <alsher@microsoft.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant