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

SummaryDiagnostics: Refactors Code to Remove Dependency of HttpResponseHeadersWrapper to fetch Sub Status Codes #3792

Conversation

kundadebdatta
Copy link
Member

@kundadebdatta kundadebdatta commented Mar 31, 2023

Pull Request Template

Description

When trying to log cosmos exception, by doing cosmosException.ToString() is causing IndexOutOfRangeException and the stack trace points out to HttpResponseHeadersWrapper constructor. This PR fixes the bug by removing the dependency of HttpResponseHeadersWrapper and fetching the required headers from http response/ content message headers.

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)

Closing issues

To automatically close an issue: closes #3765

@kundadebdatta kundadebdatta self-assigned this Mar 31, 2023
Copy link
Member

@ealsur ealsur left a comment

Choose a reason for hiding this comment

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

Simplify by using GetValueOrDefault

@ealsur ealsur merged commit a697242 into master Apr 3, 2023
20 checks passed
@ealsur ealsur deleted the users/kundadebdatta/3765_fix_httpwrapper_indexoutofrange_exception branch April 3, 2023 18:42
kirankumarkolli added a commit that referenced this pull request May 17, 2023
…v3 master and Cosmos.Direct v3.30.8 (#3856)

* [Internal] Client Telemetry: Fixes tests leaking environment variables (#3517)

* Adding log lines

* More logs

* Debugging further

* Removing other builds

* And more debugging

* Wrong build parameters

* Wrong category

* Removing noise

* Fixing test

* Adding utils

* Adding test with client telemetry enabled

* Fixing leak in Client Telemetry Tests

* Reenabling test

* cpu monitor initialization

* Adding name details

* Undo another file

* Updated change log and bumped up the version. (#3526)

* Query: Fixes performance regression on target partition on some ORDER BY queries with continuation (#3525)

* Revert performance regression caused by #1289

* Remove irrelevant comment

* Add a test for validating formatted filters for the target partition

* [Internal] AI Integration: Adds SubStatusCode Information in attributes (#3533)

* wip

* regenerated baseline

* add test

* fix test

Co-authored-by: Sourabh Jain <sourabhjain@microsoft.com>

* Diagnostics: Removes unused properties and reduces size (#3519)

* Remove starttime and id from diagnostics string

* Remove starttime and id from diagnostics string

* Update xml files for trace baseline tests

* Update xml files for trace baseline tests

* Update xml files for trace baseline tests

* Whitespaces update

* Changed starttime position based on code review

Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>

* [Internal] docs: Add address caches conceptual flow (#3534)

* Rough draft

* Some more changes

* Adding a new section

* Some more refinement

* Some changes 

Lets get the feedback

* Some MISC changes

* Release: Adds SDK version and changelog for 3.31.2 (#3546)

* Bumped SDK version and changelog

* Added contracts file for 3.31.2

* [Internal] Documentation: Removes invalid comment from ReadThroughputAsync (#3516)

* [Internal] nugetconfig: Removes specific overrides (#3551)

* Query: Fixes partition range evaluation for spatial queries (#3495)

* Initial commit

* Update.

* Pull/Rebase

* Addressed comments.

* Build fix

* [Internal] Documentation: Refactors cache content on its own document (#3554)

* Add cache file

* Moving content away

* [Internal] Emulator unit tests: Adds IdEncoding unit tests for ComputeGateway (#3556)

* Adding IdEncoding unit tests for ComputeGateway

* Reacting to code review feedback

* Updating md files

* Change Feed Processor: Adds support for Resource Tokens (#3566)

* Adding rid parsing

* Test

* Removing dead code

* Contract update

* [Internal] AI integration: Refactor code how container and database name is flowing to opentelemetry module (#3532)

* wip

* WIP

* Revert "WIP"

This reverts commit 71275de.

* Revert "wip"

This reverts commit 586fa98.

* wip add containe and database info

* redesign how container and database name information flows into opne telemetry data

* test fix

* fix test

* fix tests

* fix typos

* baseline test fix

Co-authored-by: Sourabh Jain <sourabhjain@microsoft.com>

* [Internal] AI Integration: Adds a new flag in DistributedTracingOptions (#3562)

* add flag in diagnostic options

* test fixes

* rename variable

* test fix

* add validation

* fix baseline

* test fix

Co-authored-by: Sourabh Jain <sourabhjain@microsoft.com>

* Query: Fixes default to BadRequestException in case of internal errors in ServiceInterop (#3399)

* Don't default to BadRequestException in case of errors in ServiceInterop

* Incorporate code review feedback

* Fix build error

* fix up failing test

* [Internal] Query: Adds unit tests for Merge/Split implementation with OptimisticDirectExecution pipeline (#3510)

* Added tests to test different aspects of merge/split support with OptimisticDirectExecution pipeline. Tests check for gone exception handling, pipeline switching etc.

* Added gone exception simulation tests.

* Added new tests and improved test infra

* Removed ParalleContEvocation test. Fixed comments

* Removed CreateParallelCrossPartitionPipelineStateAsync() as it is not being used anymore

* Removed while loop in CreateDocumentContainerAsync()

* Fixed comments.

* Updated ExecuteGoneExceptionOnODEPipeline()

* Added type Assert for ExecuteGoneExceptionOnODEPipeline()

* Updated OptimisticDirectExecution pipeline abbreviation

* Updated TestBaseline folder with new xml

* Client Retry Policy: Adds HTTP timeouts with request-level cross-region retry (#3555)

* Fixes to ReadThroughputAsync for databases with no provisioned throughput and null as request options

* fixed failure to ReadReplaceThroughputResponseTests

* Added Stream Method

* Ran UpdateContract.ps1

* Encryption implemtation

* Fixed spelling error

* Update Microsoft.Azure.Cosmos.Encryption/src/EncryptionDatabase.cs

Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>

* Variable name change

* Update Microsoft.Azure.Cosmos/src/Resource/Database/Database.cs

Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>

* Suggested Changes and fixes

* Removed manufactured ResponseMessage + nits

* Simplified PR

* nits

* nits

* initial changes TODO: Update tests

* updated tests

* nits'

* Ran UpdateContracts.ps1

* nits + requested changes

* Delete NuGet.Config

* Update Microsoft.Azure.Cosmos/src/HttpClient/CosmosHttpClientCore.cs

Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>

* Update Microsoft.Azure.Cosmos/src/HttpClient/HttpTimeoutPolicy.cs

Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>

* Update Microsoft.Azure.Cosmos/src/HttpClient/HttpTimeoutPolicy.cs

Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>

* Update Microsoft.Azure.Cosmos/src/HttpClient/HttpTimeoutPolicy.cs

Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>

* Use Cosmos Exception Factory, Simplified Tests

* removed unused code

* nits: removed unused code

* removed unused code

Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>
Co-authored-by: Nalu Tripician <ntripician@microsoft.com>

* Documentation: Fixes EUAP in Comments (#3579)

* Query: Fixes incorrect FeedResponse.Count when result contains undefined elements (#3574)

* Do not maintain an independent count on QueryResponse that can go out of sync

* Add more test coverage for QueryResponse<T>.Count

* Output the correct count from CosmosElementSerializer when the input contains CosmosUndefined

* Add untyped tests for CosmosUndefined

* Remove commented code

* removed allr eference (#3581)

Co-authored-by: Sourabh Jain <sourabhjain@microsoft.com>

* Trace: Fixes Tracing/diagnostics hour-times to 24Hours (#3577)

* Trace: Fixes Tracing/diagnostics hour-times to 24Hours

* fixing baseline tests

Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>

* AI Integration: Adds cosmetic fixes (#3576)

* wip

* status code int and internal and client kind activity

* remove unused imports

* update baselines

* fix test

* fixed baseline tests

* fix tests

* update base tetss

Co-authored-by: Sourabh Jain <sourabhjain@microsoft.com>

* Query: Adds ALL Scalar Expression (#3509)

* Add SqlAllScalarExpression to v3 DOM

* updated generated parser files

* Parsing for ALL

* Added tests for ALL and baselines

* Added more tests

* added new test, cleanup

* cleaning & fix typos

* fixed typo

* Added new baseline test file names to csproj file

* renamed AggregateAll to AggregateSubquery to accomodate FIRST and LAST later

* Added keywords for 'left' and 'right' and respective function calls

* fixed bug from last commit

* cleaning

* replace tabs with spaces

* cleaning

* Release: Adds API contracts for 3.31.2-preview (#3586)

* [Internal] sccignore: Adds a .sccignore file to apply an exception for artifacts configuration issues (#3589)

* [Internal] PermissionTests: Adds CosmosPermissionTests Coverage (#3593)

* Ensures that both Direct and Gateway connection modes are tested
* Validates that container read works with PermissionMode.Read (test was previously only validating that Delete was blocked - i.e. the negative case).

* [Internal] AI Integration: Refactors to Operation prefix and add tests (#3583)

* add tests for otel and custome listener

* clean up

* null pointer fix

* fix tets

* handle event generation also at operation level

* added documentation

* wip

* change event sourcename

* rename event Name

Co-authored-by: Sourabh Jain <sourabhjain@microsoft.com>

* [Internal] HttpTimeoutPolicy: Removes Data Plane Writes from being able to be retried (#3607)

* data plane writes no longer failover on timeout

* removed duplication of test\

* [Internal] Performance Testing: Adds Distributed Tracing option in benchmarks (#3611)

Co-authored-by: Sourabh Jain <sourabhjain@microsoft.com>

* [Internal] Benchmark: Refactors code to make Memory Stream capacity configurable (#3624)

Co-authored-by: Sourabh Jain <sourabhjain@microsoft.com>

* add new LatestVersion changefeed mode that has same behavior as Incremental; renamed FullFidelity to AllVersionsAndDeletes (#3596)

* Query: Fixes handling of CosmosUndefined, CosmosGuid and CosmosBinary in unordered DISTINCT (#3632)

* Handle CosmosUndefined, CosmosGuid and CosmosBinary in DistinctMap.UnorderedDistinctMap

* Address code review feedback and remove unnecessary allocations from DistinctQueryPipelineStageTests

* [Internal] Subpartitioning: Adds updates to test coverage for subpartitioning (#3618)

* updates to test coverage for subpartitioning

* bug fixes

* now useses Assert.ThrowsException

* Seperated into multiple tests for clarity

* Put MultiHash test into seperate test file

* nit

* [Internal] ContainerProperties: Fixes version reset when setting PartitionKeyPath (#3637)

* Remember previous value

* test

* [Internal] AI Integration: Adds CorrelationId and Activity Id Attributes for query operation (#3630)

* add activityid in Otel attributes

* added correlation id

* operation type fix

* remove test changes

* test fix

* fix baseline test

* rename correlationId

* fix tests again

* include only not null attributes in test

* fixed tests

* changefeedxml

* test fix

* ordering activity in operationname oerder

* fix test

* review comments

* refator header getter setter

* clean up

Co-authored-by: Sourabh Jain <sourabhjain@microsoft.com>

* Documentation: Fixes CosmosClientBuilder.WithConnectionModeGateway parameter description (#3643)

* Fixed CosmosClientBuilder.WithConnectionModeGateway documentation

* Update Microsoft.Azure.Cosmos/src/Fluent/CosmosClientBuilder.cs

Co-authored-by: Ruben Bartelink <ruben@bartelink.com>

Co-authored-by: Augsten <aaugsten@harbourvest.com>
Co-authored-by: Ruben Bartelink <ruben@bartelink.com>

* Upgrade Resiliency: Refactors Implementation for Opening Rntbd Connections to Backend Replicas in Direct Mode. (#3640)

* Code changes to refactor implementations for opening connections to all replicas. Fixed test failures due to Direct package upgrade.

* Code changes to add poland central region as a part of Regions.cs

* Code changes to update contract to reflect new regions.

* Revert "Code changes to update contract to reflect new regions."

This reverts commit f171b3c.

* Revert "Code changes to add poland central region as a part of Regions.cs"

This reverts commit 1aafbf1.

* [Preview] AI integration: Adds IsDistributedTracingEnabled flag as public API to enable/disable this feature (#3598)

* make api public for preview

* add null check

* fix tests

* singleton listener initialization

* assign null to listeners

* fix test

* concurrent bag in listener

* renamed to LatencyThresholdForDiagnosticEvent

* renamed to IsDistributedTracingEnabled

* updated xml

* update contract

* made latency threshold flag internal

* fix test

* regeneratebaselines

* update documentation

* rename builder api

* add docs

* updated contracts and all

* doc update

* import cleanup

Co-authored-by: Sourabh Jain <sourabhjain@microsoft.com>

* Change Feed Processor: Fixes behavior with StartTime on Local (#3645)

* To UTC

* Test

* [Internal] Client Telemetry: Refactors code to use base useragent string (#3653)

* [Internal] AI Integration: Refactors code to rename event name (#3648)

* first draft

* rename event name

* updated xmls

* update files

* Region Availability: Adds Poland Central Region For Public Usage (#3656)

* Client Encryption: Adds validation code to check if the Key Vault URI provided in wrap metadata is a valid key identifier. (#3642)

* Check if the key vault uri provided is a valid Kid

* test fix.

* update changelog and build props

* Update Directory.Build.props

* Update Microsoft.Azure.Cosmos.Encryption.csproj

* Fixed preview version

* Refactor

* Update EncryptionDatabaseExtensions.cs

* [Internal] Query: Adds Split Support for Ode (#3572)

* Added tests to test different aspects of merge/split support with OptimisticDirectExecution pipeline. Tests check for gone exception handling, pipeline switching etc.

* Added gone exception simulation tests.

* Added new tests and improved test infra

* Removed ParalleContEvocation test. Fixed comments

* Removed CreateParallelCrossPartitionPipelineStateAsync() as it is not being used anymore

* Removed while loop in CreateDocumentContainerAsync()

* Fixed comments.

* Updated ExecuteGoneExceptionOnODEPipeline()

* Added type Assert for ExecuteGoneExceptionOnODEPipeline()

* Replaced try-catch with if statement in MoveNextAsync()

* Added delegate to access TryCreateCoreContextAsync()

* Added check to confirm Ode pipeline is not called in fallback plan

* Updated method name from OptimisticDirectExecutionContext() to TryCreateOptimisticDirectExecutionContext()

* Using delegate instead of Func<>.

* Ode fallback plan always calls Specialized pipeline

* Using ServiceInterop/Gateway to get QueryPlan for Specialized Pipeline

* Added new test to check handling of failing fallback pipeline

* Code cleanup

* Added logic for handling non ODE continuation tokens

* Moved delegate away from member variables

* Added tests for Merge case

* Updated method names

* Added checks for tryCatch

* Updated SetCancellationToken() to use Try

* Updated TryUnwrapContinuationToken()

* Removed changes in FlakyDocumentContainer.cs

* Removed unused imports

* Updated comments

* Fixed comments and cleaned up test code

* Added CosmosElement null check in TryUnwrapContinuationToken()

* Removed FlakyDocumentContainer.cs from pull request

* Removed unused imports

* Updated TryUnwrapContinuationToken()

* Update MoveNextAsync() call in OptimisticDirectExecutionQueryBaselineTests.cs

* Made MergeTestUtil.IsFailedFallbackPipelineTest a readonly property

* Added IsPartitionSplitException() overload to take CosmosElement

* Fixed bug regarding syntax error queries

* [Internal] AI Integration : Fixes operation type  for batch (#3660)

* fix op type

* fix conflict

* CosmosClientOptions: Adds ServerCertificateCustomValidationCallback for Http and TCP (#3636)

* Adding ServerCertificateCustomValidationCallback in clientoptions

* Adding Server callback for Http and fixing tests

* Fixing failing E2Etests

* Resolving merge conflicts

* Running update contracts script

* Running Update contracts script

* Running Update contracts script

* Reverting the v3 version change

* Update based on review comments

* Added unit tests

* Added remarks for callback delegate

* Ran update contracts script

* Update based on review comments

* Ran update contracts script

* Updated unit tests

* Making ssl validation function private

* Updating test files

* Update remarks for sslvalidation public contract

* Added emulator tests for server validation

Co-authored-by: Debdatta Kunda <87335885+kundadebdatta@users.noreply.github.com>

* Query: Adds EnableOptimisticDirectExecution flag to QueryRequestOptions (#3664)

* Added new flag to QueryRequestOptions to allow customers to use Ode pipeline

* Updated comments in QueryRequestOptions.cs

* Renamed enabledOde to enableOde

* Removed default setting for EnableOptimisticDirectExecution

* [Internal] Tests: Removes Direct/HTTPS emulator tests (#3679)

* Removing direct/https tests

* mppreference

* [Internal] Benchmark : Fixes issue with dependency on Cosmos Project (#3673)

* users/sourabhjain/benchmarkfix

* update pipeline

* Revert "users/sourabhjain/benchmarkfix"

This reverts commit 81b48f0.

* fix compilation error

* add parama for preview pkg also

---------

Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>

* LocalQuorum: Adds Quorum reads on Consistent Prefix Accounts (#3680)

Co-authored-by: DESKTOP-ED57J7H\Prashanth Venkataram <vprashanth1987@hotmail.com>

* 3.32.0: Adds new SDK version and contract files (#3687)

* 3.32.0: Adds new SDK version and contract files

* 3.32.0: Adds new SDK version and contract files

* Updating changelog version

* Updating changelog version

* Added more commits to changelog and updated release contract

* Added documentation tags PR in changelog

* Updated changelog based on reviews

* Updated PR decsription in changelog

* Update changelog.md

Updated full fidelity change description

Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>

---------

Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>

* [Internal] Samples: Adds change feed pull model samples (#3646)

* add change feed pull samples

* refactor appsettings validation

* addressing pr comments

* move task delay

* update sample to use latest change feed mode names

---------

Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>

* [Internal] Tests: Refactors emulator CI (#3688)

* [Internal] GitHub Template: Adds needs-investigation label (#3708)

By default, all "Bug report" issues will have "needs-investigation"

* Adding fabric bot action (#3709)

* CosmosNullReferenceException: Refactors CosmosNullReferenceException to pass along InnerException property on parent NullReferenceException (#3713)

* Passed inner exception details to NullReferenceException ctor when instantiating CosmosNullReferenceException.

* Added unit tests.

* Addressed PR feedback.

* [Internal] PriorityRequests: Fixes header value (#3714)

Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>

* [Internal] Query: Adds single physical partition check for OptimisticDirectExecution queries (#3699)

* Added single physical partition check for Ode queries. Updated test infrastructure for Ode emulator tests too.

* Refactored emulator tests to have all the test cases at the top of the file

* Updated TryGetTargetRangeOptimisticDirectExecutionAsync()

* Uodated logic on how many times CreateIngestQueryDeleteAsync() gets called

* Added debug asserts for partitionKeyDefinition

* Added pageSizeOptions parameter in CreateInput() in EmulatorTests

* Fixed comments

* [Internal] CTL: Fixes Reservoir Sampling Logic (#3712)

* Code changes to fix the reservoir sampling logic in CTL

* Code changes to modify help text on reservoir type.

* Code changes to address minor code refactor.

* Diagnostics: Adds startDate in Summary (#3707)

* Adding start date

* Updated trace files

* PR comment

* Committing missing tests

---------

Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>

* [Internal] Client Telemetry: Adds network information in the payload (#3691)

* first draft

* clean code

* add test

* fix test

* add replica info collection

* fix substatuscode and  operation type error

* fix code

* collect http infor in cache also

* message to stacktrace

* remove rntbd recording from cache

* print proper exception message

* fix test

* cleanup unused code and added few status codes in ignore list

* fixed all exception logging

* refactor conditions

* fix tests

* Documentation: Fixes Database.ReadAsync description (#3457)

* Documentation: Modify retry time to timespan 

Modify retry time in seconds to timespan of parameter maxRetryWaitTimeOnThrottledRequests (Method: [WithThrottlingRetryOptions](https://docs.microsoft.com/en-us/dotnet/api/microsoft.azure.cosmos.fluent.cosmosclientbuilder.withthrottlingretryoptions?view=azure-dotnet#feedback))
Resolves Azure/azure-sdk-for-net#29567

* Documentation: Fixes DeleteItemAsync Example

Documentation: Fixes DeleteItemAsync Example

* Documentation: Fixes ItemRequestOptions Example

Documentation: Fixes ItemRequestOptions Example

* Documentation:Update Database.ReadAsync description

Documentation: Update Database.ReadAsync description

* Documentation: Update Database.ReadAsync description

Documentation: Update Database.ReadAsync description

* Documentation: Updated ToStreamIterator example

Documentation: Updated ToStreamIterator example

* Modified StreamIterator section

* Update Microsoft.Azure.Cosmos/src/Resource/Database/Database.cs

Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>

* Remarks correction

* Revert the StreamIterator changes

Revert the StreamIterator changes

Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>
Co-authored-by: Kiran Kumar Kolli <kirankk@microsoft.com>

* Upgrade Resiliency: Adds Implementation for Validating the Unhealthy Backend Replicas in Direct mode (#3631)

* Code changes to implement replica validation in dotnet v3 sdk.

* Cosmetic changes to add inline code comments.

* Code chages to address review comments.

* Code changes to cover a scenario for async cache.

* Code changes to refactor async non-blocking cache code.

* Code changes to address minor review comments.

---------

Co-authored-by: Kiran Kumar Kolli <kirankk@microsoft.com>

* ReadMany: Fixes BadRequest when using Ids with single quotes (#3732)

* Use parameters

* Emulator tests

* Release: Adds SDK version and changelog for 3.32.1 (#3733)

* version bump

* Contracts

* [Internal] Build: Fixes static tool analysis versions (#3736)

* Update Binskim and follow warnings

* Fixing task

* More version bumps

* binskim args

* Padding

* policheck

* postanalysis parameters

* analysis settings

* Query: Fixes System.ArgumentException when using PartitionKey.None on x86, Linux or in Optimistic Direct Execution (#3730)

* Minor clean up of OptimisticDirectExecutionQueryTests

* More minor cleanup in OptimisticDirectExecutionQueryTests

* Add emulator tests for the bypass query parsing scenario

* Handle PartitionKey.None while creating QueryIterator. This is a workaround for the PartitionKeyInternal.None not following its own contract

* Fix up to correctly handle PartitionKey.None using the CachedContainerQueryProperties

* Add more tests where PartitionKey.None maps to PartitionKey.Undefined

---------

Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>

* Query: Adds FIRST and LAST Scalar Expressions (#3629)

* Add FIRST and LAST objects and update visitors

* add FIRST LAST evaluation and update offline engine visitors

* Add FIRST and LAST to parser

* update another visitor

* Fix typo

* fix typo

* added new tests and baselines

* cleaning

* cleaning

---------

Co-authored-by: neildsh <35383880+neildsh@users.noreply.github.com>
Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>

* Subpartitioning: Adds support for Prefix Partition Key searches for sub partitioned containers (#3109)

* 1st round of changes to support subpartitioning for ChangeFeed

* name change and moved a method to FeedRangePartitionKey

* support for prefix partition change feed and query including unit and emulator tests. need to verify using FeedRange with QueryIterator

* splitting out unit tests from emulator tests

* 1st round of changes to support subpartitioning for ChangeFeed

* name change and moved a method to FeedRangePartitionKey

* support for prefix partition change feed and query including unit and emulator tests. need to verify using FeedRange with QueryIterator

* splitting out unit tests from emulator tests

* moved logic to choose for prefix partition query and change feed

* additional conditional to check for MultiHash partitionkeydefinition kind

* removed unnecessary using

* cleanup

* unnecessary using

* removed PREVIEW from proj

* unit tests for ResolveFeedRangeBasedOnPrefixContainerAsync

* change access modifier

* since I changed to static, needed to fix tests

* dealing with some testing nits

* removed Console.Writeline

* slight change in test use containerProperties and partitionKeyDefinition

* big fix for resolve feedrange, changes to error behavior, added additional test coverage

* test changes

* ran updateContracts.ps1

* reverting to 3ad5309

* Ran Update Contracts

* ran updateContracts.ps1

* UpdateContracts.ps1

* updatecontracts

* removed bad check from test, removed changes from updatecontracts.ps1

* revert UpdateContracts changes

* Reverting to 756a123

* removed accidental change from changelog

* removed unwanted change from Directory.build.props

* added test clean up

* removed console.writelines

* updates to query test

* removed preview flag

* ran UpdateContrats.ps1

* no longer recread feedRange for queries unless using prefix pk

* simplified if statement

* fixed bug

---------

Co-authored-by: Nalu Tripician <nalutrip@icloud.com>

* [Internal] ClientTelemetry: Adds logic to limit payload size to 2 MB (#3717)

* first draft

wip

fix test and logic

* resolve conflicts

* limit 2 mb

* ad callback

* fix tests

* code refactor

* cosmos json to newtosoft json

* clean up files

* fix logging to argumrnt based

* code refactor

* add null check

* Query: Fixes regression from LINQ custom serializer fix (#3749)

Co-authored-by: Minh Le <leminh@microsoft.com>
Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>

* [Internal] LocalQuorum: Refactors override (i.e. strong) to allow from any account consistency (#3753)

- Localquorum override (i.e. strong) to allow from any account consistency
- Facilitates no-downtime downgrade of existing accounts (i.e. existing Strong/bounded accounts migration to Eventual)

* Release: Adds SDK version and change log for 3.32.2 (#3752)

* version bump

* contract

* changelog

* version bump

* Fixing changelog text

* Add another PR

* Subpartitioning: Adds APIs for public release and increase REST API version (#3763)

* initial commit, Http version issues still needs to be resolved

* updateContracts + update Http Version

* updateded version in test

* update contracts

* requested changed

* changed name in comments to subpartitioning from multihash

* undid changes to TestLiteralSerialization.xml

* removed changes to non API.json files

* removed non XXXAPI.json file changes

* changed verbage on public comments

* changed error message to reflect verbage change

* Change Feed Processor: Fixes LeaseLostException leaks on notification APIs for Renew scenarios (#3775)

* Adding cases

* Tests

* Upgrade Resiliency: Refactors GatewayAddressCache to Mark TransportAddresses to Unhealthy when Connection Reset Event Occurs (#3768)

* Code changes to mark the transport uri to unhealthy for which a connection reset event occures through the connection state listener.

* Code changes to bump up the direct version.

* Code changes to clean up Gateway Address Cache.

* Code changes to fix pipeline build.

* Code changes to fix serilization test failures.

* Code changes to add force refresh to the gateway function callback delegate.

* [Preview] PriorityBasedExecution: Adds PriorityLevel as a RequestOption (#3672)

* Added Priority Level as a Request Option

* Changed Priority Level Low and High to 1 and 2 respectively

* Bumped DirectVersion

* Added made PriorityLevel internal for non preview packages

* Deleted PriorityLevelTests.cs

* Added description of Priority Level in RequestOptions.cs

* Modified comments for PriorityLevel in RequestOptions.cs

* Updated Contracts

* Modified Remarks for PriorityLevel and added see also link.

* Updated contracts

---------

Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>

* [Internal] Client Telemetry: Adds sampling logic for network level telemetry (#3750)

* sampling logic add

* throttlinfix

* fix tests

* fix tests

* remove dispose from sampler

* add 412

* draft push

* refactor code for sampling

* clean up

* start testing

* adding tests

* wip

* test fix

* fix test

* fix tests

* deleted extra file

* remove one toList

* add custome logic for sampling

* code refactor

* replace key

* remove commented code from test

* added more comments

* simpler sampler logic

* refactor code

* [Internal] Emulator Test : Fixes test when running with distributed tracing enabled. (#3751)

* enable DT for everything

* try1

* code refactoring

* fix pipeline

* try 2

* Revert "try 2"

This reverts commit 61643f9.

* Revert "fix pipeline"

This reverts commit 4b217f5.

* Revert "code refactoring"

This reverts commit d1ff0dd.

* Revert "try1"

This reverts commit bf9c41b.

* lazy factory and threadsafe

* scope factory in function

* try non static

* add flag

* fix test

* add consoles

* more console with fix

* fix tests

* temporarily enable dt

* fuix tests

* dispose listener

* fix tests

* remove delay

* revert flag change

* dynamically get number of test in trace class

* Release: Adds SDK version and changelog for 3.32.3 (#3788)

* Adding contract and version bump

* Adding changelog

* SummaryDiagnostics: Refactors Code to Remove Dependency of HttpResponseHeadersWrapper to fetch Sub Status Codes (#3792)

* Code changes to fetch sub status code from http response/ content headers.

* Code changes to address review comments.

* Code changes to return the first element from the sub status list.

* Code changes to update first or default.

* [Internal] Documentation: Fixes API name to NoSQL (#3795)

* [Internal] CTL: Fixes docker image pipeline (#3794)

* [Internal] AI Integration : Refactors useragent attribute name as per Otel conventions (#3784)

Co-authored-by: Fabian Meiswinkel <fabian@meiswinkel.com>

* HttpClient: Adds Properties to the Http messages if available (#3803)

* Passing properties

* test

* Documentation: Refactors SQL API reference to NoSQL API (#3793)

Co-authored-by: Kiran Kumar Kolli <kirankk@microsoft.com>

* [Internal] Perf test: Refactors code to re-enable performance tests (#3785)

* enable perf tests

* updated json

* upgrade benchmark

* update results

* updated benchmark results

* HttpClient: Adds detection of DNS changes through use of SocketsHttpHandler for .NET 6 and above (#3762)

* initial commit

* removed unneeded usings

* added validation callback, still needs tests

* nits + fixes

* added additional test

* test change

* removed unneeded Dispose calls

* removed unnneed dispose calls

* requested changes

* added pooledConnectionLifetime as client option

* nit

Co-authored-by: Kevin Pilch <me@pilchie.com>

* Update Microsoft.Azure.Cosmos/src/HttpClient/CosmosHttpClientCore.cs

Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>

* Update Microsoft.Azure.Cosmos/src/CosmosClientOptions.cs

Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>

* suggested changes

* remove test, reorder usings

* updated contracts

* removed all non XXXAPI.json changes from UpdateContracts run

* removed public surface, added random timespan

* removed change from unrelated file

* Update Microsoft.Azure.Cosmos/src/HttpClient/CosmosHttpClientCore.cs

Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>

* added thread safe random method

* nit

* fixed merge mistake

* added reflection failsafe/error tracing

* nits

* added back removed if

* fixed formatting

* changed random method, fixed serverCertificateCustomValidation

---------

Co-authored-by: Kevin Pilch <me@pilchie.com>
Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>

* [Internal] Tests: Fixes Open Telemetry attributes for ReadMany test (#3805)

* Fixing test

* New baseline

* Undo some changes

* [Internal] Client Telemetry: Refactors code to run client telemetry data processing task in background. (#3783)

* first draft

* remove failure count test

* refactporing

* code refactor

* create task with timeout

* fix test

* code refactoring

* fix timeout code

* space fix

* not failing if processor is taking time

* fix procrsser test

* code refactor

* refactor and test fix

* Patch: Adds Move Operation (#3389)

* Basic changes to introduce move operator

* Added "from" object in patch spec operation.
Added testcase block.

* Fixed testcase.

* Changes made to address comments'

* Added comment regarding enum mutations

* Formatted comment

Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>

* Moved summary location.

* Ran UpdateContracts.ps1

---------

Co-authored-by: Amaan Haque <t-amaanhaque@microsoft.com>
Co-authored-by: Amaan Haque <amaanhaque@microsoft.com>
Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>

* [Internal] Pipelines: Adds nightly build to produce packages (#3802)

* Support cleaning

* wire previous content delete

* as text

* with variable

* another test

* param with types

* as string

* no delete

* no quotes

* undoing

* re-adding quotes

* testing empty

* trying another test

* readding version

* fixing publishing artifacts

* fixing parameter

* Fixing official pipeline

* version 5

* fixing main pipeline

* test with true

* using start time

* nightly preview

* passing parameters to pack

* Fixing nuget version

* arguments on the nuget pack

* folder structure

* testing v5

* Using only content

* Removing currentDate

* [Internal] OpenTelemetry: Direct Package update and replacing diagnostic files (#3797)

* Direct Package update and replacing dagnostic files

* Resolve merge conflicts

* Running updateCOnstracts script

* Removed LinqTranslationWithCustomSerializerBaseline file

* Adding isDistributedTracingEnabled flag

* Running update contracts

* Running update contracts

* Running update contracts

* fix test

* Code cleanup for test fix

* Code cleanup for test fix

* Making regex expression readable

* Adding comment for regex expression

---------

Co-authored-by: Sourabh Jain <sourabhjain@microsoft.com>

* [Internal] MerlinBot: Adds auto-merge and cleanup automation (#3813)

* Add config changes

* Polishing automerge config

* Update fabricbot.json (#3824)

* [Internal] Upgrade Resiliency: Adds Logic to Validate `Unknown` Replicas along with `Unhealthy`. (#3820)

* Code changes to add aggressive validation logic.

* Code changes to enable aggressive validation for all regions.

* Code changes to pull in msdata cosmos.direct changes related to aggresive validation logic.

* Code changes to make minor cosmetic changes.

* Code changes to address review comments.

* Serialization: Fixes call to CosmosSerializer.FromStream on Gateway mode when EnableContentResponseOnWrite is false (#3814)

* Do not call serializer if ResponseMessage.Content is empty.

* Add unit test

* Update unit tests

* Remove unused usings

---------

Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>

* [Internal] Documentation: Adds documentation covering build pipelines (#3822)

* Add doc

* Move benchmark

* Fixing texts

* Client Encryption: Adds release version of Microsoft.Azure.Cosmos to Microsoft.Azure.Cosmos.Encryption.Custom (#3799)

* cosmos version change

* changing preview to release

* resolving code review comments

---------

Co-authored-by: Santosh Kulkarni <66682828+kr-santosh@users.noreply.github.com>

* SDK 3.33.0 : Adds version bump and changelog (#3823)

* release 3.30.0

* added changelog

* updated changelog

* updated changelog

* suggested change to changelog

* updated changelog

---------

Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>

* [Internal] Documentation: Adds msdata/direct Sync-up Guide. (#3828)

* Code changes to add msdata/direct sync-up documentation.

* Code changes to address review comments.

* Code changes to address further review comments.

* Code changes to address minor review comments.

* Removed internal links.

* Query: Adds TRIM string system function support in LINQ (#3833)

* add trim support

* Added some test coverage

* address reviews

---------

Co-authored-by: Minh Le <leminh@microsoft.com>

* Query: Fixes Parsing Error in SQL DOM when CultureInfo is available (#3832)

* add fix

* Add cultural info to test to verify correct behavior

* address pr review to restore to restore culture

* fix comment

---------

Co-authored-by: Minh Le <leminh@microsoft.com>

* Client Encryption: Adds api FetchDataEncryptionKeyWithoutRawKeyAsync and FetchDataEncryptionKeyAsync to get DEK without and with raw key respectively.  (#3809)

* added raw key to MdeEncryption

* adding ray key to Mde Algo

* test case changes

* resolving code review comments

* code optimization to reduce keyvault calls

* removed Microsoft.Data.Encryption.Cryptography nuget package

* added api for dek with raw key

* resolved code review comments

* adding change log

* code review changes

* Initial commit (#3826)

* Query: Adds Computed Property SDK Support (#3761)

* Initial commit

* Restored settings.json changes.

* Update

* Addressed comments; still need to be tested using Emulator.

* Fixes after test run.

* Ignored the computed property tests based on the sync this morning (to allow for preview release).

* Suite0 fixes.

* Test update.

* Suite0 fixes

* [Internal] Samples: Adds OpenTelemetry and Application Insights samples (#3818)

* add opentelemetry and application insights samples

* address pr comments

* [Internal] Query: Added custom serializer coverage tests to ExpressionToSQL.cs (#3722)

* Ensure enum as string is preserved for custom serializer

* Failing test

* Added failing tests

* Updated requested names

* Ignore result of test for now

* Added additional comment on why the test is ignored

* Replaced with sample code

* Remove ignore attribute from tests, documented misbehavior for future use

* Updated comment

---------

Co-authored-by: leminh98 <leminh.ams@gmail.com>

* Query: Added remaining Cosmos Type checking functions to CosmosLinqExtensions (#3724)

* Added the remaining Cosmos Type checking functions to the CosmosLinqExtensions

* Added comments requested

* Updated comment

* Updated baseline

* Improve readability of dictionary initialization

* Aligned with code style guide

* Revert change to baseline

* Executed update baseline script

---------

Co-authored-by: neildsh <35383880+neildsh@users.noreply.github.com>
Co-authored-by: leminh98 <leminh.ams@gmail.com>

* update sdk version and section tags (#3841)

* PackageLicense: Removes PackageLicenseUrl and Adds PackageLicenseFile since PackageLicenseUrl is deprecated (#3847)

* proposal to add PackageLicenseFile since PackageLicenseUrl is deprecated. NuGet/Home#4628

* adding attribute Visible=false

* making ChangeFeedMode.LatestVersion accessible to the public (#3854)

* Code changes to update msdata/direct repo.

---------

Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>
Co-authored-by: neildsh <35383880+neildsh@users.noreply.github.com>
Co-authored-by: Sourabh Jain <sourabh.jain.107@gmail.com>
Co-authored-by: Sourabh Jain <sourabhjain@microsoft.com>
Co-authored-by: aavasthy <113193425+aavasthy@users.noreply.github.com>
Co-authored-by: Kiran Kumar Kolli <kirankk@microsoft.com>
Co-authored-by: Aditya <adityasa@users.noreply.github.com>
Co-authored-by: Fabian Meiswinkel <fabian@meiswinkel.com>
Co-authored-by: akotalwar <94020786+akotalwar@users.noreply.github.com>
Co-authored-by: Nalu Tripician <nalutrip@icloud.com>
Co-authored-by: Nalu Tripician <ntripician@microsoft.com>
Co-authored-by: Pramod Valavala <43602528+PramodValavala-MSFT@users.noreply.github.com>
Co-authored-by: Ezra Haleva <115735172+ezrahaleva-msft@users.noreply.github.com>
Co-authored-by: Vivek Ravindran <vivekra@microsoft.com>
Co-authored-by: Prasad Ullal <36418906+prasadu-microsoft@users.noreply.github.com>
Co-authored-by: Philip Thomas <86612891+philipthomas-MSFT@users.noreply.github.com>
Co-authored-by: Arthur Augsten <arthuraugsten@gmail.com>
Co-authored-by: Augsten <aaugsten@harbourvest.com>
Co-authored-by: Ruben Bartelink <ruben@bartelink.com>
Co-authored-by: Santosh Kulkarni <66682828+kr-santosh@users.noreply.github.com>
Co-authored-by: pravengithub <124255233+pravengithub@users.noreply.github.com>
Co-authored-by: DESKTOP-ED57J7H\Prashanth Venkataram <vprashanth1987@hotmail.com>
Co-authored-by: Justine Cocchi <jucocchi@microsoft.com>
Co-authored-by: Abhijeet Mohanty <mabhijeet1995@gmail.com>
Co-authored-by: Achint-Agrawal <45819170+Achint-Agrawal@users.noreply.github.com>
Co-authored-by: Nimit Shah <nimit.svnit@gmail.com>
Co-authored-by: SaurabhSharma-MSFT <38112130+SaurabhSharma-MSFT@users.noreply.github.com>
Co-authored-by: leminh98 <leminh.ams@gmail.com>
Co-authored-by: Minh Le <leminh@microsoft.com>
Co-authored-by: Nalu Tripician <27316859+NaluTripician@users.noreply.github.com>
Co-authored-by: Scott Addie <10702007+scottaddie@users.noreply.github.com>
Co-authored-by: Kevin Pilch <me@pilchie.com>
Co-authored-by: Amaan-Haque <54414760+Amaan-Haque@users.noreply.github.com>
Co-authored-by: Amaan Haque <t-amaanhaque@microsoft.com>
Co-authored-by: Amaan Haque <amaanhaque@microsoft.com>
Co-authored-by: Baltima <130716409+Baltima@users.noreply.github.com>
Co-authored-by: vipulvishal-ms <110802706+vipulvishal-ms@users.noreply.github.com>
Co-authored-by: Erik O'Leary <969938+onionhammer@users.noreply.github.com>
kirankumarkolli added a commit that referenced this pull request Jun 5, 2023
…v3 master and Cosmos.Direct v3.31.1 (#3893)

* [Internal] Client Telemetry: Fixes tests leaking environment variables (#3517)

* Adding log lines

* More logs

* Debugging further

* Removing other builds

* And more debugging

* Wrong build parameters

* Wrong category

* Removing noise

* Fixing test

* Adding utils

* Adding test with client telemetry enabled

* Fixing leak in Client Telemetry Tests

* Reenabling test

* cpu monitor initialization

* Adding name details

* Undo another file

* Updated change log and bumped up the version. (#3526)

* Query: Fixes performance regression on target partition on some ORDER BY queries with continuation (#3525)

* Revert performance regression caused by #1289

* Remove irrelevant comment

* Add a test for validating formatted filters for the target partition

* [Internal] AI Integration: Adds SubStatusCode Information in attributes (#3533)

* wip

* regenerated baseline

* add test

* fix test

Co-authored-by: Sourabh Jain <sourabhjain@microsoft.com>

* Diagnostics: Removes unused properties and reduces size (#3519)

* Remove starttime and id from diagnostics string

* Remove starttime and id from diagnostics string

* Update xml files for trace baseline tests

* Update xml files for trace baseline tests

* Update xml files for trace baseline tests

* Whitespaces update

* Changed starttime position based on code review

Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>

* [Internal] docs: Add address caches conceptual flow (#3534)

* Rough draft

* Some more changes

* Adding a new section

* Some more refinement

* Some changes 

Lets get the feedback

* Some MISC changes

* Release: Adds SDK version and changelog for 3.31.2 (#3546)

* Bumped SDK version and changelog

* Added contracts file for 3.31.2

* [Internal] Documentation: Removes invalid comment from ReadThroughputAsync (#3516)

* [Internal] nugetconfig: Removes specific overrides (#3551)

* Query: Fixes partition range evaluation for spatial queries (#3495)

* Initial commit

* Update.

* Pull/Rebase

* Addressed comments.

* Build fix

* [Internal] Documentation: Refactors cache content on its own document (#3554)

* Add cache file

* Moving content away

* [Internal] Emulator unit tests: Adds IdEncoding unit tests for ComputeGateway (#3556)

* Adding IdEncoding unit tests for ComputeGateway

* Reacting to code review feedback

* Updating md files

* Change Feed Processor: Adds support for Resource Tokens (#3566)

* Adding rid parsing

* Test

* Removing dead code

* Contract update

* [Internal] AI integration: Refactor code how container and database name is flowing to opentelemetry module (#3532)

* wip

* WIP

* Revert "WIP"

This reverts commit 71275de.

* Revert "wip"

This reverts commit 586fa98.

* wip add containe and database info

* redesign how container and database name information flows into opne telemetry data

* test fix

* fix test

* fix tests

* fix typos

* baseline test fix

Co-authored-by: Sourabh Jain <sourabhjain@microsoft.com>

* [Internal] AI Integration: Adds a new flag in DistributedTracingOptions (#3562)

* add flag in diagnostic options

* test fixes

* rename variable

* test fix

* add validation

* fix baseline

* test fix

Co-authored-by: Sourabh Jain <sourabhjain@microsoft.com>

* Query: Fixes default to BadRequestException in case of internal errors in ServiceInterop (#3399)

* Don't default to BadRequestException in case of errors in ServiceInterop

* Incorporate code review feedback

* Fix build error

* fix up failing test

* [Internal] Query: Adds unit tests for Merge/Split implementation with OptimisticDirectExecution pipeline (#3510)

* Added tests to test different aspects of merge/split support with OptimisticDirectExecution pipeline. Tests check for gone exception handling, pipeline switching etc.

* Added gone exception simulation tests.

* Added new tests and improved test infra

* Removed ParalleContEvocation test. Fixed comments

* Removed CreateParallelCrossPartitionPipelineStateAsync() as it is not being used anymore

* Removed while loop in CreateDocumentContainerAsync()

* Fixed comments.

* Updated ExecuteGoneExceptionOnODEPipeline()

* Added type Assert for ExecuteGoneExceptionOnODEPipeline()

* Updated OptimisticDirectExecution pipeline abbreviation

* Updated TestBaseline folder with new xml

* Client Retry Policy: Adds HTTP timeouts with request-level cross-region retry (#3555)

* Fixes to ReadThroughputAsync for databases with no provisioned throughput and null as request options

* fixed failure to ReadReplaceThroughputResponseTests

* Added Stream Method

* Ran UpdateContract.ps1

* Encryption implemtation

* Fixed spelling error

* Update Microsoft.Azure.Cosmos.Encryption/src/EncryptionDatabase.cs

Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>

* Variable name change

* Update Microsoft.Azure.Cosmos/src/Resource/Database/Database.cs

Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>

* Suggested Changes and fixes

* Removed manufactured ResponseMessage + nits

* Simplified PR

* nits

* nits

* initial changes TODO: Update tests

* updated tests

* nits'

* Ran UpdateContracts.ps1

* nits + requested changes

* Delete NuGet.Config

* Update Microsoft.Azure.Cosmos/src/HttpClient/CosmosHttpClientCore.cs

Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>

* Update Microsoft.Azure.Cosmos/src/HttpClient/HttpTimeoutPolicy.cs

Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>

* Update Microsoft.Azure.Cosmos/src/HttpClient/HttpTimeoutPolicy.cs

Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>

* Update Microsoft.Azure.Cosmos/src/HttpClient/HttpTimeoutPolicy.cs

Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>

* Use Cosmos Exception Factory, Simplified Tests

* removed unused code

* nits: removed unused code

* removed unused code

Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>
Co-authored-by: Nalu Tripician <ntripician@microsoft.com>

* Documentation: Fixes EUAP in Comments (#3579)

* Query: Fixes incorrect FeedResponse.Count when result contains undefined elements (#3574)

* Do not maintain an independent count on QueryResponse that can go out of sync

* Add more test coverage for QueryResponse<T>.Count

* Output the correct count from CosmosElementSerializer when the input contains CosmosUndefined

* Add untyped tests for CosmosUndefined

* Remove commented code

* removed allr eference (#3581)

Co-authored-by: Sourabh Jain <sourabhjain@microsoft.com>

* Trace: Fixes Tracing/diagnostics hour-times to 24Hours (#3577)

* Trace: Fixes Tracing/diagnostics hour-times to 24Hours

* fixing baseline tests

Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>

* AI Integration: Adds cosmetic fixes (#3576)

* wip

* status code int and internal and client kind activity

* remove unused imports

* update baselines

* fix test

* fixed baseline tests

* fix tests

* update base tetss

Co-authored-by: Sourabh Jain <sourabhjain@microsoft.com>

* Query: Adds ALL Scalar Expression (#3509)

* Add SqlAllScalarExpression to v3 DOM

* updated generated parser files

* Parsing for ALL

* Added tests for ALL and baselines

* Added more tests

* added new test, cleanup

* cleaning & fix typos

* fixed typo

* Added new baseline test file names to csproj file

* renamed AggregateAll to AggregateSubquery to accomodate FIRST and LAST later

* Added keywords for 'left' and 'right' and respective function calls

* fixed bug from last commit

* cleaning

* replace tabs with spaces

* cleaning

* Release: Adds API contracts for 3.31.2-preview (#3586)

* [Internal] sccignore: Adds a .sccignore file to apply an exception for artifacts configuration issues (#3589)

* [Internal] PermissionTests: Adds CosmosPermissionTests Coverage (#3593)

* Ensures that both Direct and Gateway connection modes are tested
* Validates that container read works with PermissionMode.Read (test was previously only validating that Delete was blocked - i.e. the negative case).

* [Internal] AI Integration: Refactors to Operation prefix and add tests (#3583)

* add tests for otel and custome listener

* clean up

* null pointer fix

* fix tets

* handle event generation also at operation level

* added documentation

* wip

* change event sourcename

* rename event Name

Co-authored-by: Sourabh Jain <sourabhjain@microsoft.com>

* [Internal] HttpTimeoutPolicy: Removes Data Plane Writes from being able to be retried (#3607)

* data plane writes no longer failover on timeout

* removed duplication of test\

* [Internal] Performance Testing: Adds Distributed Tracing option in benchmarks (#3611)

Co-authored-by: Sourabh Jain <sourabhjain@microsoft.com>

* [Internal] Benchmark: Refactors code to make Memory Stream capacity configurable (#3624)

Co-authored-by: Sourabh Jain <sourabhjain@microsoft.com>

* add new LatestVersion changefeed mode that has same behavior as Incremental; renamed FullFidelity to AllVersionsAndDeletes (#3596)

* Query: Fixes handling of CosmosUndefined, CosmosGuid and CosmosBinary in unordered DISTINCT (#3632)

* Handle CosmosUndefined, CosmosGuid and CosmosBinary in DistinctMap.UnorderedDistinctMap

* Address code review feedback and remove unnecessary allocations from DistinctQueryPipelineStageTests

* [Internal] Subpartitioning: Adds updates to test coverage for subpartitioning (#3618)

* updates to test coverage for subpartitioning

* bug fixes

* now useses Assert.ThrowsException

* Seperated into multiple tests for clarity

* Put MultiHash test into seperate test file

* nit

* [Internal] ContainerProperties: Fixes version reset when setting PartitionKeyPath (#3637)

* Remember previous value

* test

* [Internal] AI Integration: Adds CorrelationId and Activity Id Attributes for query operation (#3630)

* add activityid in Otel attributes

* added correlation id

* operation type fix

* remove test changes

* test fix

* fix baseline test

* rename correlationId

* fix tests again

* include only not null attributes in test

* fixed tests

* changefeedxml

* test fix

* ordering activity in operationname oerder

* fix test

* review comments

* refator header getter setter

* clean up

Co-authored-by: Sourabh Jain <sourabhjain@microsoft.com>

* Documentation: Fixes CosmosClientBuilder.WithConnectionModeGateway parameter description (#3643)

* Fixed CosmosClientBuilder.WithConnectionModeGateway documentation

* Update Microsoft.Azure.Cosmos/src/Fluent/CosmosClientBuilder.cs

Co-authored-by: Ruben Bartelink <ruben@bartelink.com>

Co-authored-by: Augsten <aaugsten@harbourvest.com>
Co-authored-by: Ruben Bartelink <ruben@bartelink.com>

* Upgrade Resiliency: Refactors Implementation for Opening Rntbd Connections to Backend Replicas in Direct Mode. (#3640)

* Code changes to refactor implementations for opening connections to all replicas. Fixed test failures due to Direct package upgrade.

* Code changes to add poland central region as a part of Regions.cs

* Code changes to update contract to reflect new regions.

* Revert "Code changes to update contract to reflect new regions."

This reverts commit f171b3c.

* Revert "Code changes to add poland central region as a part of Regions.cs"

This reverts commit 1aafbf1.

* [Preview] AI integration: Adds IsDistributedTracingEnabled flag as public API to enable/disable this feature (#3598)

* make api public for preview

* add null check

* fix tests

* singleton listener initialization

* assign null to listeners

* fix test

* concurrent bag in listener

* renamed to LatencyThresholdForDiagnosticEvent

* renamed to IsDistributedTracingEnabled

* updated xml

* update contract

* made latency threshold flag internal

* fix test

* regeneratebaselines

* update documentation

* rename builder api

* add docs

* updated contracts and all

* doc update

* import cleanup

Co-authored-by: Sourabh Jain <sourabhjain@microsoft.com>

* Change Feed Processor: Fixes behavior with StartTime on Local (#3645)

* To UTC

* Test

* [Internal] Client Telemetry: Refactors code to use base useragent string (#3653)

* [Internal] AI Integration: Refactors code to rename event name (#3648)

* first draft

* rename event name

* updated xmls

* update files

* Region Availability: Adds Poland Central Region For Public Usage (#3656)

* Client Encryption: Adds validation code to check if the Key Vault URI provided in wrap metadata is a valid key identifier. (#3642)

* Check if the key vault uri provided is a valid Kid

* test fix.

* update changelog and build props

* Update Directory.Build.props

* Update Microsoft.Azure.Cosmos.Encryption.csproj

* Fixed preview version

* Refactor

* Update EncryptionDatabaseExtensions.cs

* [Internal] Query: Adds Split Support for Ode (#3572)

* Added tests to test different aspects of merge/split support with OptimisticDirectExecution pipeline. Tests check for gone exception handling, pipeline switching etc.

* Added gone exception simulation tests.

* Added new tests and improved test infra

* Removed ParalleContEvocation test. Fixed comments

* Removed CreateParallelCrossPartitionPipelineStateAsync() as it is not being used anymore

* Removed while loop in CreateDocumentContainerAsync()

* Fixed comments.

* Updated ExecuteGoneExceptionOnODEPipeline()

* Added type Assert for ExecuteGoneExceptionOnODEPipeline()

* Replaced try-catch with if statement in MoveNextAsync()

* Added delegate to access TryCreateCoreContextAsync()

* Added check to confirm Ode pipeline is not called in fallback plan

* Updated method name from OptimisticDirectExecutionContext() to TryCreateOptimisticDirectExecutionContext()

* Using delegate instead of Func<>.

* Ode fallback plan always calls Specialized pipeline

* Using ServiceInterop/Gateway to get QueryPlan for Specialized Pipeline

* Added new test to check handling of failing fallback pipeline

* Code cleanup

* Added logic for handling non ODE continuation tokens

* Moved delegate away from member variables

* Added tests for Merge case

* Updated method names

* Added checks for tryCatch

* Updated SetCancellationToken() to use Try

* Updated TryUnwrapContinuationToken()

* Removed changes in FlakyDocumentContainer.cs

* Removed unused imports

* Updated comments

* Fixed comments and cleaned up test code

* Added CosmosElement null check in TryUnwrapContinuationToken()

* Removed FlakyDocumentContainer.cs from pull request

* Removed unused imports

* Updated TryUnwrapContinuationToken()

* Update MoveNextAsync() call in OptimisticDirectExecutionQueryBaselineTests.cs

* Made MergeTestUtil.IsFailedFallbackPipelineTest a readonly property

* Added IsPartitionSplitException() overload to take CosmosElement

* Fixed bug regarding syntax error queries

* [Internal] AI Integration : Fixes operation type  for batch (#3660)

* fix op type

* fix conflict

* CosmosClientOptions: Adds ServerCertificateCustomValidationCallback for Http and TCP (#3636)

* Adding ServerCertificateCustomValidationCallback in clientoptions

* Adding Server callback for Http and fixing tests

* Fixing failing E2Etests

* Resolving merge conflicts

* Running update contracts script

* Running Update contracts script

* Running Update contracts script

* Reverting the v3 version change

* Update based on review comments

* Added unit tests

* Added remarks for callback delegate

* Ran update contracts script

* Update based on review comments

* Ran update contracts script

* Updated unit tests

* Making ssl validation function private

* Updating test files

* Update remarks for sslvalidation public contract

* Added emulator tests for server validation

Co-authored-by: Debdatta Kunda <87335885+kundadebdatta@users.noreply.github.com>

* Query: Adds EnableOptimisticDirectExecution flag to QueryRequestOptions (#3664)

* Added new flag to QueryRequestOptions to allow customers to use Ode pipeline

* Updated comments in QueryRequestOptions.cs

* Renamed enabledOde to enableOde

* Removed default setting for EnableOptimisticDirectExecution

* [Internal] Tests: Removes Direct/HTTPS emulator tests (#3679)

* Removing direct/https tests

* mppreference

* [Internal] Benchmark : Fixes issue with dependency on Cosmos Project (#3673)

* users/sourabhjain/benchmarkfix

* update pipeline

* Revert "users/sourabhjain/benchmarkfix"

This reverts commit 81b48f0.

* fix compilation error

* add parama for preview pkg also

---------

Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>

* LocalQuorum: Adds Quorum reads on Consistent Prefix Accounts (#3680)

Co-authored-by: DESKTOP-ED57J7H\Prashanth Venkataram <vprashanth1987@hotmail.com>

* 3.32.0: Adds new SDK version and contract files (#3687)

* 3.32.0: Adds new SDK version and contract files

* 3.32.0: Adds new SDK version and contract files

* Updating changelog version

* Updating changelog version

* Added more commits to changelog and updated release contract

* Added documentation tags PR in changelog

* Updated changelog based on reviews

* Updated PR decsription in changelog

* Update changelog.md

Updated full fidelity change description

Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>

---------

Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>

* [Internal] Samples: Adds change feed pull model samples (#3646)

* add change feed pull samples

* refactor appsettings validation

* addressing pr comments

* move task delay

* update sample to use latest change feed mode names

---------

Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>

* [Internal] Tests: Refactors emulator CI (#3688)

* [Internal] GitHub Template: Adds needs-investigation label (#3708)

By default, all "Bug report" issues will have "needs-investigation"

* Adding fabric bot action (#3709)

* CosmosNullReferenceException: Refactors CosmosNullReferenceException to pass along InnerException property on parent NullReferenceException (#3713)

* Passed inner exception details to NullReferenceException ctor when instantiating CosmosNullReferenceException.

* Added unit tests.

* Addressed PR feedback.

* [Internal] PriorityRequests: Fixes header value (#3714)

Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>

* [Internal] Query: Adds single physical partition check for OptimisticDirectExecution queries (#3699)

* Added single physical partition check for Ode queries. Updated test infrastructure for Ode emulator tests too.

* Refactored emulator tests to have all the test cases at the top of the file

* Updated TryGetTargetRangeOptimisticDirectExecutionAsync()

* Uodated logic on how many times CreateIngestQueryDeleteAsync() gets called

* Added debug asserts for partitionKeyDefinition

* Added pageSizeOptions parameter in CreateInput() in EmulatorTests

* Fixed comments

* [Internal] CTL: Fixes Reservoir Sampling Logic (#3712)

* Code changes to fix the reservoir sampling logic in CTL

* Code changes to modify help text on reservoir type.

* Code changes to address minor code refactor.

* Diagnostics: Adds startDate in Summary (#3707)

* Adding start date

* Updated trace files

* PR comment

* Committing missing tests

---------

Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>

* [Internal] Client Telemetry: Adds network information in the payload (#3691)

* first draft

* clean code

* add test

* fix test

* add replica info collection

* fix substatuscode and  operation type error

* fix code

* collect http infor in cache also

* message to stacktrace

* remove rntbd recording from cache

* print proper exception message

* fix test

* cleanup unused code and added few status codes in ignore list

* fixed all exception logging

* refactor conditions

* fix tests

* Documentation: Fixes Database.ReadAsync description (#3457)

* Documentation: Modify retry time to timespan 

Modify retry time in seconds to timespan of parameter maxRetryWaitTimeOnThrottledRequests (Method: [WithThrottlingRetryOptions](https://docs.microsoft.com/en-us/dotnet/api/microsoft.azure.cosmos.fluent.cosmosclientbuilder.withthrottlingretryoptions?view=azure-dotnet#feedback))
Resolves Azure/azure-sdk-for-net#29567

* Documentation: Fixes DeleteItemAsync Example

Documentation: Fixes DeleteItemAsync Example

* Documentation: Fixes ItemRequestOptions Example

Documentation: Fixes ItemRequestOptions Example

* Documentation:Update Database.ReadAsync description

Documentation: Update Database.ReadAsync description

* Documentation: Update Database.ReadAsync description

Documentation: Update Database.ReadAsync description

* Documentation: Updated ToStreamIterator example

Documentation: Updated ToStreamIterator example

* Modified StreamIterator section

* Update Microsoft.Azure.Cosmos/src/Resource/Database/Database.cs

Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>

* Remarks correction

* Revert the StreamIterator changes

Revert the StreamIterator changes

Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>
Co-authored-by: Kiran Kumar Kolli <kirankk@microsoft.com>

* Upgrade Resiliency: Adds Implementation for Validating the Unhealthy Backend Replicas in Direct mode (#3631)

* Code changes to implement replica validation in dotnet v3 sdk.

* Cosmetic changes to add inline code comments.

* Code chages to address review comments.

* Code changes to cover a scenario for async cache.

* Code changes to refactor async non-blocking cache code.

* Code changes to address minor review comments.

---------

Co-authored-by: Kiran Kumar Kolli <kirankk@microsoft.com>

* ReadMany: Fixes BadRequest when using Ids with single quotes (#3732)

* Use parameters

* Emulator tests

* Release: Adds SDK version and changelog for 3.32.1 (#3733)

* version bump

* Contracts

* [Internal] Build: Fixes static tool analysis versions (#3736)

* Update Binskim and follow warnings

* Fixing task

* More version bumps

* binskim args

* Padding

* policheck

* postanalysis parameters

* analysis settings

* Query: Fixes System.ArgumentException when using PartitionKey.None on x86, Linux or in Optimistic Direct Execution (#3730)

* Minor clean up of OptimisticDirectExecutionQueryTests

* More minor cleanup in OptimisticDirectExecutionQueryTests

* Add emulator tests for the bypass query parsing scenario

* Handle PartitionKey.None while creating QueryIterator. This is a workaround for the PartitionKeyInternal.None not following its own contract

* Fix up to correctly handle PartitionKey.None using the CachedContainerQueryProperties

* Add more tests where PartitionKey.None maps to PartitionKey.Undefined

---------

Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>

* Query: Adds FIRST and LAST Scalar Expressions (#3629)

* Add FIRST and LAST objects and update visitors

* add FIRST LAST evaluation and update offline engine visitors

* Add FIRST and LAST to parser

* update another visitor

* Fix typo

* fix typo

* added new tests and baselines

* cleaning

* cleaning

---------

Co-authored-by: neildsh <35383880+neildsh@users.noreply.github.com>
Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>

* Subpartitioning: Adds support for Prefix Partition Key searches for sub partitioned containers (#3109)

* 1st round of changes to support subpartitioning for ChangeFeed

* name change and moved a method to FeedRangePartitionKey

* support for prefix partition change feed and query including unit and emulator tests. need to verify using FeedRange with QueryIterator

* splitting out unit tests from emulator tests

* 1st round of changes to support subpartitioning for ChangeFeed

* name change and moved a method to FeedRangePartitionKey

* support for prefix partition change feed and query including unit and emulator tests. need to verify using FeedRange with QueryIterator

* splitting out unit tests from emulator tests

* moved logic to choose for prefix partition query and change feed

* additional conditional to check for MultiHash partitionkeydefinition kind

* removed unnecessary using

* cleanup

* unnecessary using

* removed PREVIEW from proj

* unit tests for ResolveFeedRangeBasedOnPrefixContainerAsync

* change access modifier

* since I changed to static, needed to fix tests

* dealing with some testing nits

* removed Console.Writeline

* slight change in test use containerProperties and partitionKeyDefinition

* big fix for resolve feedrange, changes to error behavior, added additional test coverage

* test changes

* ran updateContracts.ps1

* reverting to 3ad5309

* Ran Update Contracts

* ran updateContracts.ps1

* UpdateContracts.ps1

* updatecontracts

* removed bad check from test, removed changes from updatecontracts.ps1

* revert UpdateContracts changes

* Reverting to 756a123

* removed accidental change from changelog

* removed unwanted change from Directory.build.props

* added test clean up

* removed console.writelines

* updates to query test

* removed preview flag

* ran UpdateContrats.ps1

* no longer recread feedRange for queries unless using prefix pk

* simplified if statement

* fixed bug

---------

Co-authored-by: Nalu Tripician <nalutrip@icloud.com>

* [Internal] ClientTelemetry: Adds logic to limit payload size to 2 MB (#3717)

* first draft

wip

fix test and logic

* resolve conflicts

* limit 2 mb

* ad callback

* fix tests

* code refactor

* cosmos json to newtosoft json

* clean up files

* fix logging to argumrnt based

* code refactor

* add null check

* Query: Fixes regression from LINQ custom serializer fix (#3749)

Co-authored-by: Minh Le <leminh@microsoft.com>
Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>

* [Internal] LocalQuorum: Refactors override (i.e. strong) to allow from any account consistency (#3753)

- Localquorum override (i.e. strong) to allow from any account consistency
- Facilitates no-downtime downgrade of existing accounts (i.e. existing Strong/bounded accounts migration to Eventual)

* Release: Adds SDK version and change log for 3.32.2 (#3752)

* version bump

* contract

* changelog

* version bump

* Fixing changelog text

* Add another PR

* Subpartitioning: Adds APIs for public release and increase REST API version (#3763)

* initial commit, Http version issues still needs to be resolved

* updateContracts + update Http Version

* updateded version in test

* update contracts

* requested changed

* changed name in comments to subpartitioning from multihash

* undid changes to TestLiteralSerialization.xml

* removed changes to non API.json files

* removed non XXXAPI.json file changes

* changed verbage on public comments

* changed error message to reflect verbage change

* Change Feed Processor: Fixes LeaseLostException leaks on notification APIs for Renew scenarios (#3775)

* Adding cases

* Tests

* Upgrade Resiliency: Refactors GatewayAddressCache to Mark TransportAddresses to Unhealthy when Connection Reset Event Occurs (#3768)

* Code changes to mark the transport uri to unhealthy for which a connection reset event occures through the connection state listener.

* Code changes to bump up the direct version.

* Code changes to clean up Gateway Address Cache.

* Code changes to fix pipeline build.

* Code changes to fix serilization test failures.

* Code changes to add force refresh to the gateway function callback delegate.

* [Preview] PriorityBasedExecution: Adds PriorityLevel as a RequestOption (#3672)

* Added Priority Level as a Request Option

* Changed Priority Level Low and High to 1 and 2 respectively

* Bumped DirectVersion

* Added made PriorityLevel internal for non preview packages

* Deleted PriorityLevelTests.cs

* Added description of Priority Level in RequestOptions.cs

* Modified comments for PriorityLevel in RequestOptions.cs

* Updated Contracts

* Modified Remarks for PriorityLevel and added see also link.

* Updated contracts

---------

Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>

* [Internal] Client Telemetry: Adds sampling logic for network level telemetry (#3750)

* sampling logic add

* throttlinfix

* fix tests

* fix tests

* remove dispose from sampler

* add 412

* draft push

* refactor code for sampling

* clean up

* start testing

* adding tests

* wip

* test fix

* fix test

* fix tests

* deleted extra file

* remove one toList

* add custome logic for sampling

* code refactor

* replace key

* remove commented code from test

* added more comments

* simpler sampler logic

* refactor code

* [Internal] Emulator Test : Fixes test when running with distributed tracing enabled. (#3751)

* enable DT for everything

* try1

* code refactoring

* fix pipeline

* try 2

* Revert "try 2"

This reverts commit 61643f9.

* Revert "fix pipeline"

This reverts commit 4b217f5.

* Revert "code refactoring"

This reverts commit d1ff0dd.

* Revert "try1"

This reverts commit bf9c41b.

* lazy factory and threadsafe

* scope factory in function

* try non static

* add flag

* fix test

* add consoles

* more console with fix

* fix tests

* temporarily enable dt

* fuix tests

* dispose listener

* fix tests

* remove delay

* revert flag change

* dynamically get number of test in trace class

* Release: Adds SDK version and changelog for 3.32.3 (#3788)

* Adding contract and version bump

* Adding changelog

* SummaryDiagnostics: Refactors Code to Remove Dependency of HttpResponseHeadersWrapper to fetch Sub Status Codes (#3792)

* Code changes to fetch sub status code from http response/ content headers.

* Code changes to address review comments.

* Code changes to return the first element from the sub status list.

* Code changes to update first or default.

* [Internal] Documentation: Fixes API name to NoSQL (#3795)

* [Internal] CTL: Fixes docker image pipeline (#3794)

* [Internal] AI Integration : Refactors useragent attribute name as per Otel conventions (#3784)

Co-authored-by: Fabian Meiswinkel <fabian@meiswinkel.com>

* HttpClient: Adds Properties to the Http messages if available (#3803)

* Passing properties

* test

* Documentation: Refactors SQL API reference to NoSQL API (#3793)

Co-authored-by: Kiran Kumar Kolli <kirankk@microsoft.com>

* [Internal] Perf test: Refactors code to re-enable performance tests (#3785)

* enable perf tests

* updated json

* upgrade benchmark

* update results

* updated benchmark results

* HttpClient: Adds detection of DNS changes through use of SocketsHttpHandler for .NET 6 and above (#3762)

* initial commit

* removed unneeded usings

* added validation callback, still needs tests

* nits + fixes

* added additional test

* test change

* removed unneeded Dispose calls

* removed unnneed dispose calls

* requested changes

* added pooledConnectionLifetime as client option

* nit

Co-authored-by: Kevin Pilch <me@pilchie.com>

* Update Microsoft.Azure.Cosmos/src/HttpClient/CosmosHttpClientCore.cs

Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>

* Update Microsoft.Azure.Cosmos/src/CosmosClientOptions.cs

Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>

* suggested changes

* remove test, reorder usings

* updated contracts

* removed all non XXXAPI.json changes from UpdateContracts run

* removed public surface, added random timespan

* removed change from unrelated file

* Update Microsoft.Azure.Cosmos/src/HttpClient/CosmosHttpClientCore.cs

Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>

* added thread safe random method

* nit

* fixed merge mistake

* added reflection failsafe/error tracing

* nits

* added back removed if

* fixed formatting

* changed random method, fixed serverCertificateCustomValidation

---------

Co-authored-by: Kevin Pilch <me@pilchie.com>
Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>

* [Internal] Tests: Fixes Open Telemetry attributes for ReadMany test (#3805)

* Fixing test

* New baseline

* Undo some changes

* [Internal] Client Telemetry: Refactors code to run client telemetry data processing task in background. (#3783)

* first draft

* remove failure count test

* refactporing

* code refactor

* create task with timeout

* fix test

* code refactoring

* fix timeout code

* space fix

* not failing if processor is taking time

* fix procrsser test

* code refactor

* refactor and test fix

* Patch: Adds Move Operation (#3389)

* Basic changes to introduce move operator

* Added "from" object in patch spec operation.
Added testcase block.

* Fixed testcase.

* Changes made to address comments'

* Added comment regarding enum mutations

* Formatted comment

Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>

* Moved summary location.

* Ran UpdateContracts.ps1

---------

Co-authored-by: Amaan Haque <t-amaanhaque@microsoft.com>
Co-authored-by: Amaan Haque <amaanhaque@microsoft.com>
Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>

* [Internal] Pipelines: Adds nightly build to produce packages (#3802)

* Support cleaning

* wire previous content delete

* as text

* with variable

* another test

* param with types

* as string

* no delete

* no quotes

* undoing

* re-adding quotes

* testing empty

* trying another test

* readding version

* fixing publishing artifacts

* fixing parameter

* Fixing official pipeline

* version 5

* fixing main pipeline

* test with true

* using start time

* nightly preview

* passing parameters to pack

* Fixing nuget version

* arguments on the nuget pack

* folder structure

* testing v5

* Using only content

* Removing currentDate

* [Internal] OpenTelemetry: Direct Package update and replacing diagnostic files (#3797)

* Direct Package update and replacing dagnostic files

* Resolve merge conflicts

* Running updateCOnstracts script

* Removed LinqTranslationWithCustomSerializerBaseline file

* Adding isDistributedTracingEnabled flag

* Running update contracts

* Running update contracts

* Running update contracts

* fix test

* Code cleanup for test fix

* Code cleanup for test fix

* Making regex expression readable

* Adding comment for regex expression

---------

Co-authored-by: Sourabh Jain <sourabhjain@microsoft.com>

* [Internal] MerlinBot: Adds auto-merge and cleanup automation (#3813)

* Add config changes

* Polishing automerge config

* Update fabricbot.json (#3824)

* [Internal] Upgrade Resiliency: Adds Logic to Validate `Unknown` Replicas along with `Unhealthy`. (#3820)

* Code changes to add aggressive validation logic.

* Code changes to enable aggressive validation for all regions.

* Code changes to pull in msdata cosmos.direct changes related to aggresive validation logic.

* Code changes to make minor cosmetic changes.

* Code changes to address review comments.

* Serialization: Fixes call to CosmosSerializer.FromStream on Gateway mode when EnableContentResponseOnWrite is false (#3814)

* Do not call serializer if ResponseMessage.Content is empty.

* Add unit test

* Update unit tests

* Remove unused usings

---------

Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>

* [Internal] Documentation: Adds documentation covering build pipelines (#3822)

* Add doc

* Move benchmark

* Fixing texts

* Client Encryption: Adds release version of Microsoft.Azure.Cosmos to Microsoft.Azure.Cosmos.Encryption.Custom (#3799)

* cosmos version change

* changing preview to release

* resolving code review comments

---------

Co-authored-by: Santosh Kulkarni <66682828+kr-santosh@users.noreply.github.com>

* SDK 3.33.0 : Adds version bump and changelog (#3823)

* release 3.30.0

* added changelog

* updated changelog

* updated changelog

* suggested change to changelog

* updated changelog

---------

Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>

* [Internal] Documentation: Adds msdata/direct Sync-up Guide. (#3828)

* Code changes to add msdata/direct sync-up documentation.

* Code changes to address review comments.

* Code changes to address further review comments.

* Code changes to address minor review comments.

* Removed internal links.

* Query: Adds TRIM string system function support in LINQ (#3833)

* add trim support

* Added some test coverage

* address reviews

---------

Co-authored-by: Minh Le <leminh@microsoft.com>

* Query: Fixes Parsing Error in SQL DOM when CultureInfo is available (#3832)

* add fix

* Add cultural info to test to verify correct behavior

* address pr review to restore to restore culture

* fix comment

---------

Co-authored-by: Minh Le <leminh@microsoft.com>

* Client Encryption: Adds api FetchDataEncryptionKeyWithoutRawKeyAsync and FetchDataEncryptionKeyAsync to get DEK without and with raw key respectively.  (#3809)

* added raw key to MdeEncryption

* adding ray key to Mde Algo

* test case changes

* resolving code review comments

* code optimization to reduce keyvault calls

* removed Microsoft.Data.Encryption.Cryptography nuget package

* added api for dek with raw key

* resolved code review comments

* adding change log

* code review changes

* Initial commit (#3826)

* Query: Adds Computed Property SDK Support (#3761)

* Initial commit

* Restored settings.json changes.

* Update

* Addressed comments; still need to be tested using Emulator.

* Fixes after test run.

* Ignored the computed property tests based on the sync this morning (to allow for preview release).

* Suite0 fixes.

* Test update.

* Suite0 fixes

* [Internal] Samples: Adds OpenTelemetry and Application Insights samples (#3818)

* add opentelemetry and application insights samples

* address pr comments

* [Internal] Query: Added custom serializer coverage tests to ExpressionToSQL.cs (#3722)

* Ensure enum as string is preserved for custom serializer

* Failing test

* Added failing tests

* Updated requested names

* Ignore result of test for now

* Added additional comment on why the test is ignored

* Replaced with sample code

* Remove ignore attribute from tests, documented misbehavior for future use

* Updated comment

---------

Co-authored-by: leminh98 <leminh.ams@gmail.com>

* Query: Added remaining Cosmos Type checking functions to CosmosLinqExtensions (#3724)

* Added the remaining Cosmos Type checking functions to the CosmosLinqExtensions

* Added comments requested

* Updated comment

* Updated baseline

* Improve readability of dictionary initialization

* Aligned with code style guide

* Revert change to baseline

* Executed update baseline script

---------

Co-authored-by: neildsh <35383880+neildsh@users.noreply.github.com>
Co-authored-by: leminh98 <leminh.ams@gmail.com>

* update sdk version and section tags (#3841)

* PackageLicense: Removes PackageLicenseUrl and Adds PackageLicenseFile since PackageLicenseUrl is deprecated (#3847)

* proposal to add PackageLicenseFile since PackageLicenseUrl is deprecated. NuGet/Home#4628

* adding attribute Visible=false

* making ChangeFeedMode.LatestVersion accessible to the public (#3854)

* AI Integration: Fixes Operation Name in the activity and end to end Tests. (#3845)

* first draft

* second draft

* 3rd draft

* remove untouched file

* test fix

* fix order

* change order

* refactor

* skip network activities in test

* remove network attributes

* SDK 3.34.0 : Adds version bump and changelog (#3855)

* SDK 3.34.0: Adds version bump and changelog

* adding changelog changes

* added a missing PREVIEW PR

* Update changelog.md

Co-authored-by: Justine Cocchi <jucocchi@microsoft.com>

* Update changelog.md

Co-authored-by: Kiran Kumar Kolli <kirankk@microsoft.com>

* removed 3840 as it was not committed

* change text for 3832

* fix merge issue

* add 3724

* Update changelog.md

Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>

* Update changelog.md

Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>

* including 3845

---------

Co-authored-by: Justine Cocchi <jucocchi@microsoft.com>
Co-authored-by: Kiran Kumar Kolli <kirankk@microsoft.com>
Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>

* Release: Fixes changelog.md change for 3845 to preview (#3859)

* removing ThirdPartyNotice.txt from content and contentfiles folders (#3864)

* Documentation: Adds see also link to Container.CreateTransactionalBatch (#3860)

* Linking limit documentation to Container.CreateTransactionalBatch(PartitionKey) method

* Resolved PR comments

* Links update

* Using learn.microsoft instead of docs.microsoft in the links

---------

Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>

* Query: Adds type-markers with count and length for large arrays (#3852)

* initial commit

* cleanup

* update test output

* cleanup

* typo

* Pr comments

* [Internal] AI Integration or Open Telemetry: Design Document (#3858)

* first draft

* redesign

* ädd link

* updated observability url

* Benchmarking: Adds use of ARM Templates for benchmarking (#3838)

* initial commit DONT REVIEW

* fixes and documentation

* Apply suggestions from code review

Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>

* requested changes

* Apply suggestions from code review

Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>

* name changes

* readme changes

* nits + changing case of parameters file

---------

Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>

* Update README.md (#3875)

URL typo.

* moved to new file (#3876)

* Direct Package Upgrade 3.31.0: Refactors code to make compatible with latest direct (#3877)

* upgrade to 3.31.0

* add more regions

* enable dt for operations

* updated contract file

* [Preview] Integrated cache: Adds BypassIntegratedCache to DedicatedGatewayRequestOptions (#3836)

* Integrated cache: Add BypassIntegratedCache to DedicatedGatewayRequestOptions

Currently, integrated cache is used by default for Dedicated Gateway.
Customers cannot skip cache for particular requests or data unless they
shift to multi-tenant Gateway,which will lose the benefits of Dedicated
Gateway.

For customers to have more control over integrated cache, we're
introducing a new "RequestOption" called "BypassIntegratedCache". This
option will allow the customer to decide whether to use integrated cache
for each request or not. If this value is set to true, the item/query
will be served from backend and won't be cached in Dedicated Gateway.

* Move this feature to public preview

* Address comments

1. Add more tests
2. Add more detail and example code for BypassIntegratedCache

* Revert changes in EncryptionCustomAPI

---------

Co-authored-by: Jiajun Peng <jiajunpeng@microsoft.com>
Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>

* Client Encryption: Adds Microsoft.Azure.Cosmos compatibility to version 3.34.0 (#3874)

* chaging Microsoft.Azure.Cosmos support version

* resolved merge conflicts

* CosmosClient: Fixes missing Trace when converting HTTP Timeout to 503 (#3866)

* Added tracing when converting HTTP Timeout to 503

* Fixed tracing when converting HTTP Timeout to 503

* Resolved PR comments

* Using ITrace as part of ClientSideRequestStatisticsTraceDatum

* Refactoring

* Test update

* Unit tests fix

* AI Integration: Fixes Open Telemetry Example (#3868)

* first draft

* add filter

* revert csproj

* fix sample

* changed log message

* remove unused library

* Code changes to sync up msdata/direct with latest direct release and v3 master.

---------

Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>
Co-authored-by: neildsh <35383880+neildsh@users.noreply.github.com>
Co-authored-by: Sourabh Jain <sourabh.jain.107@gmail.com>
Co-authored-by: Sourabh Jain <sourabhjain@microsoft.com>
Co-authored-by: aavasthy <113193425+aavasthy@users.noreply.github.com>
Co-authored-by: Kiran Kumar Kolli <kirankk@microsoft.com>
Co-authored-by: Aditya <adityasa@users.noreply.github.com>
Co-authored-by: Fabian Meiswinkel <fabian@meiswinkel.com>
Co-authored-by: akotalwar <94020786+akotalwar@users.noreply.github.com>
Co-authored-by: Nalu Tripician <nalutrip@icloud.com>
Co-authored-by: Nalu Tripician <ntripician@microsoft.com>
Co-authored-by: Pramod Valavala <43602528+PramodValavala-MSFT@users.noreply.github.com>
Co-authored-by: Ezra Haleva <115735172+ezrahaleva-msft@users.noreply.github.com>
Co-authored-by: Vivek Ravindran <vivekra@microsoft.com>
Co-authored-by: Prasad Ullal <36418906+prasadu-microsoft@users.noreply.github.com>
Co-authored-by: Philip Thomas <86612891+philipthomas-MSFT@users.noreply.github.com>
Co-authored-by: Arthur Augsten <arthuraugsten@gmail.com>
Co-authored-by: Augsten <aaugsten@harbourvest.com>
Co-authored-by: Ruben Bartelink <ruben@bartelink.com>
Co-authored-by: Santosh Kulkarni <66682828+kr-santosh@users.noreply.github.com>
Co-authored-by: pravengithub <124255233+pravengithub@users.noreply.github.com>
Co-authored-by: DESKTOP-ED57J7H\Prashanth Venkataram <vprashanth1987@hotmail.com>
Co-authored-by: Justine Cocchi <jucocchi@microsoft.com>
Co-authored-by: Abhijeet Mohanty <mabhijeet1995@gmail.com>
Co-authored-by: Achint-Agrawal <45819170+Achint-Agrawal@users.noreply.github.com>
Co-authored-by: Nimit Shah <nimit.svnit@gmail.com>
Co-authored-by: SaurabhSharma-MSFT <38112130+SaurabhSharma-MSFT@users.noreply.github.com>
Co-authored-by: leminh98 <leminh.ams@gmail.com>
Co-authored-by: Minh Le <leminh@microsoft.com>
Co-authored-by: Nalu Tripician <27316859+NaluTripician@users.noreply.github.com>
Co-authored-by: Scott Addie <10702007+scottaddie@users.noreply.github.com>
Co-authored-by: Kevin Pilch <me@pilchie.com>
Co-authored-by: Amaan-Haque <54414760+Amaan-Haque@users.noreply.github.com>
Co-authored-by: Amaan Haque <t-amaanhaque@microsoft.com>
Co-authored-by: Amaan Haque <amaanhaque@microsoft.com>
Co-authored-by: Baltima <130716409+Baltima@users.noreply.github.com>
Co-authored-by: vipulvishal-ms <110802706+vipulvishal-ms@users.noreply.github.com>
Co-authored-by: Erik O'Leary <969938+onionhammer@users.noreply.github.com>
Co-authored-by: Rinat Minibaev <132935507+rinatmini@users.noreply.github.com>
Co-authored-by: Maya-Painter <130110800+Maya-Painter@users.noreply.github.com>
Co-authored-by: jiajunpeng-msft <32749342+jiajunpeng-msft@users.noreply.github.com>
Co-authored-by: Jiajun Peng <jiajunpeng@microsoft.com>
kirankumarkolli added a commit that referenced this pull request Jun 20, 2023
…v3 master and Cosmos.Direct v3.31.2 (#3925)

* [Internal] Client Telemetry: Fixes tests leaking environment variables (#3517)

* Adding log lines

* More logs

* Debugging further

* Removing other builds

* And more debugging

* Wrong build parameters

* Wrong category

* Removing noise

* Fixing test

* Adding utils

* Adding test with client telemetry enabled

* Fixing leak in Client Telemetry Tests

* Reenabling test

* cpu monitor initialization

* Adding name details

* Undo another file

* Updated change log and bumped up the version. (#3526)

* Query: Fixes performance regression on target partition on some ORDER BY queries with continuation (#3525)

* Revert performance regression caused by https://github.com/Azure/azure-cosmos-dotnet-v3/pull/1289/

* Remove irrelevant comment

* Add a test for validating formatted filters for the target partition

* [Internal] AI Integration: Adds SubStatusCode Information in attributes (#3533)

* wip

* regenerated baseline

* add test

* fix test

Co-authored-by: Sourabh Jain <sourabhjain@microsoft.com>

* Diagnostics: Removes unused properties and reduces size (#3519)

* Remove starttime and id from diagnostics string

* Remove starttime and id from diagnostics string

* Update xml files for trace baseline tests

* Update xml files for trace baseline tests

* Update xml files for trace baseline tests

* Whitespaces update

* Changed starttime position based on code review

Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>

* [Internal] docs: Add address caches conceptual flow (#3534)

* Rough draft

* Some more changes

* Adding a new section

* Some more refinement

* Some changes 

Lets get the feedback

* Some MISC changes

* Release: Adds SDK version and changelog for 3.31.2 (#3546)

* Bumped SDK version and changelog

* Added contracts file for 3.31.2

* [Internal] Documentation: Removes invalid comment from ReadThroughputAsync (#3516)

* [Internal] nugetconfig: Removes specific overrides (#3551)

* Query: Fixes partition range evaluation for spatial queries (#3495)

* Initial commit

* Update.

* Pull/Rebase

* Addressed comments.

* Build fix

* [Internal] Documentation: Refactors cache content on its own document (#3554)

* Add cache file

* Moving content away

* [Internal] Emulator unit tests: Adds IdEncoding unit tests for ComputeGateway (#3556)

* Adding IdEncoding unit tests for ComputeGateway

* Reacting to code review feedback

* Updating md files

* Change Feed Processor: Adds support for Resource Tokens (#3566)

* Adding rid parsing

* Test

* Removing dead code

* Contract update

* [Internal] AI integration: Refactor code how container and database name is flowing to opentelemetry module (#3532)

* wip

* WIP

* Revert "WIP"

This reverts commit 71275de54b9e67fa54a37e79d450b9597e173934.

* Revert "wip"

This reverts commit 586fa9865cc3f40dabd7ef90fb3e0cf499a045bc.

* wip add containe and database info

* redesign how container and database name information flows into opne telemetry data

* test fix

* fix test

* fix tests

* fix typos

* baseline test fix

Co-authored-by: Sourabh Jain <sourabhjain@microsoft.com>

* [Internal] AI Integration: Adds a new flag in DistributedTracingOptions (#3562)

* add flag in diagnostic options

* test fixes

* rename variable

* test fix

* add validation

* fix baseline

* test fix

Co-authored-by: Sourabh Jain <sourabhjain@microsoft.com>

* Query: Fixes default to BadRequestException in case of internal errors in ServiceInterop (#3399)

* Don't default to BadRequestException in case of errors in ServiceInterop

* Incorporate code review feedback

* Fix build error

* fix up failing test

* [Internal] Query: Adds unit tests for Merge/Split implementation with OptimisticDirectExecution pipeline (#3510)

* Added tests to test different aspects of merge/split support with OptimisticDirectExecution pipeline. Tests check for gone exception handling, pipeline switching etc.

* Added gone exception simulation tests.

* Added new tests and improved test infra

* Removed ParalleContEvocation test. Fixed comments

* Removed CreateParallelCrossPartitionPipelineStateAsync() as it is not being used anymore

* Removed while loop in CreateDocumentContainerAsync()

* Fixed comments.

* Updated ExecuteGoneExceptionOnODEPipeline()

* Added type Assert for ExecuteGoneExceptionOnODEPipeline()

* Updated OptimisticDirectExecution pipeline abbreviation

* Updated TestBaseline folder with new xml

* Client Retry Policy: Adds HTTP timeouts with request-level cross-region retry (#3555)

* Fixes to ReadThroughputAsync for databases with no provisioned throughput and null as request options

* fixed failure to ReadReplaceThroughputResponseTests

* Added Stream Method

* Ran UpdateContract.ps1

* Encryption implemtation

* Fixed spelling error

* Update Microsoft.Azure.Cosmos.Encryption/src/EncryptionDatabase.cs

Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>

* Variable name change

* Update Microsoft.Azure.Cosmos/src/Resource/Database/Database.cs

Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>

* Suggested Changes and fixes

* Removed manufactured ResponseMessage + nits

* Simplified PR

* nits

* nits

* initial changes TODO: Update tests

* updated tests

* nits'

* Ran UpdateContracts.ps1

* nits + requested changes

* Delete NuGet.Config

* Update Microsoft.Azure.Cosmos/src/HttpClient/CosmosHttpClientCore.cs

Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>

* Update Microsoft.Azure.Cosmos/src/HttpClient/HttpTimeoutPolicy.cs

Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>

* Update Microsoft.Azure.Cosmos/src/HttpClient/HttpTimeoutPolicy.cs

Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>

* Update Microsoft.Azure.Cosmos/src/HttpClient/HttpTimeoutPolicy.cs

Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>

* Use Cosmos Exception Factory, Simplified Tests

* removed unused code

* nits: removed unused code

* removed unused code

Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>
Co-authored-by: Nalu Tripician <ntripician@microsoft.com>

* Documentation: Fixes EUAP in Comments (#3579)

* Query: Fixes incorrect FeedResponse.Count when result contains undefined elements (#3574)

* Do not maintain an independent count on QueryResponse that can go out of sync

* Add more test coverage for QueryResponse<T>.Count

* Output the correct count from CosmosElementSerializer when the input contains CosmosUndefined

* Add untyped tests for CosmosUndefined

* Remove commented code

* removed allr eference (#3581)

Co-authored-by: Sourabh Jain <sourabhjain@microsoft.com>

* Trace: Fixes Tracing/diagnostics hour-times to 24Hours (#3577)

* Trace: Fixes Tracing/diagnostics hour-times to 24Hours

* fixing baseline tests

Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>

* AI Integration: Adds cosmetic fixes (#3576)

* wip

* status code int and internal and client kind activity

* remove unused imports

* update baselines

* fix test

* fixed baseline tests

* fix tests

* update base tetss

Co-authored-by: Sourabh Jain <sourabhjain@microsoft.com>

* Query: Adds ALL Scalar Expression (#3509)

* Add SqlAllScalarExpression to v3 DOM

* updated generated parser files

* Parsing for ALL

* Added tests for ALL and baselines

* Added more tests

* added new test, cleanup

* cleaning & fix typos

* fixed typo

* Added new baseline test file names to csproj file

* renamed AggregateAll to AggregateSubquery to accomodate FIRST and LAST later

* Added keywords for 'left' and 'right' and respective function calls

* fixed bug from last commit

* cleaning

* replace tabs with spaces

* cleaning

* Release: Adds API contracts for 3.31.2-preview (#3586)

* [Internal] sccignore: Adds a .sccignore file to apply an exception for artifacts configuration issues (#3589)

* [Internal] PermissionTests: Adds CosmosPermissionTests Coverage (#3593)

* Ensures that both Direct and Gateway connection modes are tested
* Validates that container read works with PermissionMode.Read (test was previously only validating that Delete was blocked - i.e. the negative case).

* [Internal] AI Integration: Refactors to Operation prefix and add tests (#3583)

* add tests for otel and custome listener

* clean up

* null pointer fix

* fix tets

* handle event generation also at operation level

* added documentation

* wip

* change event sourcename

* rename event Name

Co-authored-by: Sourabh Jain <sourabhjain@microsoft.com>

* [Internal] HttpTimeoutPolicy: Removes Data Plane Writes from being able to be retried (#3607)

* data plane writes no longer failover on timeout

* removed duplication of test\

* [Internal] Performance Testing: Adds Distributed Tracing option in benchmarks (#3611)

Co-authored-by: Sourabh Jain <sourabhjain@microsoft.com>

* [Internal] Benchmark: Refactors code to make Memory Stream capacity configurable (#3624)

Co-authored-by: Sourabh Jain <sourabhjain@microsoft.com>

* add new LatestVersion changefeed mode that has same behavior as Incremental; renamed FullFidelity to AllVersionsAndDeletes (#3596)

* Query: Fixes handling of CosmosUndefined, CosmosGuid and CosmosBinary in unordered DISTINCT (#3632)

* Handle CosmosUndefined, CosmosGuid and CosmosBinary in DistinctMap.UnorderedDistinctMap

* Address code review feedback and remove unnecessary allocations from DistinctQueryPipelineStageTests

* [Internal] Subpartitioning: Adds updates to test coverage for subpartitioning (#3618)

* updates to test coverage for subpartitioning

* bug fixes

* now useses Assert.ThrowsException

* Seperated into multiple tests for clarity

* Put MultiHash test into seperate test file

* nit

* [Internal] ContainerProperties: Fixes version reset when setting PartitionKeyPath (#3637)

* Remember previous value

* test

* [Internal] AI Integration: Adds CorrelationId and Activity Id Attributes for query operation (#3630)

* add activityid in Otel attributes

* added correlation id

* operation type fix

* remove test changes

* test fix

* fix baseline test

* rename correlationId

* fix tests again

* include only not null attributes in test

* fixed tests

* changefeedxml

* test fix

* ordering activity in operationname oerder

* fix test

* review comments

* refator header getter setter

* clean up

Co-authored-by: Sourabh Jain <sourabhjain@microsoft.com>

* Documentation: Fixes CosmosClientBuilder.WithConnectionModeGateway parameter description (#3643)

* Fixed CosmosClientBuilder.WithConnectionModeGateway documentation

* Update Microsoft.Azure.Cosmos/src/Fluent/CosmosClientBuilder.cs

Co-authored-by: Ruben Bartelink <ruben@bartelink.com>

Co-authored-by: Augsten <aaugsten@harbourvest.com>
Co-authored-by: Ruben Bartelink <ruben@bartelink.com>

* Upgrade Resiliency: Refactors Implementation for Opening Rntbd Connections to Backend Replicas in Direct Mode. (#3640)

* Code changes to refactor implementations for opening connections to all replicas. Fixed test failures due to Direct package upgrade.

* Code changes to add poland central region as a part of Regions.cs

* Code changes to update contract to reflect new regions.

* Revert "Code changes to update contract to reflect new regions."

This reverts commit f171b3c1c9889043556ddf96bcd33ccd79565ad9.

* Revert "Code changes to add poland central region as a part of Regions.cs"

This reverts commit 1aafbf18f6d80e9a92baa301b6b23cf065e4b155.

* [Preview] AI integration: Adds IsDistributedTracingEnabled flag as public API to enable/disable this feature (#3598)

* make api public for preview

* add null check

* fix tests

* singleton listener initialization

* assign null to listeners

* fix test

* concurrent bag in listener

* renamed to LatencyThresholdForDiagnosticEvent

* renamed to IsDistributedTracingEnabled

* updated xml

* update contract

* made latency threshold flag internal

* fix test

* regeneratebaselines

* update documentation

* rename builder api

* add docs

* updated contracts and all

* doc update

* import cleanup

Co-authored-by: Sourabh Jain <sourabhjain@microsoft.com>

* Change Feed Processor: Fixes behavior with StartTime on Local (#3645)

* To UTC

* Test

* [Internal] Client Telemetry: Refactors code to use base useragent string (#3653)

* [Internal] AI Integration: Refactors code to rename event name (#3648)

* first draft

* rename event name

* updated xmls

* update files

* Region Availability: Adds Poland Central Region For Public Usage (#3656)

* Client Encryption: Adds validation code to check if the Key Vault URI provided in wrap metadata is a valid key identifier. (#3642)

* Check if the key vault uri provided is a valid Kid

* test fix.

* update changelog and build props

* Update Directory.Build.props

* Update Microsoft.Azure.Cosmos.Encryption.csproj

* Fixed preview version

* Refactor

* Update EncryptionDatabaseExtensions.cs

* [Internal] Query: Adds Split Support for Ode (#3572)

* Added tests to test different aspects of merge/split support with OptimisticDirectExecution pipeline. Tests check for gone exception handling, pipeline switching etc.

* Added gone exception simulation tests.

* Added new tests and improved test infra

* Removed ParalleContEvocation test. Fixed comments

* Removed CreateParallelCrossPartitionPipelineStateAsync() as it is not being used anymore

* Removed while loop in CreateDocumentContainerAsync()

* Fixed comments.

* Updated ExecuteGoneExceptionOnODEPipeline()

* Added type Assert for ExecuteGoneExceptionOnODEPipeline()

* Replaced try-catch with if statement in MoveNextAsync()

* Added delegate to access TryCreateCoreContextAsync()

* Added check to confirm Ode pipeline is not called in fallback plan

* Updated method name from OptimisticDirectExecutionContext() to TryCreateOptimisticDirectExecutionContext()

* Using delegate instead of Func<>.

* Ode fallback plan always calls Specialized pipeline

* Using ServiceInterop/Gateway to get QueryPlan for Specialized Pipeline

* Added new test to check handling of failing fallback pipeline

* Code cleanup

* Added logic for handling non ODE continuation tokens

* Moved delegate away from member variables

* Added tests for Merge case

* Updated method names

* Added checks for tryCatch

* Updated SetCancellationToken() to use Try

* Updated TryUnwrapContinuationToken()

* Removed changes in FlakyDocumentContainer.cs

* Removed unused imports

* Updated comments

* Fixed comments and cleaned up test code

* Added CosmosElement null check in TryUnwrapContinuationToken()

* Removed FlakyDocumentContainer.cs from pull request

* Removed unused imports

* Updated TryUnwrapContinuationToken()

* Update MoveNextAsync() call in OptimisticDirectExecutionQueryBaselineTests.cs

* Made MergeTestUtil.IsFailedFallbackPipelineTest a readonly property

* Added IsPartitionSplitException() overload to take CosmosElement

* Fixed bug regarding syntax error queries

* [Internal] AI Integration : Fixes operation type  for batch (#3660)

* fix op type

* fix conflict

* CosmosClientOptions: Adds ServerCertificateCustomValidationCallback for Http and TCP (#3636)

* Adding ServerCertificateCustomValidationCallback in clientoptions

* Adding Server callback for Http and fixing tests

* Fixing failing E2Etests

* Resolving merge conflicts

* Running update contracts script

* Running Update contracts script

* Running Update contracts script

* Reverting the v3 version change

* Update based on review comments

* Added unit tests

* Added remarks for callback delegate

* Ran update contracts script

* Update based on review comments

* Ran update contracts script

* Updated unit tests

* Making ssl validation function private

* Updating test files

* Update remarks for sslvalidation public contract

* Added emulator tests for server validation

Co-authored-by: Debdatta Kunda <87335885+kundadebdatta@users.noreply.github.com>

* Query: Adds EnableOptimisticDirectExecution flag to QueryRequestOptions (#3664)

* Added new flag to QueryRequestOptions to allow customers to use Ode pipeline

* Updated comments in QueryRequestOptions.cs

* Renamed enabledOde to enableOde

* Removed default setting for EnableOptimisticDirectExecution

* [Internal] Tests: Removes Direct/HTTPS emulator tests (#3679)

* Removing direct/https tests

* mppreference

* [Internal] Benchmark : Fixes issue with dependency on Cosmos Project (#3673)

* users/sourabhjain/benchmarkfix

* update pipeline

* Revert "users/sourabhjain/benchmarkfix"

This reverts commit 81b48f0e47aed7a75540c2c83f62cea98d86824f.

* fix compilation error

* add parama for preview pkg also

---------

Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>

* LocalQuorum: Adds Quorum reads on Consistent Prefix Accounts (#3680)

Co-authored-by: DESKTOP-ED57J7H\Prashanth Venkataram <vprashanth1987@hotmail.com>

* 3.32.0: Adds new SDK version and contract files (#3687)

* 3.32.0: Adds new SDK version and contract files

* 3.32.0: Adds new SDK version and contract files

* Updating changelog version

* Updating changelog version

* Added more commits to changelog and updated release contract

* Added documentation tags PR in changelog

* Updated changelog based on reviews

* Updated PR decsription in changelog

* Update changelog.md

Updated full fidelity change description

Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>

---------

Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>

* [Internal] Samples: Adds change feed pull model samples (#3646)

* add change feed pull samples

* refactor appsettings validation

* addressing pr comments

* move task delay

* update sample to use latest change feed mode names

---------

Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>

* [Internal] Tests: Refactors emulator CI (#3688)

* [Internal] GitHub Template: Adds needs-investigation label (#3708)

By default, all "Bug report" issues will have "needs-investigation"

* Adding fabric bot action (#3709)

* CosmosNullReferenceException: Refactors CosmosNullReferenceException to pass along InnerException property on parent NullReferenceException (#3713)

* Passed inner exception details to NullReferenceException ctor when instantiating CosmosNullReferenceException.

* Added unit tests.

* Addressed PR feedback.

* [Internal] PriorityRequests: Fixes header value (#3714)

Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>

* [Internal] Query: Adds single physical partition check for OptimisticDirectExecution queries (#3699)

* Added single physical partition check for Ode queries. Updated test infrastructure for Ode emulator tests too.

* Refactored emulator tests to have all the test cases at the top of the file

* Updated TryGetTargetRangeOptimisticDirectExecutionAsync()

* Uodated logic on how many times CreateIngestQueryDeleteAsync() gets called

* Added debug asserts for partitionKeyDefinition

* Added pageSizeOptions parameter in CreateInput() in EmulatorTests

* Fixed comments

* [Internal] CTL: Fixes Reservoir Sampling Logic (#3712)

* Code changes to fix the reservoir sampling logic in CTL

* Code changes to modify help text on reservoir type.

* Code changes to address minor code refactor.

* Diagnostics: Adds startDate in Summary (#3707)

* Adding start date

* Updated trace files

* PR comment

* Committing missing tests

---------

Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>

* [Internal] Client Telemetry: Adds network information in the payload (#3691)

* first draft

* clean code

* add test

* fix test

* add replica info collection

* fix substatuscode and  operation type error

* fix code

* collect http infor in cache also

* message to stacktrace

* remove rntbd recording from cache

* print proper exception message

* fix test

* cleanup unused code and added few status codes in ignore list

* fixed all exception logging

* refactor conditions

* fix tests

* Documentation: Fixes Database.ReadAsync description (#3457)

* Documentation: Modify retry time to timespan 

Modify retry time in seconds to timespan of parameter maxRetryWaitTimeOnThrottledRequests (Method: [WithThrottlingRetryOptions](https://docs.microsoft.com/en-us/dotnet/api/microsoft.azure.cosmos.fluent.cosmosclientbuilder.withthrottlingretryoptions?view=azure-dotnet#feedback))
Resolves https://github.com/Azure/azure-sdk-for-net/issues/29567

* Documentation: Fixes DeleteItemAsync Example

Documentation: Fixes DeleteItemAsync Example

* Documentation: Fixes ItemRequestOptions Example

Documentation: Fixes ItemRequestOptions Example

* Documentation:Update Database.ReadAsync description

Documentation: Update Database.ReadAsync description

* Documentation: Update Database.ReadAsync description

Documentation: Update Database.ReadAsync description

* Documentation: Updated ToStreamIterator example

Documentation: Updated ToStreamIterator example

* Modified StreamIterator section

* Update Microsoft.Azure.Cosmos/src/Resource/Database/Database.cs

Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>

* Remarks correction

* Revert the StreamIterator changes

Revert the StreamIterator changes

Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>
Co-authored-by: Kiran Kumar Kolli <kirankk@microsoft.com>

* Upgrade Resiliency: Adds Implementation for Validating the Unhealthy Backend Replicas in Direct mode (#3631)

* Code changes to implement replica validation in dotnet v3 sdk.

* Cosmetic changes to add inline code comments.

* Code chages to address review comments.

* Code changes to cover a scenario for async cache.

* Code changes to refactor async non-blocking cache code.

* Code changes to address minor review comments.

---------

Co-authored-by: Kiran Kumar Kolli <kirankk@microsoft.com>

* ReadMany: Fixes BadRequest when using Ids with single quotes (#3732)

* Use parameters

* Emulator tests

* Release: Adds SDK version and changelog for 3.32.1 (#3733)

* version bump

* Contracts

* [Internal] Build: Fixes static tool analysis versions (#3736)

* Update Binskim and follow warnings

* Fixing task

* More version bumps

* binskim args

* Padding

* policheck

* postanalysis parameters

* analysis settings

* Query: Fixes System.ArgumentException when using PartitionKey.None on x86, Linux or in Optimistic Direct Execution (#3730)

* Minor clean up of OptimisticDirectExecutionQueryTests

* More minor cleanup in OptimisticDirectExecutionQueryTests

* Add emulator tests for the bypass query parsing scenario

* Handle PartitionKey.None while creating QueryIterator. This is a workaround for the PartitionKeyInternal.None not following its own contract

* Fix up to correctly handle PartitionKey.None using the CachedContainerQueryProperties

* Add more tests where PartitionKey.None maps to PartitionKey.Undefined

---------

Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>

* Query: Adds FIRST and LAST Scalar Expressions (#3629)

* Add FIRST and LAST objects and update visitors

* add FIRST LAST evaluation and update offline engine visitors

* Add FIRST and LAST to parser

* update another visitor

* Fix typo

* fix typo

* added new tests and baselines

* cleaning

* cleaning

---------

Co-authored-by: neildsh <35383880+neildsh@users.noreply.github.com>
Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>

* Subpartitioning: Adds support for Prefix Partition Key searches for sub partitioned containers (#3109)

* 1st round of changes to support subpartitioning for ChangeFeed

* name change and moved a method to FeedRangePartitionKey

* support for prefix partition change feed and query including unit and emulator tests. need to verify using FeedRange with QueryIterator

* splitting out unit tests from emulator tests

* 1st round of changes to support subpartitioning for ChangeFeed

* name change and moved a method to FeedRangePartitionKey

* support for prefix partition change feed and query including unit and emulator tests. need to verify using FeedRange with QueryIterator

* splitting out unit tests from emulator tests

* moved logic to choose for prefix partition query and change feed

* additional conditional to check for MultiHash partitionkeydefinition kind

* removed unnecessary using

* cleanup

* unnecessary using

* removed PREVIEW from proj

* unit tests for ResolveFeedRangeBasedOnPrefixContainerAsync

* change access modifier

* since I changed to static, needed to fix tests

* dealing with some testing nits

* removed Console.Writeline

* slight change in test use containerProperties and partitionKeyDefinition

* big fix for resolve feedrange, changes to error behavior, added additional test coverage

* test changes

* ran updateContracts.ps1

* reverting to 3ad5309e9e22a7376e836cfdbe11fa2438a59133

* Ran Update Contracts

* ran updateContracts.ps1

* UpdateContracts.ps1

* updatecontracts

* removed bad check from test, removed changes from updatecontracts.ps1

* revert UpdateContracts changes

* Reverting to 756a123160d14c424c5e11c4f3520094115aa5d4

* removed accidental change from changelog

* removed unwanted change from Directory.build.props

* added test clean up

* removed console.writelines

* updates to query test

* removed preview flag

* ran UpdateContrats.ps1

* no longer recread feedRange for queries unless using prefix pk

* simplified if statement

* fixed bug

---------

Co-authored-by: Nalu Tripician <nalutrip@icloud.com>

* [Internal] ClientTelemetry: Adds logic to limit payload size to 2 MB (#3717)

* first draft

wip

fix test and logic

* resolve conflicts

* limit 2 mb

* ad callback

* fix tests

* code refactor

* cosmos json to newtosoft json

* clean up files

* fix logging to argumrnt based

* code refactor

* add null check

* Query: Fixes regression from LINQ custom serializer fix (#3749)

Co-authored-by: Minh Le <leminh@microsoft.com>
Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>

* [Internal] LocalQuorum: Refactors override (i.e. strong) to allow from any account consistency (#3753)

- Localquorum override (i.e. strong) to allow from any account consistency
- Facilitates no-downtime downgrade of existing accounts (i.e. existing Strong/bounded accounts migration to Eventual)

* Release: Adds SDK version and change log for 3.32.2 (#3752)

* version bump

* contract

* changelog

* version bump

* Fixing changelog text

* Add another PR

* Subpartitioning: Adds APIs for public release and increase REST API version (#3763)

* initial commit, Http version issues still needs to be resolved

* updateContracts + update Http Version

* updateded version in test

* update contracts

* requested changed

* changed name in comments to subpartitioning from multihash

* undid changes to TestLiteralSerialization.xml

* removed changes to non API.json files

* removed non XXXAPI.json file changes

* changed verbage on public comments

* changed error message to reflect verbage change

* Change Feed Processor: Fixes LeaseLostException leaks on notification APIs for Renew scenarios (#3775)

* Adding cases

* Tests

* Upgrade Resiliency: Refactors GatewayAddressCache to Mark TransportAddresses to Unhealthy when Connection Reset Event Occurs (#3768)

* Code changes to mark the transport uri to unhealthy for which a connection reset event occures through the connection state listener.

* Code changes to bump up the direct version.

* Code changes to clean up Gateway Address Cache.

* Code changes to fix pipeline build.

* Code changes to fix serilization test failures.

* Code changes to add force refresh to the gateway function callback delegate.

* [Preview] PriorityBasedExecution: Adds PriorityLevel as a RequestOption (#3672)

* Added Priority Level as a Request Option

* Changed Priority Level Low and High to 1 and 2 respectively

* Bumped DirectVersion

* Added made PriorityLevel internal for non preview packages

* Deleted PriorityLevelTests.cs

* Added description of Priority Level in RequestOptions.cs

* Modified comments for PriorityLevel in RequestOptions.cs

* Updated Contracts

* Modified Remarks for PriorityLevel and added see also link.

* Updated contracts

---------

Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>

* [Internal] Client Telemetry: Adds sampling logic for network level telemetry (#3750)

* sampling logic add

* throttlinfix

* fix tests

* fix tests

* remove dispose from sampler

* add 412

* draft push

* refactor code for sampling

* clean up

* start testing

* adding tests

* wip

* test fix

* fix test

* fix tests

* deleted extra file

* remove one toList

* add custome logic for sampling

* code refactor

* replace key

* remove commented code from test

* added more comments

* simpler sampler logic

* refactor code

* [Internal] Emulator Test : Fixes test when running with distributed tracing enabled. (#3751)

* enable DT for everything

* try1

* code refactoring

* fix pipeline

* try 2

* Revert "try 2"

This reverts commit 61643f9b4dcd2ab1898fd68b111897bed0bc6bcf.

* Revert "fix pipeline"

This reverts commit 4b217f5f6a087b1dd889b804fd8b477accd46419.

* Revert "code refactoring"

This reverts commit d1ff0ddc17ad655360988d171bd033617752f91f.

* Revert "try1"

This reverts commit bf9c41b43684f59719c3673d6f9c7450bbdc5142.

* lazy factory and threadsafe

* scope factory in function

* try non static

* add flag

* fix test

* add consoles

* more console with fix

* fix tests

* temporarily enable dt

* fuix tests

* dispose listener

* fix tests

* remove delay

* revert flag change

* dynamically get number of test in trace class

* Release: Adds SDK version and changelog for 3.32.3 (#3788)

* Adding contract and version bump

* Adding changelog

* SummaryDiagnostics: Refactors Code to Remove Dependency of HttpResponseHeadersWrapper to fetch Sub Status Codes (#3792)

* Code changes to fetch sub status code from http response/ content headers.

* Code changes to address review comments.

* Code changes to return the first element from the sub status list.

* Code changes to update first or default.

* [Internal] Documentation: Fixes API name to NoSQL (#3795)

* [Internal] CTL: Fixes docker image pipeline (#3794)

* [Internal] AI Integration : Refactors useragent attribute name as per Otel conventions (#3784)

Co-authored-by: Fabian Meiswinkel <fabian@meiswinkel.com>

* HttpClient: Adds Properties to the Http messages if available (#3803)

* Passing properties

* test

* Documentation: Refactors SQL API reference to NoSQL API (#3793)

Co-authored-by: Kiran Kumar Kolli <kirankk@microsoft.com>

* [Internal] Perf test: Refactors code to re-enable performance tests (#3785)

* enable perf tests

* updated json

* upgrade benchmark

* update results

* updated benchmark results

* HttpClient: Adds detection of DNS changes through use of SocketsHttpHandler for .NET 6 and above (#3762)

* initial commit

* removed unneeded usings

* added validation callback, still needs tests

* nits + fixes

* added additional test

* test change

* removed unneeded Dispose calls

* removed unnneed dispose calls

* requested changes

* added pooledConnectionLifetime as client option

* nit

Co-authored-by: Kevin Pilch <me@pilchie.com>

* Update Microsoft.Azure.Cosmos/src/HttpClient/CosmosHttpClientCore.cs

Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>

* Update Microsoft.Azure.Cosmos/src/CosmosClientOptions.cs

Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>

* suggested changes

* remove test, reorder usings

* updated contracts

* removed all non XXXAPI.json changes from UpdateContracts run

* removed public surface, added random timespan

* removed change from unrelated file

* Update Microsoft.Azure.Cosmos/src/HttpClient/CosmosHttpClientCore.cs

Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>

* added thread safe random method

* nit

* fixed merge mistake

* added reflection failsafe/error tracing

* nits

* added back removed if

* fixed formatting

* changed random method, fixed serverCertificateCustomValidation

---------

Co-authored-by: Kevin Pilch <me@pilchie.com>
Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>

* [Internal] Tests: Fixes Open Telemetry attributes for ReadMany test (#3805)

* Fixing test

* New baseline

* Undo some changes

* [Internal] Client Telemetry: Refactors code to run client telemetry data processing task in background. (#3783)

* first draft

* remove failure count test

* refactporing

* code refactor

* create task with timeout

* fix test

* code refactoring

* fix timeout code

* space fix

* not failing if processor is taking time

* fix procrsser test

* code refactor

* refactor and test fix

* Patch: Adds Move Operation (#3389)

* Basic changes to introduce move operator

* Added "from" object in patch spec operation.
Added testcase block.

* Fixed testcase.

* Changes made to address comments'

* Added comment regarding enum mutations

* Formatted comment

Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>

* Moved summary location.

* Ran UpdateContracts.ps1

---------

Co-authored-by: Amaan Haque <t-amaanhaque@microsoft.com>
Co-authored-by: Amaan Haque <amaanhaque@microsoft.com>
Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>

* [Internal] Pipelines: Adds nightly build to produce packages (#3802)

* Support cleaning

* wire previous content delete

* as text

* with variable

* another test

* param with types

* as string

* no delete

* no quotes

* undoing

* re-adding quotes

* testing empty

* trying another test

* readding version

* fixing publishing artifacts

* fixing parameter

* Fixing official pipeline

* version 5

* fixing main pipeline

* test with true

* using start time

* nightly preview

* passing parameters to pack

* Fixing nuget version

* arguments on the nuget pack

* folder structure

* testing v5

* Using only content

* Removing currentDate

* [Internal] OpenTelemetry: Direct Package update and replacing diagnostic files (#3797)

* Direct Package update and replacing dagnostic files

* Resolve merge conflicts

* Running updateCOnstracts script

* Removed LinqTranslationWithCustomSerializerBaseline file

* Adding isDistributedTracingEnabled flag

* Running update contracts

* Running update contracts

* Running update contracts

* fix test

* Code cleanup for test fix

* Code cleanup for test fix

* Making regex expression readable

* Adding comment for regex expression

---------

Co-authored-by: Sourabh Jain <sourabhjain@microsoft.com>

* [Internal] MerlinBot: Adds auto-merge and cleanup automation (#3813)

* Add config changes

* Polishing automerge config

* Update fabricbot.json (#3824)

* [Internal] Upgrade Resiliency: Adds Logic to Validate `Unknown` Replicas along with `Unhealthy`. (#3820)

* Code changes to add aggressive validation logic.

* Code changes to enable aggressive validation for all regions.

* Code changes to pull in msdata cosmos.direct changes related to aggresive validation logic.

* Code changes to make minor cosmetic changes.

* Code changes to address review comments.

* Serialization: Fixes call to CosmosSerializer.FromStream on Gateway mode when EnableContentResponseOnWrite is false (#3814)

* Do not call serializer if ResponseMessage.Content is empty.

* Add unit test

* Update unit tests

* Remove unused usings

---------

Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>

* [Internal] Documentation: Adds documentation covering build pipelines (#3822)

* Add doc

* Move benchmark

* Fixing texts

* Client Encryption: Adds release version of Microsoft.Azure.Cosmos to Microsoft.Azure.Cosmos.Encryption.Custom (#3799)

* cosmos version change

* changing preview to release

* resolving code review comments

---------

Co-authored-by: Santosh Kulkarni <66682828+kr-santosh@users.noreply.github.com>

* SDK 3.33.0 : Adds version bump and changelog (#3823)

* release 3.30.0

* added changelog

* updated changelog

* updated changelog

* suggested change to changelog

* updated changelog

---------

Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>

* [Internal] Documentation: Adds msdata/direct Sync-up Guide. (#3828)

* Code changes to add msdata/direct sync-up documentation.

* Code changes to address review comments.

* Code changes to address further review comments.

* Code changes to address minor review comments.

* Removed internal links.

* Query: Adds TRIM string system function support in LINQ (#3833)

* add trim support

* Added some test coverage

* address reviews

---------

Co-authored-by: Minh Le <leminh@microsoft.com>

* Query: Fixes Parsing Error in SQL DOM when CultureInfo is available (#3832)

* add fix

* Add cultural info to test to verify correct behavior

* address pr review to restore to restore culture

* fix comment

---------

Co-authored-by: Minh Le <leminh@microsoft.com>

* Client Encryption: Adds api FetchDataEncryptionKeyWithoutRawKeyAsync and FetchDataEncryptionKeyAsync to get DEK without and with raw key respectively.  (#3809)

* added raw key to MdeEncryption

* adding ray key to Mde Algo

* test case changes

* resolving code review comments

* code optimization to reduce keyvault calls

* removed Microsoft.Data.Encryption.Cryptography nuget package

* added api for dek with raw key

* resolved code review comments

* adding change log

* code review changes

* Initial commit (#3826)

* Query: Adds Computed Property SDK Support (#3761)

* Initial commit

* Restored settings.json changes.

* Update

* Addressed comments; still need to be tested using Emulator.

* Fixes after test run.

* Ignored the computed property tests based on the sync this morning (to allow for preview release).

* Suite0 fixes.

* Test update.

* Suite0 fixes

* [Internal] Samples: Adds OpenTelemetry and Application Insights samples (#3818)

* add opentelemetry and application insights samples

* address pr comments

* [Internal] Query: Added custom serializer coverage tests to ExpressionToSQL.cs (#3722)

* Ensure enum as string is preserved for custom serializer

* Failing test

* Added failing tests

* Updated requested names

* Ignore result of test for now

* Added additional comment on why the test is ignored

* Replaced with sample code

* Remove ignore attribute from tests, documented misbehavior for future use

* Updated comment

---------

Co-authored-by: leminh98 <leminh.ams@gmail.com>

* Query: Added remaining Cosmos Type checking functions to CosmosLinqExtensions (#3724)

* Added the remaining Cosmos Type checking functions to the CosmosLinqExtensions

* Added comments requested

* Updated comment

* Updated baseline

* Improve readability of dictionary initialization

* Aligned with code style guide

* Revert change to baseline

* Executed update baseline script

---------

Co-authored-by: neildsh <35383880+neildsh@users.noreply.github.com>
Co-authored-by: leminh98 <leminh.ams@gmail.com>

* update sdk version and section tags (#3841)

* PackageLicense: Removes PackageLicenseUrl and Adds PackageLicenseFile since PackageLicenseUrl is deprecated (#3847)

* proposal to add PackageLicenseFile since PackageLicenseUrl is deprecated. https://github.com/NuGet/Home/issues/4628

* adding attribute Visible=false

* making ChangeFeedMode.LatestVersion accessible to the public (#3854)

* AI Integration: Fixes Operation Name in the activity and end to end Tests. (#3845)

* first draft

* second draft

* 3rd draft

* remove untouched file

* test fix

* fix order

* change order

* refactor

* skip network activities in test

* remove network attributes

* SDK 3.34.0 : Adds version bump and changelog (#3855)

* SDK 3.34.0: Adds version bump and changelog

* adding changelog changes

* added a missing PREVIEW PR

* Update changelog.md

Co-authored-by: Justine Cocchi <jucocchi@microsoft.com>

* Update changelog.md

Co-authored-by: Kiran Kumar Kolli <kirankk@microsoft.com>

* removed 3840 as it was not committed

* change text for 3832

* fix merge issue

* add 3724

* Update changelog.md

Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>

* Update changelog.md

Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>

* including 3845

---------

Co-authored-by: Justine Cocchi <jucocchi@microsoft.com>
Co-authored-by: Kiran Kumar Kolli <kirankk@microsoft.com>
Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>

* Release: Fixes changelog.md change for 3845 to preview (#3859)

* removing ThirdPartyNotice.txt from content and contentfiles folders (#3864)

* Documentation: Adds see also link to Container.CreateTransactionalBatch (#3860)

* Linking limit documentation to Container.CreateTransactionalBatch(PartitionKey) method

* Resolved PR comments

* Links update

* Using learn.microsoft instead of docs.microsoft in the links

---------

Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>

* Query: Adds type-markers with count and length for large arrays (#3852)

* initial commit

* cleanup

* update test output

* cleanup

* typo

* Pr comments

* [Internal] AI Integration or Open Telemetry: Design Document (#3858)

* first draft

* redesign

* ädd link

* updated observability url

* Benchmarking: Adds use of ARM Templates for benchmarking (#3838)

* initial commit DONT REVIEW

* fixes and documentation

* Apply suggestions from code review

Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>

* requested changes

* Apply suggestions from code review

Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>

* name changes

* readme changes

* nits + changing case of parameters file

---------

Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>

* Update README.md (#3875)

URL typo.

* moved to new file (#3876)

* Direct Package Upgrade 3.31.0: Refactors code to make compatible with latest direct (#3877)

* upgrade to 3.31.0

* add more regions

* enable dt for operations

* updated contract file

* [Preview] Integrated cache: Adds BypassIntegratedCache to DedicatedGatewayRequestOptions (#3836)

* Integrated cache: Add BypassIntegratedCache to DedicatedGatewayRequestOptions

Currently, integrated cache is used by default for Dedicated Gateway.
Customers cannot skip cache for particular requests or data unless they
shift to multi-tenant Gateway,which will lose the benefits of Dedicated
Gateway.

For customers to have more control over integrated cache, we're
introducing a new "RequestOption" called "BypassIntegratedCache". This
option will allow the customer to decide whether to use integrated cache
for each request or not. If this value is set to true, the item/query
will be served from backend and won't be cached in Dedicated Gateway.

* Move this feature to public preview

* Address comments

1. Add more tests
2. Add more detail and example code for BypassIntegratedCache

* Revert changes in EncryptionCustomAPI

---------

Co-authored-by: Jiajun Peng <jiajunpeng@microsoft.com>
Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>

* Client Encryption: Adds Microsoft.Azure.Cosmos compatibility to version 3.34.0 (#3874)

* chaging Microsoft.Azure.Cosmos support version

* resolved merge conflicts

* CosmosClient: Fixes missing Trace when converting HTTP Timeout to 503 (#3866)

* Added tracing when converting HTTP Timeout to 503

* Fixed tracing when converting HTTP Timeout to 503

* Resolved PR comments

* Using ITrace as part of ClientSideRequestStatisticsTraceDatum

* Refactoring

* Test update

* Unit tests fix

* AI Integration: Fixes Open Telemetry Example (#3868)

* first draft

* add filter

* revert csproj

* fix sample

* changed log message

* remove unused library

* [Internal] Query: Adds OptimisticDirectExecute and RequiresDistribution headers (#3882)

* Adding ODE and RequiresDistribution Headers

* Fixed comments

* Updated parameter in SwitchToFallbackPipelineAsync

* Renamed TryUnwrapContinuationToken to UnwrapContinuationToken

---------

Co-authored-by: neildsh <35383880+neildsh@users.noreply.github.com>

* Query: Refactors the EnableOptimisticDirectExecution flag to be public (#3883)

* Made EnableOptimisticDirectExecution a public flag

* Updated contract

* [Internal] OpenTelemetry : Adds Telemetry Distributed Tracing functionality (#3801)

* Direct Package update and replacing dagnostic files

* Resolve merge conflicts

* Running updateCOnstracts script

* Add code changes for distributed tracing open telemetry changes

* Add distributed tracing tests

* Updated tests for distributed tracing

* Addin traceID for diagnostics

* Running update contract script

* Removed LinqTranslationWithCustomSerializerBaseline file

* Adding isDistributedTracingEnabled flag

* Running update contracts

* Running update contracts

* Updates based on differnt code review comments

* Running update contracts

* Running update contracts

* Running update contracts

* fix test

* Code cleanup for test fix

* Running Update contracts

* resolving merge conflicts

* resolving merge conflicts

* Set EnableDistributedTracing to true for performance tests

* Benchmark project change for distributed tracing

* Updating tests

* Updated unit tests

* Updated unit tests

* Updated tests and constructors based on review comments

* Updated scope name in recorder

* Updated distributedOtel tests to cover more scenarios

* Updated distributedOtel tests

* Reverting benchmark performance test changes

* Update DistributedOpentelemetry tests

* Update test cleanup

* Update distributed tests with custom builder

* Update distributed open telemetry tests

* Update contracts

* Cleanup files

* Update distributed Otel tests

* Update distributed Otel tests

* code refactoring

* fix custom listener

* Update direct package to 3.31.1

* Code clean up

* Update tests with display name

---------

Co-authored-by: Sourabh Jain <sourabhjain@microsoft.com>

* Documentation: Adds additional remarks to CosmosClient (#3891)

* CosmosClient documentation improvements

* Cref fix

* Link fix

* Documentation fix

* Typo fix

---------

Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>

* Open Telemetry End To End Test: Adds baseline for network level requests trace (#3887)

* enable request level in end to end

* made some changes

* fix tests

* fix display name

* hardcoded containername and databasenam

* fix tests

* temp

* fix tests

* update contracts

* fix tests

* fixed display name

* [Internal] Design Docs: Adds Design Document for Client Telemetry (#3590)

* sdk design for client telemetry

* Otel design

* update optel design

* added more nformation

* updated ct design

* remove otel design

* Client Telemetry Design

* update typos

* fix typos

* fix typos

* added limitation

* updated docs

* updated doc

* updated text

* Update docs/observability.md

Co-authored-by: Kiran Kumar Kolli <kirankk@microsoft.com>

* Update docs/observability.md

Co-authored-by: Kiran Kumar Kolli <kirankk@microsoft.com>

* Update docs/observability.md

Co-authored-by: Kiran Kumar Kolli <kirankk@microsoft.com>

* Update docs/observability.md

Co-authored-by: Kiran Kumar Kolli <kirankk@microsoft.com>

* Update docs/observability.md

Co-authored-by: Kiran Kumar Kolli <kirankk@microsoft.com>

* move stuff here and there.

---------

Co-authored-by: Kiran Kumar Kolli <kirankk@microsoft.com>

* [Internal] Design Docs: Adds Design Document for Client Telemetry Part 2 (#3903)

* updated doc

* Update docs/observability.md

Co-authored-by: Justine Cocchi <jucocchi@microsoft.com>

* updated text

---------

Co-authored-by: Justine Cocchi <jucocchi@microsoft.com>

* ConnectionPolicy: Refactors Code to Reduce Default Request Timeout to 6 Seconds. (#3902)

* Code changes to reduce default request timeout to 6 seconds.

* Code changes to update API doc default request timeout to 6 seconds.

* [Internal] Upgrade Resiliency: Adds Replica Health State Diagnostics. (#3835)

* Code changes to add replica health status in diagnostics.

* Code changes to fix performance test build failure.

* Code changes to add health state capture logic in address cache.

* Code changes to fix benchmark test execution.

* Code changes to add tests to validate health state cache.

* Code changes to reduce default request timeout to 5 seconds.

* Revert "Code changes to reduce default request timeout to 5 seconds."

This reverts commit 139f37e588fc9dfed608431f4186c567a080e622.

* Subpartitioning: Fixes handling of split physical partitions (#3879)

* Initial Commit DO NOT REVIEW

* bug fix, needs Direct Package Changes

* fix for change feed and query plus tests

* clean up

* query + clean up

---------

Co-authored-by: Kiran Kumar Kolli <kirankk@microsoft.com>

* [Query] Fixes empty property name parsing exception (#3907)

* inital commit

* cleanup

* test cleanup

* PR comments

* PR comment

* [Preview] Query: Refactors EnableOptimisticDirectExecution to true by default in Preview mode (#3909)

* Setting EnableODE to true by default in Preview Mode.

* Added seperate if block for default value

* Updated property

* Removed unused Usings

* Updated contracts

* Updated test

* Updated directive indentation

* Documentations: Adds links to PatchItems docs (#3910)

* Added links to PatchItems docs

* Undo changes from internal file

* [Internal] Direct Package Upgrade: Refactors Code to Bump Up `Cosmos.Direct` Package to `3.31.2` (#3918)

* Code changes to bump up the direct version.

* Code changes to mark the Israel Central region as public.

* Code changes to update contracts.

* Code changes to fix test failure. Some clean ups.

* Code changes to add detailed message for open channels count.

* SDK 3.35.0 : Adds version bump and changelog (#3920)

* release PR

* updated changelog.md

* more changelog updates

* [Internal] Last minute fix to changelog for 3.35.0 (#3921)

* release PR

* updated changelog.md

* more changelog updates

* changelog fix

* Update changelog.md

* Update changelog.md

* Code changes to sync up with cosmos.direct release 3.31.2.

* Code changes to fix encryption package build failure.

---------

Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>
Co-authored-by: neildsh <35383880+neildsh@users.noreply.github.com>
Co-authored-by: Sourabh Jain <sourabh.jain.107@gmail.com>
Co-authored-by: Sourabh Jain <sourabhjain@microsoft.com>
Co-authored-by: aavasthy <113193425+aavasthy@users.noreply.github.com>
Co-authored-by: Kiran Kumar Kolli <kirankk@microsoft.com>
Co-authored-by: Aditya <adityasa@users.noreply.github.com>
Co-authored-by: Fabian Meiswinkel <fabian@meiswinkel.com>
Co-authored-by: akotalwar <94020786+akotalwar@users.noreply.github.com>
Co-authored-by: Nalu Tripician <nalutrip@icloud.com>
Co-authored-by: Nalu Tripician <ntripician@microsoft.com>
Co-authored-by: Pramod Valavala <43602528+PramodValavala-MSFT@users.noreply.github.com>
Co-authored-by: Ezra Haleva <115735172+ezrahaleva-msft@users.noreply.github.com>
Co-authored-by: Vivek Ravindran <vivekra@microsoft.com>
Co-authored-by: Prasad Ullal <36418906+prasadu-microsoft@users.noreply.github.com>
Co-authored-by: Philip Thomas <86612891+philipthomas-MSFT@users.noreply.github.com>
Co-authored-by: Arthur Augsten <arthuraugsten@gmail.com>
Co-authored-by: Augsten <aaugsten@harbourvest.com>
Co-authored-by: Ruben Bartelink <ruben@bartelink.com>
Co-authored-by: Santosh Kulkarni <66682828+kr-santosh@users.noreply.github.com>
Co-authored-by: pravengithub <124255233+pravengithub@users.noreply.github.com>
Co-authored-by: DESKTOP-ED57J7H\Prashanth Venkataram <vprashanth1987@hotmail.com>
Co-authored-by: Justine Cocchi <jucocchi@microsoft.com>
Co-authored-by: Abhijeet Mohanty <mabhijeet1995@gmail.com>
Co-authored-by: Achint-Agrawal <45819170+Achint-Agrawal@users.noreply.github.com>
Co-authored-by: Nimit Shah <nimit.svnit@gmail.com>
Co-authored-by: SaurabhSharma-MSFT <38112130+SaurabhSharma-MSFT@users.noreply.github.com>
Co-authored-by: leminh98 <leminh.ams@gmail.com>
Co-authored-by: Minh Le <leminh@microsoft.com>
Co-authored-by: Nalu Tripician <27316859+NaluTripician@users.noreply.github.com>
Co-authored-by: Scott Addie <10702007+scottaddie@users.noreply.github.com>
Co-authored-by: Kevin Pilch <me@pilchie.com>
Co-authored-by: Amaan-Haque <54414760+Amaan-Haque@users.noreply.github.com>
Co-authored-by: Amaan Haque <t-amaanhaque@microsoft.com>
Co-authored-by: Amaan Haque <amaanhaque@microsoft.com>
Co-authored-by: Baltima <130716409+Baltima@users.noreply.github.com>
Co-authored-by: vipulvishal-ms <110802706+vipulvishal-ms@users.noreply.github.com>
Co-authored-by: Erik O'Leary <969938+onionhammer@users.noreply.github.com>
Co-authored-by: Rinat Minibaev <132935507+rinatmini@users.noreply.github.com>
Co-authored-by: Maya-Painter <130110800+Maya-Painter@users.noreply.github.com>
Co-authored-by: jiajunpeng-msft <32749342+jiajunpeng-msft@users.noreply.github.com>
Co-authored-by: Jiajun Peng <jiajunpeng@microsoft.com>
kundadebdatta added a commit that referenced this pull request Jul 21, 2023
…t v3 master and Cosmos.Direct `v3.31.3` (#3999)

* [Internal] Client Telemetry: Fixes tests leaking environment variables (#3517)

* Adding log lines

* More logs

* Debugging further

* Removing other builds

* And more debugging

* Wrong build parameters

* Wrong category

* Removing noise

* Fixing test

* Adding utils

* Adding test with client telemetry enabled

* Fixing leak in Client Telemetry Tests

* Reenabling test

* cpu monitor initialization

* Adding name details

* Undo another file

* Updated change log and bumped up the version. (#3526)

* Query: Fixes performance regression on target partition on some ORDER BY queries with continuation (#3525)

* Revert performance regression caused by https://github.com/Azure/azure-cosmos-dotnet-v3/pull/1289/

* Remove irrelevant comment

* Add a test for validating formatted filters for the target partition

* [Internal] AI Integration: Adds SubStatusCode Information in attributes (#3533)

* wip

* regenerated baseline

* add test

* fix test

Co-authored-by: Sourabh Jain <sourabhjain@microsoft.com>

* Diagnostics: Removes unused properties and reduces size (#3519)

* Remove starttime and id from diagnostics string

* Remove starttime and id from diagnostics string

* Update xml files for trace baseline tests

* Update xml files for trace baseline tests

* Update xml files for trace baseline tests

* Whitespaces update

* Changed starttime position based on code review

Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>

* [Internal] docs: Add address caches conceptual flow (#3534)

* Rough draft

* Some more changes

* Adding a new section

* Some more refinement

* Some changes 

Lets get the feedback

* Some MISC changes

* Release: Adds SDK version and changelog for 3.31.2 (#3546)

* Bumped SDK version and changelog

* Added contracts file for 3.31.2

* [Internal] Documentation: Removes invalid comment from ReadThroughputAsync (#3516)

* [Internal] nugetconfig: Removes specific overrides (#3551)

* Query: Fixes partition range evaluation for spatial queries (#3495)

* Initial commit

* Update.

* Pull/Rebase

* Addressed comments.

* Build fix

* [Internal] Documentation: Refactors cache content on its own document (#3554)

* Add cache file

* Moving content away

* [Internal] Emulator unit tests: Adds IdEncoding unit tests for ComputeGateway (#3556)

* Adding IdEncoding unit tests for ComputeGateway

* Reacting to code review feedback

* Updating md files

* Change Feed Processor: Adds support for Resource Tokens (#3566)

* Adding rid parsing

* Test

* Removing dead code

* Contract update

* [Internal] AI integration: Refactor code how container and database name is flowing to opentelemetry module (#3532)

* wip

* WIP

* Revert "WIP"

This reverts commit 71275de54b9e67fa54a37e79d450b9597e173934.

* Revert "wip"

This reverts commit 586fa9865cc3f40dabd7ef90fb3e0cf499a045bc.

* wip add containe and database info

* redesign how container and database name information flows into opne telemetry data

* test fix

* fix test

* fix tests

* fix typos

* baseline test fix

Co-authored-by: Sourabh Jain <sourabhjain@microsoft.com>

* [Internal] AI Integration: Adds a new flag in DistributedTracingOptions (#3562)

* add flag in diagnostic options

* test fixes

* rename variable

* test fix

* add validation

* fix baseline

* test fix

Co-authored-by: Sourabh Jain <sourabhjain@microsoft.com>

* Query: Fixes default to BadRequestException in case of internal errors in ServiceInterop (#3399)

* Don't default to BadRequestException in case of errors in ServiceInterop

* Incorporate code review feedback

* Fix build error

* fix up failing test

* [Internal] Query: Adds unit tests for Merge/Split implementation with OptimisticDirectExecution pipeline (#3510)

* Added tests to test different aspects of merge/split support with OptimisticDirectExecution pipeline. Tests check for gone exception handling, pipeline switching etc.

* Added gone exception simulation tests.

* Added new tests and improved test infra

* Removed ParalleContEvocation test. Fixed comments

* Removed CreateParallelCrossPartitionPipelineStateAsync() as it is not being used anymore

* Removed while loop in CreateDocumentContainerAsync()

* Fixed comments.

* Updated ExecuteGoneExceptionOnODEPipeline()

* Added type Assert for ExecuteGoneExceptionOnODEPipeline()

* Updated OptimisticDirectExecution pipeline abbreviation

* Updated TestBaseline folder with new xml

* Client Retry Policy: Adds HTTP timeouts with request-level cross-region retry (#3555)

* Fixes to ReadThroughputAsync for databases with no provisioned throughput and null as request options

* fixed failure to ReadReplaceThroughputResponseTests

* Added Stream Method

* Ran UpdateContract.ps1

* Encryption implemtation

* Fixed spelling error

* Update Microsoft.Azure.Cosmos.Encryption/src/EncryptionDatabase.cs

Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>

* Variable name change

* Update Microsoft.Azure.Cosmos/src/Resource/Database/Database.cs

Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>

* Suggested Changes and fixes

* Removed manufactured ResponseMessage + nits

* Simplified PR

* nits

* nits

* initial changes TODO: Update tests

* updated tests

* nits'

* Ran UpdateContracts.ps1

* nits + requested changes

* Delete NuGet.Config

* Update Microsoft.Azure.Cosmos/src/HttpClient/CosmosHttpClientCore.cs

Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>

* Update Microsoft.Azure.Cosmos/src/HttpClient/HttpTimeoutPolicy.cs

Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>

* Update Microsoft.Azure.Cosmos/src/HttpClient/HttpTimeoutPolicy.cs

Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>

* Update Microsoft.Azure.Cosmos/src/HttpClient/HttpTimeoutPolicy.cs

Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>

* Use Cosmos Exception Factory, Simplified Tests

* removed unused code

* nits: removed unused code

* removed unused code

Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>
Co-authored-by: Nalu Tripician <ntripician@microsoft.com>

* Documentation: Fixes EUAP in Comments (#3579)

* Query: Fixes incorrect FeedResponse.Count when result contains undefined elements (#3574)

* Do not maintain an independent count on QueryResponse that can go out of sync

* Add more test coverage for QueryResponse<T>.Count

* Output the correct count from CosmosElementSerializer when the input contains CosmosUndefined

* Add untyped tests for CosmosUndefined

* Remove commented code

* removed allr eference (#3581)

Co-authored-by: Sourabh Jain <sourabhjain@microsoft.com>

* Trace: Fixes Tracing/diagnostics hour-times to 24Hours (#3577)

* Trace: Fixes Tracing/diagnostics hour-times to 24Hours

* fixing baseline tests

Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>

* AI Integration: Adds cosmetic fixes (#3576)

* wip

* status code int and internal and client kind activity

* remove unused imports

* update baselines

* fix test

* fixed baseline tests

* fix tests

* update base tetss

Co-authored-by: Sourabh Jain <sourabhjain@microsoft.com>

* Query: Adds ALL Scalar Expression (#3509)

* Add SqlAllScalarExpression to v3 DOM

* updated generated parser files

* Parsing for ALL

* Added tests for ALL and baselines

* Added more tests

* added new test, cleanup

* cleaning & fix typos

* fixed typo

* Added new baseline test file names to csproj file

* renamed AggregateAll to AggregateSubquery to accomodate FIRST and LAST later

* Added keywords for 'left' and 'right' and respective function calls

* fixed bug from last commit

* cleaning

* replace tabs with spaces

* cleaning

* Release: Adds API contracts for 3.31.2-preview (#3586)

* [Internal] sccignore: Adds a .sccignore file to apply an exception for artifacts configuration issues (#3589)

* [Internal] PermissionTests: Adds CosmosPermissionTests Coverage (#3593)

* Ensures that both Direct and Gateway connection modes are tested
* Validates that container read works with PermissionMode.Read (test was previously only validating that Delete was blocked - i.e. the negative case).

* [Internal] AI Integration: Refactors to Operation prefix and add tests (#3583)

* add tests for otel and custome listener

* clean up

* null pointer fix

* fix tets

* handle event generation also at operation level

* added documentation

* wip

* change event sourcename

* rename event Name

Co-authored-by: Sourabh Jain <sourabhjain@microsoft.com>

* [Internal] HttpTimeoutPolicy: Removes Data Plane Writes from being able to be retried (#3607)

* data plane writes no longer failover on timeout

* removed duplication of test\

* [Internal] Performance Testing: Adds Distributed Tracing option in benchmarks (#3611)

Co-authored-by: Sourabh Jain <sourabhjain@microsoft.com>

* [Internal] Benchmark: Refactors code to make Memory Stream capacity configurable (#3624)

Co-authored-by: Sourabh Jain <sourabhjain@microsoft.com>

* add new LatestVersion changefeed mode that has same behavior as Incremental; renamed FullFidelity to AllVersionsAndDeletes (#3596)

* Query: Fixes handling of CosmosUndefined, CosmosGuid and CosmosBinary in unordered DISTINCT (#3632)

* Handle CosmosUndefined, CosmosGuid and CosmosBinary in DistinctMap.UnorderedDistinctMap

* Address code review feedback and remove unnecessary allocations from DistinctQueryPipelineStageTests

* [Internal] Subpartitioning: Adds updates to test coverage for subpartitioning (#3618)

* updates to test coverage for subpartitioning

* bug fixes

* now useses Assert.ThrowsException

* Seperated into multiple tests for clarity

* Put MultiHash test into seperate test file

* nit

* [Internal] ContainerProperties: Fixes version reset when setting PartitionKeyPath (#3637)

* Remember previous value

* test

* [Internal] AI Integration: Adds CorrelationId and Activity Id Attributes for query operation (#3630)

* add activityid in Otel attributes

* added correlation id

* operation type fix

* remove test changes

* test fix

* fix baseline test

* rename correlationId

* fix tests again

* include only not null attributes in test

* fixed tests

* changefeedxml

* test fix

* ordering activity in operationname oerder

* fix test

* review comments

* refator header getter setter

* clean up

Co-authored-by: Sourabh Jain <sourabhjain@microsoft.com>

* Documentation: Fixes CosmosClientBuilder.WithConnectionModeGateway parameter description (#3643)

* Fixed CosmosClientBuilder.WithConnectionModeGateway documentation

* Update Microsoft.Azure.Cosmos/src/Fluent/CosmosClientBuilder.cs

Co-authored-by: Ruben Bartelink <ruben@bartelink.com>

Co-authored-by: Augsten <aaugsten@harbourvest.com>
Co-authored-by: Ruben Bartelink <ruben@bartelink.com>

* Upgrade Resiliency: Refactors Implementation for Opening Rntbd Connections to Backend Replicas in Direct Mode. (#3640)

* Code changes to refactor implementations for opening connections to all replicas. Fixed test failures due to Direct package upgrade.

* Code changes to add poland central region as a part of Regions.cs

* Code changes to update contract to reflect new regions.

* Revert "Code changes to update contract to reflect new regions."

This reverts commit f171b3c1c9889043556ddf96bcd33ccd79565ad9.

* Revert "Code changes to add poland central region as a part of Regions.cs"

This reverts commit 1aafbf18f6d80e9a92baa301b6b23cf065e4b155.

* [Preview] AI integration: Adds IsDistributedTracingEnabled flag as public API to enable/disable this feature (#3598)

* make api public for preview

* add null check

* fix tests

* singleton listener initialization

* assign null to listeners

* fix test

* concurrent bag in listener

* renamed to LatencyThresholdForDiagnosticEvent

* renamed to IsDistributedTracingEnabled

* updated xml

* update contract

* made latency threshold flag internal

* fix test

* regeneratebaselines

* update documentation

* rename builder api

* add docs

* updated contracts and all

* doc update

* import cleanup

Co-authored-by: Sourabh Jain <sourabhjain@microsoft.com>

* Change Feed Processor: Fixes behavior with StartTime on Local (#3645)

* To UTC

* Test

* [Internal] Client Telemetry: Refactors code to use base useragent string (#3653)

* [Internal] AI Integration: Refactors code to rename event name (#3648)

* first draft

* rename event name

* updated xmls

* update files

* Region Availability: Adds Poland Central Region For Public Usage (#3656)

* Client Encryption: Adds validation code to check if the Key Vault URI provided in wrap metadata is a valid key identifier. (#3642)

* Check if the key vault uri provided is a valid Kid

* test fix.

* update changelog and build props

* Update Directory.Build.props

* Update Microsoft.Azure.Cosmos.Encryption.csproj

* Fixed preview version

* Refactor

* Update EncryptionDatabaseExtensions.cs

* [Internal] Query: Adds Split Support for Ode (#3572)

* Added tests to test different aspects of merge/split support with OptimisticDirectExecution pipeline. Tests check for gone exception handling, pipeline switching etc.

* Added gone exception simulation tests.

* Added new tests and improved test infra

* Removed ParalleContEvocation test. Fixed comments

* Removed CreateParallelCrossPartitionPipelineStateAsync() as it is not being used anymore

* Removed while loop in CreateDocumentContainerAsync()

* Fixed comments.

* Updated ExecuteGoneExceptionOnODEPipeline()

* Added type Assert for ExecuteGoneExceptionOnODEPipeline()

* Replaced try-catch with if statement in MoveNextAsync()

* Added delegate to access TryCreateCoreContextAsync()

* Added check to confirm Ode pipeline is not called in fallback plan

* Updated method name from OptimisticDirectExecutionContext() to TryCreateOptimisticDirectExecutionContext()

* Using delegate instead of Func<>.

* Ode fallback plan always calls Specialized pipeline

* Using ServiceInterop/Gateway to get QueryPlan for Specialized Pipeline

* Added new test to check handling of failing fallback pipeline

* Code cleanup

* Added logic for handling non ODE continuation tokens

* Moved delegate away from member variables

* Added tests for Merge case

* Updated method names

* Added checks for tryCatch

* Updated SetCancellationToken() to use Try

* Updated TryUnwrapContinuationToken()

* Removed changes in FlakyDocumentContainer.cs

* Removed unused imports

* Updated comments

* Fixed comments and cleaned up test code

* Added CosmosElement null check in TryUnwrapContinuationToken()

* Removed FlakyDocumentContainer.cs from pull request

* Removed unused imports

* Updated TryUnwrapContinuationToken()

* Update MoveNextAsync() call in OptimisticDirectExecutionQueryBaselineTests.cs

* Made MergeTestUtil.IsFailedFallbackPipelineTest a readonly property

* Added IsPartitionSplitException() overload to take CosmosElement

* Fixed bug regarding syntax error queries

* [Internal] AI Integration : Fixes operation type  for batch (#3660)

* fix op type

* fix conflict

* CosmosClientOptions: Adds ServerCertificateCustomValidationCallback for Http and TCP (#3636)

* Adding ServerCertificateCustomValidationCallback in clientoptions

* Adding Server callback for Http and fixing tests

* Fixing failing E2Etests

* Resolving merge conflicts

* Running update contracts script

* Running Update contracts script

* Running Update contracts script

* Reverting the v3 version change

* Update based on review comments

* Added unit tests

* Added remarks for callback delegate

* Ran update contracts script

* Update based on review comments

* Ran update contracts script

* Updated unit tests

* Making ssl validation function private

* Updating test files

* Update remarks for sslvalidation public contract

* Added emulator tests for server validation

Co-authored-by: Debdatta Kunda <87335885+kundadebdatta@users.noreply.github.com>

* Query: Adds EnableOptimisticDirectExecution flag to QueryRequestOptions (#3664)

* Added new flag to QueryRequestOptions to allow customers to use Ode pipeline

* Updated comments in QueryRequestOptions.cs

* Renamed enabledOde to enableOde

* Removed default setting for EnableOptimisticDirectExecution

* [Internal] Tests: Removes Direct/HTTPS emulator tests (#3679)

* Removing direct/https tests

* mppreference

* [Internal] Benchmark : Fixes issue with dependency on Cosmos Project (#3673)

* users/sourabhjain/benchmarkfix

* update pipeline

* Revert "users/sourabhjain/benchmarkfix"

This reverts commit 81b48f0e47aed7a75540c2c83f62cea98d86824f.

* fix compilation error

* add parama for preview pkg also

---------

Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>

* LocalQuorum: Adds Quorum reads on Consistent Prefix Accounts (#3680)

Co-authored-by: DESKTOP-ED57J7H\Prashanth Venkataram <vprashanth1987@hotmail.com>

* 3.32.0: Adds new SDK version and contract files (#3687)

* 3.32.0: Adds new SDK version and contract files

* 3.32.0: Adds new SDK version and contract files

* Updating changelog version

* Updating changelog version

* Added more commits to changelog and updated release contract

* Added documentation tags PR in changelog

* Updated changelog based on reviews

* Updated PR decsription in changelog

* Update changelog.md

Updated full fidelity change description

Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>

---------

Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>

* [Internal] Samples: Adds change feed pull model samples (#3646)

* add change feed pull samples

* refactor appsettings validation

* addressing pr comments

* move task delay

* update sample to use latest change feed mode names

---------

Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>

* [Internal] Tests: Refactors emulator CI (#3688)

* [Internal] GitHub Template: Adds needs-investigation label (#3708)

By default, all "Bug report" issues will have "needs-investigation"

* Adding fabric bot action (#3709)

* CosmosNullReferenceException: Refactors CosmosNullReferenceException to pass along InnerException property on parent NullReferenceException (#3713)

* Passed inner exception details to NullReferenceException ctor when instantiating CosmosNullReferenceException.

* Added unit tests.

* Addressed PR feedback.

* [Internal] PriorityRequests: Fixes header value (#3714)

Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>

* [Internal] Query: Adds single physical partition check for OptimisticDirectExecution queries (#3699)

* Added single physical partition check for Ode queries. Updated test infrastructure for Ode emulator tests too.

* Refactored emulator tests to have all the test cases at the top of the file

* Updated TryGetTargetRangeOptimisticDirectExecutionAsync()

* Uodated logic on how many times CreateIngestQueryDeleteAsync() gets called

* Added debug asserts for partitionKeyDefinition

* Added pageSizeOptions parameter in CreateInput() in EmulatorTests

* Fixed comments

* [Internal] CTL: Fixes Reservoir Sampling Logic (#3712)

* Code changes to fix the reservoir sampling logic in CTL

* Code changes to modify help text on reservoir type.

* Code changes to address minor code refactor.

* Diagnostics: Adds startDate in Summary (#3707)

* Adding start date

* Updated trace files

* PR comment

* Committing missing tests

---------

Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>

* [Internal] Client Telemetry: Adds network information in the payload (#3691)

* first draft

* clean code

* add test

* fix test

* add replica info collection

* fix substatuscode and  operation type error

* fix code

* collect http infor in cache also

* message to stacktrace

* remove rntbd recording from cache

* print proper exception message

* fix test

* cleanup unused code and added few status codes in ignore list

* fixed all exception logging

* refactor conditions

* fix tests

* Documentation: Fixes Database.ReadAsync description (#3457)

* Documentation: Modify retry time to timespan 

Modify retry time in seconds to timespan of parameter maxRetryWaitTimeOnThrottledRequests (Method: [WithThrottlingRetryOptions](https://docs.microsoft.com/en-us/dotnet/api/microsoft.azure.cosmos.fluent.cosmosclientbuilder.withthrottlingretryoptions?view=azure-dotnet#feedback))
Resolves https://github.com/Azure/azure-sdk-for-net/issues/29567

* Documentation: Fixes DeleteItemAsync Example

Documentation: Fixes DeleteItemAsync Example

* Documentation: Fixes ItemRequestOptions Example

Documentation: Fixes ItemRequestOptions Example

* Documentation:Update Database.ReadAsync description

Documentation: Update Database.ReadAsync description

* Documentation: Update Database.ReadAsync description

Documentation: Update Database.ReadAsync description

* Documentation: Updated ToStreamIterator example

Documentation: Updated ToStreamIterator example

* Modified StreamIterator section

* Update Microsoft.Azure.Cosmos/src/Resource/Database/Database.cs

Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>

* Remarks correction

* Revert the StreamIterator changes

Revert the StreamIterator changes

Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>
Co-authored-by: Kiran Kumar Kolli <kirankk@microsoft.com>

* Upgrade Resiliency: Adds Implementation for Validating the Unhealthy Backend Replicas in Direct mode (#3631)

* Code changes to implement replica validation in dotnet v3 sdk.

* Cosmetic changes to add inline code comments.

* Code chages to address review comments.

* Code changes to cover a scenario for async cache.

* Code changes to refactor async non-blocking cache code.

* Code changes to address minor review comments.

---------

Co-authored-by: Kiran Kumar Kolli <kirankk@microsoft.com>

* ReadMany: Fixes BadRequest when using Ids with single quotes (#3732)

* Use parameters

* Emulator tests

* Release: Adds SDK version and changelog for 3.32.1 (#3733)

* version bump

* Contracts

* [Internal] Build: Fixes static tool analysis versions (#3736)

* Update Binskim and follow warnings

* Fixing task

* More version bumps

* binskim args

* Padding

* policheck

* postanalysis parameters

* analysis settings

* Query: Fixes System.ArgumentException when using PartitionKey.None on x86, Linux or in Optimistic Direct Execution (#3730)

* Minor clean up of OptimisticDirectExecutionQueryTests

* More minor cleanup in OptimisticDirectExecutionQueryTests

* Add emulator tests for the bypass query parsing scenario

* Handle PartitionKey.None while creating QueryIterator. This is a workaround for the PartitionKeyInternal.None not following its own contract

* Fix up to correctly handle PartitionKey.None using the CachedContainerQueryProperties

* Add more tests where PartitionKey.None maps to PartitionKey.Undefined

---------

Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>

* Query: Adds FIRST and LAST Scalar Expressions (#3629)

* Add FIRST and LAST objects and update visitors

* add FIRST LAST evaluation and update offline engine visitors

* Add FIRST and LAST to parser

* update another visitor

* Fix typo

* fix typo

* added new tests and baselines

* cleaning

* cleaning

---------

Co-authored-by: neildsh <35383880+neildsh@users.noreply.github.com>
Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>

* Subpartitioning: Adds support for Prefix Partition Key searches for sub partitioned containers (#3109)

* 1st round of changes to support subpartitioning for ChangeFeed

* name change and moved a method to FeedRangePartitionKey

* support for prefix partition change feed and query including unit and emulator tests. need to verify using FeedRange with QueryIterator

* splitting out unit tests from emulator tests

* 1st round of changes to support subpartitioning for ChangeFeed

* name change and moved a method to FeedRangePartitionKey

* support for prefix partition change feed and query including unit and emulator tests. need to verify using FeedRange with QueryIterator

* splitting out unit tests from emulator tests

* moved logic to choose for prefix partition query and change feed

* additional conditional to check for MultiHash partitionkeydefinition kind

* removed unnecessary using

* cleanup

* unnecessary using

* removed PREVIEW from proj

* unit tests for ResolveFeedRangeBasedOnPrefixContainerAsync

* change access modifier

* since I changed to static, needed to fix tests

* dealing with some testing nits

* removed Console.Writeline

* slight change in test use containerProperties and partitionKeyDefinition

* big fix for resolve feedrange, changes to error behavior, added additional test coverage

* test changes

* ran updateContracts.ps1

* reverting to 3ad5309e9e22a7376e836cfdbe11fa2438a59133

* Ran Update Contracts

* ran updateContracts.ps1

* UpdateContracts.ps1

* updatecontracts

* removed bad check from test, removed changes from updatecontracts.ps1

* revert UpdateContracts changes

* Reverting to 756a123160d14c424c5e11c4f3520094115aa5d4

* removed accidental change from changelog

* removed unwanted change from Directory.build.props

* added test clean up

* removed console.writelines

* updates to query test

* removed preview flag

* ran UpdateContrats.ps1

* no longer recread feedRange for queries unless using prefix pk

* simplified if statement

* fixed bug

---------

Co-authored-by: Nalu Tripician <nalutrip@icloud.com>

* [Internal] ClientTelemetry: Adds logic to limit payload size to 2 MB (#3717)

* first draft

wip

fix test and logic

* resolve conflicts

* limit 2 mb

* ad callback

* fix tests

* code refactor

* cosmos json to newtosoft json

* clean up files

* fix logging to argumrnt based

* code refactor

* add null check

* Query: Fixes regression from LINQ custom serializer fix (#3749)

Co-authored-by: Minh Le <leminh@microsoft.com>
Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>

* [Internal] LocalQuorum: Refactors override (i.e. strong) to allow from any account consistency (#3753)

- Localquorum override (i.e. strong) to allow from any account consistency
- Facilitates no-downtime downgrade of existing accounts (i.e. existing Strong/bounded accounts migration to Eventual)

* Release: Adds SDK version and change log for 3.32.2 (#3752)

* version bump

* contract

* changelog

* version bump

* Fixing changelog text

* Add another PR

* Subpartitioning: Adds APIs for public release and increase REST API version (#3763)

* initial commit, Http version issues still needs to be resolved

* updateContracts + update Http Version

* updateded version in test

* update contracts

* requested changed

* changed name in comments to subpartitioning from multihash

* undid changes to TestLiteralSerialization.xml

* removed changes to non API.json files

* removed non XXXAPI.json file changes

* changed verbage on public comments

* changed error message to reflect verbage change

* Change Feed Processor: Fixes LeaseLostException leaks on notification APIs for Renew scenarios (#3775)

* Adding cases

* Tests

* Upgrade Resiliency: Refactors GatewayAddressCache to Mark TransportAddresses to Unhealthy when Connection Reset Event Occurs (#3768)

* Code changes to mark the transport uri to unhealthy for which a connection reset event occures through the connection state listener.

* Code changes to bump up the direct version.

* Code changes to clean up Gateway Address Cache.

* Code changes to fix pipeline build.

* Code changes to fix serilization test failures.

* Code changes to add force refresh to the gateway function callback delegate.

* [Preview] PriorityBasedExecution: Adds PriorityLevel as a RequestOption (#3672)

* Added Priority Level as a Request Option

* Changed Priority Level Low and High to 1 and 2 respectively

* Bumped DirectVersion

* Added made PriorityLevel internal for non preview packages

* Deleted PriorityLevelTests.cs

* Added description of Priority Level in RequestOptions.cs

* Modified comments for PriorityLevel in RequestOptions.cs

* Updated Contracts

* Modified Remarks for PriorityLevel and added see also link.

* Updated contracts

---------

Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>

* [Internal] Client Telemetry: Adds sampling logic for network level telemetry (#3750)

* sampling logic add

* throttlinfix

* fix tests

* fix tests

* remove dispose from sampler

* add 412

* draft push

* refactor code for sampling

* clean up

* start testing

* adding tests

* wip

* test fix

* fix test

* fix tests

* deleted extra file

* remove one toList

* add custome logic for sampling

* code refactor

* replace key

* remove commented code from test

* added more comments

* simpler sampler logic

* refactor code

* [Internal] Emulator Test : Fixes test when running with distributed tracing enabled. (#3751)

* enable DT for everything

* try1

* code refactoring

* fix pipeline

* try 2

* Revert "try 2"

This reverts commit 61643f9b4dcd2ab1898fd68b111897bed0bc6bcf.

* Revert "fix pipeline"

This reverts commit 4b217f5f6a087b1dd889b804fd8b477accd46419.

* Revert "code refactoring"

This reverts commit d1ff0ddc17ad655360988d171bd033617752f91f.

* Revert "try1"

This reverts commit bf9c41b43684f59719c3673d6f9c7450bbdc5142.

* lazy factory and threadsafe

* scope factory in function

* try non static

* add flag

* fix test

* add consoles

* more console with fix

* fix tests

* temporarily enable dt

* fuix tests

* dispose listener

* fix tests

* remove delay

* revert flag change

* dynamically get number of test in trace class

* Release: Adds SDK version and changelog for 3.32.3 (#3788)

* Adding contract and version bump

* Adding changelog

* SummaryDiagnostics: Refactors Code to Remove Dependency of HttpResponseHeadersWrapper to fetch Sub Status Codes (#3792)

* Code changes to fetch sub status code from http response/ content headers.

* Code changes to address review comments.

* Code changes to return the first element from the sub status list.

* Code changes to update first or default.

* [Internal] Documentation: Fixes API name to NoSQL (#3795)

* [Internal] CTL: Fixes docker image pipeline (#3794)

* [Internal] AI Integration : Refactors useragent attribute name as per Otel conventions (#3784)

Co-authored-by: Fabian Meiswinkel <fabian@meiswinkel.com>

* HttpClient: Adds Properties to the Http messages if available (#3803)

* Passing properties

* test

* Documentation: Refactors SQL API reference to NoSQL API (#3793)

Co-authored-by: Kiran Kumar Kolli <kirankk@microsoft.com>

* [Internal] Perf test: Refactors code to re-enable performance tests (#3785)

* enable perf tests

* updated json

* upgrade benchmark

* update results

* updated benchmark results

* HttpClient: Adds detection of DNS changes through use of SocketsHttpHandler for .NET 6 and above (#3762)

* initial commit

* removed unneeded usings

* added validation callback, still needs tests

* nits + fixes

* added additional test

* test change

* removed unneeded Dispose calls

* removed unnneed dispose calls

* requested changes

* added pooledConnectionLifetime as client option

* nit

Co-authored-by: Kevin Pilch <me@pilchie.com>

* Update Microsoft.Azure.Cosmos/src/HttpClient/CosmosHttpClientCore.cs

Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>

* Update Microsoft.Azure.Cosmos/src/CosmosClientOptions.cs

Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>

* suggested changes

* remove test, reorder usings

* updated contracts

* removed all non XXXAPI.json changes from UpdateContracts run

* removed public surface, added random timespan

* removed change from unrelated file

* Update Microsoft.Azure.Cosmos/src/HttpClient/CosmosHttpClientCore.cs

Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>

* added thread safe random method

* nit

* fixed merge mistake

* added reflection failsafe/error tracing

* nits

* added back removed if

* fixed formatting

* changed random method, fixed serverCertificateCustomValidation

---------

Co-authored-by: Kevin Pilch <me@pilchie.com>
Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>

* [Internal] Tests: Fixes Open Telemetry attributes for ReadMany test (#3805)

* Fixing test

* New baseline

* Undo some changes

* [Internal] Client Telemetry: Refactors code to run client telemetry data processing task in background. (#3783)

* first draft

* remove failure count test

* refactporing

* code refactor

* create task with timeout

* fix test

* code refactoring

* fix timeout code

* space fix

* not failing if processor is taking time

* fix procrsser test

* code refactor

* refactor and test fix

* Patch: Adds Move Operation (#3389)

* Basic changes to introduce move operator

* Added "from" object in patch spec operation.
Added testcase block.

* Fixed testcase.

* Changes made to address comments'

* Added comment regarding enum mutations

* Formatted comment

Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>

* Moved summary location.

* Ran UpdateContracts.ps1

---------

Co-authored-by: Amaan Haque <t-amaanhaque@microsoft.com>
Co-authored-by: Amaan Haque <amaanhaque@microsoft.com>
Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>

* [Internal] Pipelines: Adds nightly build to produce packages (#3802)

* Support cleaning

* wire previous content delete

* as text

* with variable

* another test

* param with types

* as string

* no delete

* no quotes

* undoing

* re-adding quotes

* testing empty

* trying another test

* readding version

* fixing publishing artifacts

* fixing parameter

* Fixing official pipeline

* version 5

* fixing main pipeline

* test with true

* using start time

* nightly preview

* passing parameters to pack

* Fixing nuget version

* arguments on the nuget pack

* folder structure

* testing v5

* Using only content

* Removing currentDate

* [Internal] OpenTelemetry: Direct Package update and replacing diagnostic files (#3797)

* Direct Package update and replacing dagnostic files

* Resolve merge conflicts

* Running updateCOnstracts script

* Removed LinqTranslationWithCustomSerializerBaseline file

* Adding isDistributedTracingEnabled flag

* Running update contracts

* Running update contracts

* Running update contracts

* fix test

* Code cleanup for test fix

* Code cleanup for test fix

* Making regex expression readable

* Adding comment for regex expression

---------

Co-authored-by: Sourabh Jain <sourabhjain@microsoft.com>

* [Internal] MerlinBot: Adds auto-merge and cleanup automation (#3813)

* Add config changes

* Polishing automerge config

* Update fabricbot.json (#3824)

* [Internal] Upgrade Resiliency: Adds Logic to Validate `Unknown` Replicas along with `Unhealthy`. (#3820)

* Code changes to add aggressive validation logic.

* Code changes to enable aggressive validation for all regions.

* Code changes to pull in msdata cosmos.direct changes related to aggresive validation logic.

* Code changes to make minor cosmetic changes.

* Code changes to address review comments.

* Serialization: Fixes call to CosmosSerializer.FromStream on Gateway mode when EnableContentResponseOnWrite is false (#3814)

* Do not call serializer if ResponseMessage.Content is empty.

* Add unit test

* Update unit tests

* Remove unused usings

---------

Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>

* [Internal] Documentation: Adds documentation covering build pipelines (#3822)

* Add doc

* Move benchmark

* Fixing texts

* Client Encryption: Adds release version of Microsoft.Azure.Cosmos to Microsoft.Azure.Cosmos.Encryption.Custom (#3799)

* cosmos version change

* changing preview to release

* resolving code review comments

---------

Co-authored-by: Santosh Kulkarni <66682828+kr-santosh@users.noreply.github.com>

* SDK 3.33.0 : Adds version bump and changelog (#3823)

* release 3.30.0

* added changelog

* updated changelog

* updated changelog

* suggested change to changelog

* updated changelog

---------

Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>

* [Internal] Documentation: Adds msdata/direct Sync-up Guide. (#3828)

* Code changes to add msdata/direct sync-up documentation.

* Code changes to address review comments.

* Code changes to address further review comments.

* Code changes to address minor review comments.

* Removed internal links.

* Query: Adds TRIM string system function support in LINQ (#3833)

* add trim support

* Added some test coverage

* address reviews

---------

Co-authored-by: Minh Le <leminh@microsoft.com>

* Query: Fixes Parsing Error in SQL DOM when CultureInfo is available (#3832)

* add fix

* Add cultural info to test to verify correct behavior

* address pr review to restore to restore culture

* fix comment

---------

Co-authored-by: Minh Le <leminh@microsoft.com>

* Client Encryption: Adds api FetchDataEncryptionKeyWithoutRawKeyAsync and FetchDataEncryptionKeyAsync to get DEK without and with raw key respectively.  (#3809)

* added raw key to MdeEncryption

* adding ray key to Mde Algo

* test case changes

* resolving code review comments

* code optimization to reduce keyvault calls

* removed Microsoft.Data.Encryption.Cryptography nuget package

* added api for dek with raw key

* resolved code review comments

* adding change log

* code review changes

* Initial commit (#3826)

* Query: Adds Computed Property SDK Support (#3761)

* Initial commit

* Restored settings.json changes.

* Update

* Addressed comments; still need to be tested using Emulator.

* Fixes after test run.

* Ignored the computed property tests based on the sync this morning (to allow for preview release).

* Suite0 fixes.

* Test update.

* Suite0 fixes

* [Internal] Samples: Adds OpenTelemetry and Application Insights samples (#3818)

* add opentelemetry and application insights samples

* address pr comments

* [Internal] Query: Added custom serializer coverage tests to ExpressionToSQL.cs (#3722)

* Ensure enum as string is preserved for custom serializer

* Failing test

* Added failing tests

* Updated requested names

* Ignore result of test for now

* Added additional comment on why the test is ignored

* Replaced with sample code

* Remove ignore attribute from tests, documented misbehavior for future use

* Updated comment

---------

Co-authored-by: leminh98 <leminh.ams@gmail.com>

* Query: Added remaining Cosmos Type checking functions to CosmosLinqExtensions (#3724)

* Added the remaining Cosmos Type checking functions to the CosmosLinqExtensions

* Added comments requested

* Updated comment

* Updated baseline

* Improve readability of dictionary initialization

* Aligned with code style guide

* Revert change to baseline

* Executed update baseline script

---------

Co-authored-by: neildsh <35383880+neildsh@users.noreply.github.com>
Co-authored-by: leminh98 <leminh.ams@gmail.com>

* update sdk version and section tags (#3841)

* PackageLicense: Removes PackageLicenseUrl and Adds PackageLicenseFile since PackageLicenseUrl is deprecated (#3847)

* proposal to add PackageLicenseFile since PackageLicenseUrl is deprecated. https://github.com/NuGet/Home/issues/4628

* adding attribute Visible=false

* making ChangeFeedMode.LatestVersion accessible to the public (#3854)

* AI Integration: Fixes Operation Name in the activity and end to end Tests. (#3845)

* first draft

* second draft

* 3rd draft

* remove untouched file

* test fix

* fix order

* change order

* refactor

* skip network activities in test

* remove network attributes

* SDK 3.34.0 : Adds version bump and changelog (#3855)

* SDK 3.34.0: Adds version bump and changelog

* adding changelog changes

* added a missing PREVIEW PR

* Update changelog.md

Co-authored-by: Justine Cocchi <jucocchi@microsoft.com>

* Update changelog.md

Co-authored-by: Kiran Kumar Kolli <kirankk@microsoft.com>

* removed 3840 as it was not committed

* change text for 3832

* fix merge issue

* add 3724

* Update changelog.md

Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>

* Update changelog.md

Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>

* including 3845

---------

Co-authored-by: Justine Cocchi <jucocchi@microsoft.com>
Co-authored-by: Kiran Kumar Kolli <kirankk@microsoft.com>
Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>

* Release: Fixes changelog.md change for 3845 to preview (#3859)

* removing ThirdPartyNotice.txt from content and contentfiles folders (#3864)

* Documentation: Adds see also link to Container.CreateTransactionalBatch (#3860)

* Linking limit documentation to Container.CreateTransactionalBatch(PartitionKey) method

* Resolved PR comments

* Links update

* Using learn.microsoft instead of docs.microsoft in the links

---------

Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>

* Query: Adds type-markers with count and length for large arrays (#3852)

* initial commit

* cleanup

* update test output

* cleanup

* typo

* Pr comments

* [Internal] AI Integration or Open Telemetry: Design Document (#3858)

* first draft

* redesign

* ädd link

* updated observability url

* Benchmarking: Adds use of ARM Templates for benchmarking (#3838)

* initial commit DONT REVIEW

* fixes and documentation

* Apply suggestions from code review

Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>

* requested changes

* Apply suggestions from code review

Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>

* name changes

* readme changes

* nits + changing case of parameters file

---------

Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>

* Update README.md (#3875)

URL typo.

* moved to new file (#3876)

* Direct Package Upgrade 3.31.0: Refactors code to make compatible with latest direct (#3877)

* upgrade to 3.31.0

* add more regions

* enable dt for operations

* updated contract file

* [Preview] Integrated cache: Adds BypassIntegratedCache to DedicatedGatewayRequestOptions (#3836)

* Integrated cache: Add BypassIntegratedCache to DedicatedGatewayRequestOptions

Currently, integrated cache is used by default for Dedicated Gateway.
Customers cannot skip cache for particular requests or data unless they
shift to multi-tenant Gateway,which will lose the benefits of Dedicated
Gateway.

For customers to have more control over integrated cache, we're
introducing a new "RequestOption" called "BypassIntegratedCache". This
option will allow the customer to decide whether to use integrated cache
for each request or not. If this value is set to true, the item/query
will be served from backend and won't be cached in Dedicated Gateway.

* Move this feature to public preview

* Address comments

1. Add more tests
2. Add more detail and example code for BypassIntegratedCache

* Revert changes in EncryptionCustomAPI

---------

Co-authored-by: Jiajun Peng <jiajunpeng@microsoft.com>
Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>

* Client Encryption: Adds Microsoft.Azure.Cosmos compatibility to version 3.34.0 (#3874)

* chaging Microsoft.Azure.Cosmos support version

* resolved merge conflicts

* CosmosClient: Fixes missing Trace when converting HTTP Timeout to 503 (#3866)

* Added tracing when converting HTTP Timeout to 503

* Fixed tracing when converting HTTP Timeout to 503

* Resolved PR comments

* Using ITrace as part of ClientSideRequestStatisticsTraceDatum

* Refactoring

* Test update

* Unit tests fix

* AI Integration: Fixes Open Telemetry Example (#3868)

* first draft

* add filter

* revert csproj

* fix sample

* changed log message

* remove unused library

* [Internal] Query: Adds OptimisticDirectExecute and RequiresDistribution headers (#3882)

* Adding ODE and RequiresDistribution Headers

* Fixed comments

* Updated parameter in SwitchToFallbackPipelineAsync

* Renamed TryUnwrapContinuationToken to UnwrapContinuationToken

---------

Co-authored-by: neildsh <35383880+neildsh@users.noreply.github.com>

* Query: Refactors the EnableOptimisticDirectExecution flag to be public (#3883)

* Made EnableOptimisticDirectExecution a public flag

* Updated contract

* [Internal] OpenTelemetry : Adds Telemetry Distributed Tracing functionality (#3801)

* Direct Package update and replacing dagnostic files

* Resolve merge conflicts

* Running updateCOnstracts script

* Add code changes for distributed tracing open telemetry changes

* Add distributed tracing tests

* Updated tests for distributed tracing

* Addin traceID for diagnostics

* Running update contract script

* Removed LinqTranslationWithCustomSerializerBaseline file

* Adding isDistributedTracingEnabled flag

* Running update contracts

* Running update contracts

* Updates based on differnt code review comments

* Running update contracts

* Running update contracts

* Running update contracts

* fix test

* Code cleanup for test fix

* Running Update contracts

* resolving merge conflicts

* resolving merge conflicts

* Set EnableDistributedTracing to true for performance tests

* Benchmark project change for distributed tracing

* Updating tests

* Updated unit tests

* Updated unit tests

* Updated tests and constructors based on review comments

* Updated scope name in recorder

* Updated distributedOtel tests to cover more scenarios

* Updated distributedOtel tests

* Reverting benchmark performance test changes

* Update DistributedOpentelemetry tests

* Update test cleanup

* Update distributed tests with custom builder

* Update distributed open telemetry tests

* Update contracts

* Cleanup files

* Update distributed Otel tests

* Update distributed Otel tests

* code refactoring

* fix custom listener

* Update direct package to 3.31.1

* Code clean up

* Update tests with display name

---------

Co-authored-by: Sourabh Jain <sourabhjain@microsoft.com>

* Documentation: Adds additional remarks to CosmosClient (#3891)

* CosmosClient documentation improvements

* Cref fix

* Link fix

* Documentation fix

* Typo fix

---------

Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>

* Open Telemetry End To End Test: Adds baseline for network level requests trace (#3887)

* enable request level in end to end

* made some changes

* fix tests

* fix display name

* hardcoded containername and databasenam

* fix tests

* temp

* fix tests

* update contracts

* fix tests

* fixed display name

* [Internal] Design Docs: Adds Design Document for Client Telemetry (#3590)

* sdk design for client telemetry

* Otel design

* update optel design

* added more nformation

* updated ct design

* remove otel design

* Client Telemetry Design

* update typos

* fix typos

* fix typos

* added limitation

* updated docs

* updated doc

* updated text

* Update docs/observability.md

Co-authored-by: Kiran Kumar Kolli <kirankk@microsoft.com>

* Update docs/observability.md

Co-authored-by: Kiran Kumar Kolli <kirankk@microsoft.com>

* Update docs/observability.md

Co-authored-by: Kiran Kumar Kolli <kirankk@microsoft.com>

* Update docs/observability.md

Co-authored-by: Kiran Kumar Kolli <kirankk@microsoft.com>

* Update docs/observability.md

Co-authored-by: Kiran Kumar Kolli <kirankk@microsoft.com>

* move stuff here and there.

---------

Co-authored-by: Kiran Kumar Kolli <kirankk@microsoft.com>

* [Internal] Design Docs: Adds Design Document for Client Telemetry Part 2 (#3903)

* updated doc

* Update docs/observability.md

Co-authored-by: Justine Cocchi <jucocchi@microsoft.com>

* updated text

---------

Co-authored-by: Justine Cocchi <jucocchi@microsoft.com>

* ConnectionPolicy: Refactors Code to Reduce Default Request Timeout to 6 Seconds. (#3902)

* Code changes to reduce default request timeout to 6 seconds.

* Code changes to update API doc default request timeout to 6 seconds.

* [Internal] Upgrade Resiliency: Adds Replica Health State Diagnostics. (#3835)

* Code changes to add replica health status in diagnostics.

* Code changes to fix performance test build failure.

* Code changes to add health state capture logic in address cache.

* Code changes to fix benchmark test execution.

* Code changes to add tests to validate health state cache.

* Code changes to reduce default request timeout to 5 seconds.

* Revert "Code changes to reduce default request timeout to 5 seconds."

This reverts commit 139f37e588fc9dfed608431f4186c567a080e622.

* Subpartitioning: Fixes handling of split physical partitions (#3879)

* Initial Commit DO NOT REVIEW

* bug fix, needs Direct Package Changes

* fix for change feed and query plus tests

* clean up

* query + clean up

---------

Co-authored-by: Kiran Kumar Kolli <kirankk@microsoft.com>

* [Query] Fixes empty property name parsing exception (#3907)

* inital commit

* cleanup

* test cleanup

* PR comments

* PR comment

* [Preview] Query: Refactors EnableOptimisticDirectExecution to true by default in Preview mode (#3909)

* Setting EnableODE to true by default in Preview Mode.

* Added seperate if block for default value

* Updated property

* Removed unused Usings

* Updated contracts

* Updated test

* Updated directive indentation

* Documentations: Adds links to PatchItems docs (#3910)

* Added links to PatchItems docs

* Undo changes from internal file

* [Internal] Direct Package Upgrade: Refactors Code to Bump Up `Cosmos.Direct` Package to `3.31.2` (#3918)

* Code changes to bump up the direct version.

* Code changes to mark the Israel Central region as public.

* Code changes to update contracts.

* Code changes to fix test failure. Some clean ups.

* Code changes to add detailed message for open channels count.

* SDK 3.35.0 : Adds version bump and changelog (#3920)

* release PR

* updated changelog.md

* more changelog updates

* [Internal] Last minute fix to changelog for 3.35.0 (#3921)

* release PR

* updated changelog.md

* more changelog updates

* changelog fix

* Update changelog.md

* Update changelog.md

* Code changes to open connections in parallel. Added replica validation in contract.

* [Internal] Query: Adds new header SupportedSerializationFormats (#3911)

* Binary Serilaization Response test

* Added new header SupportedSerializationFormats

* Modified existing use of CosmosSerializationFormatOptions

* Modified tests and removed unused code

* Addressed comments

* Added more negative cases

* Revert changes

* Added spaces

* Addressed comments

* Addressed comments

* Removed SupportedSerializationFormats from Headers file

* Removed unused JsonSerilazationFormats option

* Addressed comments

* Addressed comments

* Addressed comments

* Addressed comments

* Added new enum TransportSerializationFormat

* Added new enum TransportSerializationFormat

* Addressed comments

* Removed unused parameter

* Addressed comments

* updating API

* remove tests

* Text fixes

* fix typo

* remove TransportSerializationFormat header

* text reverts

* revert

* test update

* PR comments

* remove test owner headers HeadersValidationTests.cs

* PR comments - remove unsupported tests and scope client

---------

Co-authored-by: Heet <detrojaheet@gmail.com>
Co-authored-by: neildsh <35383880+neildsh@users.noreply.github.com>
Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>

* Code changes to optimize the rntbd open connection logic to open connections in parallel. (#3939)

* Query : Adds support for newtonsoft member access via ExtensionData (#3834)

* Support newtonsoft member access via ExtensionData

* Return null instead of empty string

* Added tests for select & where

* Updated baseline with note

---------

Co-authored-by: leminh98 <leminh.ams@gmail.com>

* HttpTransport: Fixes HttpTimeoutPolicies to not accidentally suppress retries (#3944)

* Fix HttpTimeoutPolicies to not accidentally suppress retries

* Removing HttpTimeoutPolicy.MaxRetryTimeLimit altogether

* SDK 3.35.1 : Adds version bump and changelog (#3945)

* version bump

* changelog

* contract

* [Internal] Changelog: Fixes recommended version and title (#3948)

* SDK 3.35.1: Adds version bump and changelog

* Update changelog.md

* Update changelog.md

* Update changelog.md

* Update changelog.md

* Update changelog.md

* [Internal] Dependencies: Fixes dependabot alert for System.Linq.Dynamic.Core (#3957)

* Removing 1

* Removing 2

* Removing 3

* [Internal] Upgrade Resiliency: Adds Code to Enable Replica Validation Feature for Preview (#3951)

* Code changes to add replica validation feature in cosmos client options.

* Code changes to upgrade the cosmos direct version to 3.31.3.

* Adding emulator test to cover replica validation.

* Code changes to address cosmetic clean ups.

* Code changes to address review comments. Fixed preview build failures.

* Code changes to enable replica validation for preview package by default.

* Code changes to address review comments.

* Code changes to fix preview unit tests.

* Code changes to disable environment variable at the end of the test.

* Client Encryption: Adds package reference Microsoft.Azure.Cosmos version 3.35.1-preview (#3956)

* changing cosmos preview version

* updating build file

---------

Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>

* [Internal] FabricBot: Adds GitOps.ResourceManagement because of FabricBot decommissioning (#3966)

* Add prIssueManagement.yml to onboard repo to GitOps.ResourceManagement as FabricBot replacement

Owners of the FabricBot configuration should have received email notification. The same information contained in the email is published internally at: https://aka.ms/gim/fabricbot. Details on the replacement service and the syntax of the new yaml configuration file is available publicly at: https://microsoft.github.io/GitOps/policies/resource-management.html

Please review and merge this PR to complete the process of onboarding to the new service.

* Deleting fabricbot.json

---------

Co-authored-by: microsoft-github-policy-service[bot] <77245923+microsoft-github-policy-service[bot]@users.noreply.github.com>

* [Internal] Query: Refactors certain tests to not fail when EnableOptimisticDirectExecution is set to true in 3.35.0-preview package (#3955)

* Updated emulator and baseline tests to not fail when ODE is set to default true in PREVIEW mode

* Fixed QueryAsync() test

* Fixed QueryAsync() in EndToEndTraceBaselineTests

* Undid changes to IndexMetrics baseline file

* Updated EndToEndTraceWriterBaselineTests.QueryAsync xml

* Updated xml

* Updated xml to have request options tag

* Diagnostics: Fixes verbose levels for "Operation will NOT be retried" (#3969)

* Query: Fixes malformed continuation token exception type and message (#3917)

* Fixed malformed continuation token issue where Exception was not CosmosExceptionan and did not have the correct Status and Sub Status codes.

* Fixed incorrect indentation

* Added type check for incoming exception

* Replaced if/else with extra catch block

* Moved fix to a higher point in the call stack

* Removed unused Usings

* Updated test code

---------

Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>

* [Internal] Upgrade Resiliency: Refactors Code to Enable Replica Validation Feature Through `CosmosClientOptions` And Environment Variable (#3974)

* Code changes to use client options to enable or disable replica validation.

* Code changes to fix preview build failures.

* Query : Adds string comparison alternative when converting LINQ to SQL (#3668)

* string.Compare supported with LINQ to SQL

* Update tests

* Update test name

* Update tests

* Add test

* Create helper ReverseExpressionTypeForStrings

* PR feedback

* Update tests

* Update base line

---------

Co-authored-by: Aditya <adityasa@users.noreply.github.com>
Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>

* AI Integration: Fixes event generation for failed requests (#3973)

* first draft

* fix code

* included feedback

* flip condition

* updated docs

* Update docs/observability.md

Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>

* Update observability.md

* updated contract

---------

Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>

* [Internal] Category: Refactors Cosmos benchmark operations (#3961)

* Refactoring: base classes for operations.

* Updating comments.

* Adding new line at the end of the file.

* Fixing code review points.

* Restore PrepareAsync to be virtual.

* 3.35.2: Adds new SDK versions and contract files (#3985)

* Updated change log and bumped up the version.

* Changing the version to 3.35.2

* Code changes to address review comments.

* Code changes to make minor fixes.

* Code changes to move some fixes into preview.

* [INTERNAL] LocalQuorum: Adds documentation for LocalQuorum (#3993)

* Draft of local-quorum documentation

* Adding experimental to header

* Adding cross-region read guarantees

* Reads Bounded clarification

* Adding account consistency step also

* Non-Prod usage note at top

* Addressing review comments

* Some more refinement

* Code changes to update release note. (#3996)

* Code changes to update files to match with v3 master.

---------

Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>
Co-authored-by: neildsh <35383880+neildsh@users.noreply.github.com>
Co-authored-by: Sourabh Jain <sourabh.jain.107@gmail.com>
Co-authored-by: Sourabh Jain <sourabhjain@microsoft.com>
Co-authored-by: aavasthy <113193425+aavasthy@users.noreply.github.com>
Co-authored-by: Kiran Kumar Kolli <kirankk@microsoft.com>
Co-authored-by: Aditya <adityasa@users.noreply.github.com>
Co-authored-by: Fabian Meiswinkel <fabian@meiswinkel.com>
Co-authored-by: akotalwar <94020786+akotalwar@users.noreply.github.com>
Co-authored-by: Nalu Tripician <nalutrip@icloud.com>
Co-authored-by: Nalu Tripician <ntripician@microsoft.com>
Co-authored-by: Pramod Valavala <43602528+PramodValavala-MSFT@users.noreply.github.com>
Co-authored-by: Ezra Haleva <115735172+ezrahaleva-msft@users.noreply.github.com>
Co-authored-by: Vivek Ravindran <vivekra@microsoft.com>
Co-authored-by: Prasad Ullal <36418906+prasadu-microsoft@users.noreply.github.com>
Co-authored-by: Philip Thomas <86612891+philipthomas-MSFT@users.noreply.github.com>
Co-authored-by: Arthur Augsten <arthuraugsten@gmail.com>
Co-authored-by: Augsten <aaugsten@harbourvest.com>
Co-authored-by: Ruben Bartelink <ruben@bartelink.com>
Co-authored-by: Santosh Kulkarni <66682828+kr-santosh@users.noreply.github.com>
Co-authored-by: pravengithub <124255233+pravengithub@users.noreply.github.com>
Co-authored-by: DESKTOP-ED57J7H\Prashanth Venkataram <vprashanth1987@hotmail.com>
Co-authored-by: Justine Cocchi <jucocchi@microsoft.com>
Co-authored-by: Abhijeet Mohanty <mabhijeet1995@gmail.com>
Co-authored-by: Achint-Agrawal <45819170+Achint-Agrawal@users.noreply.github.com>
Co-authored-by: Nimit Shah <nimit.svnit@gmail.com>
Co-authored-by: SaurabhSharma-MSFT <38112130+SaurabhSharma-MSFT@users.noreply.github.com>
Co-authored-by: leminh98 <leminh.ams@gmail.com>
Co-authored-by: Minh Le <leminh@microsoft.com>
Co-authored-by: Nalu Tripician <27316859+NaluTripician@users.noreply.github.com>
Co-authored-by: Scott Addie <10702007+scottaddie@users.noreply.github.com>
Co-authored-by: Kevin Pilch <me@pilchie.com>
Co-authored-by: Amaan-Haque <54414760+Amaan-Haque@users.noreply.github.com>
Co-authored-by: Amaan Haque <t-amaanhaque@microsoft.com>
Co-authored-by: Amaan Haque <amaanhaque@microsoft.com>
Co-authored-by: Baltima <130716409+Baltima@users.noreply.github.com>
Co-authored-by: vipulvishal-ms <110802706+vipulvishal-ms@users.noreply.github.com>
Co-authored-by: Erik O'Leary <969938+onionhammer@users.noreply.github.com>
Co-authored-by: Rinat Minibaev <132935507+rinatmini@users.noreply.github.com>
Co-authored-by: Maya-Painter <130110800+Maya-Painter@users.noreply.github.com>
Co-authored-by: jiajunpeng-msft <32749342+jiajunpeng-msft@users.noreply.github.com>
Co-authored-by: Jiajun Peng <jiajunpeng@microsoft.com>
Co-authored-by: Heet <detrojaheet@gmail.com>
Co-authored-by: microsoft-github-policy-service[bot] <77245923+microsoft-github-policy-service[bot]@users.noreply.github.com>
Co-authored-by: ernesto1596 <ernestoc@microsoft.com>
Co-authored-by: Mikhail Lipin <michael.lipin@outlook.com>
kirankumarkolli added a commit that referenced this pull request Oct 24, 2023
…v3 master and Cosmos.Direct Release v3.31.5 (#4152)

* [Internal] Client Telemetry: Fixes tests leaking environment variables (#3517)

* Adding log lines

* More logs

* Debugging further

* Removing other builds

* And more debugging

* Wrong build parameters

* Wrong category

* Removing noise

* Fixing test

* Adding utils

* Adding test with client telemetry enabled

* Fixing leak in Client Telemetry Tests

* Reenabling test

* cpu monitor initialization

* Adding name details

* Undo another file

* Updated change log and bumped up the version. (#3526)

* Query: Fixes performance regression on target partition on some ORDER BY queries with continuation (#3525)

* Revert performance regression caused by https://github.com/Azure/azure-cosmos-dotnet-v3/pull/1289/

* Remove irrelevant comment

* Add a test for validating formatted filters for the target partition

* [Internal] AI Integration: Adds SubStatusCode Information in attributes (#3533)

* wip

* regenerated baseline

* add test

* fix test

Co-authored-by: Sourabh Jain <sourabhjain@microsoft.com>

* Diagnostics: Removes unused properties and reduces size (#3519)

* Remove starttime and id from diagnostics string

* Remove starttime and id from diagnostics string

* Update xml files for trace baseline tests

* Update xml files for trace baseline tests

* Update xml files for trace baseline tests

* Whitespaces update

* Changed starttime position based on code review

Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>

* [Internal] docs: Add address caches conceptual flow (#3534)

* Rough draft

* Some more changes

* Adding a new section

* Some more refinement

* Some changes 

Lets get the feedback

* Some MISC changes

* Release: Adds SDK version and changelog for 3.31.2 (#3546)

* Bumped SDK version and changelog

* Added contracts file for 3.31.2

* [Internal] Documentation: Removes invalid comment from ReadThroughputAsync (#3516)

* [Internal] nugetconfig: Removes specific overrides (#3551)

* Query: Fixes partition range evaluation for spatial queries (#3495)

* Initial commit

* Update.

* Pull/Rebase

* Addressed comments.

* Build fix

* [Internal] Documentation: Refactors cache content on its own document (#3554)

* Add cache file

* Moving content away

* [Internal] Emulator unit tests: Adds IdEncoding unit tests for ComputeGateway (#3556)

* Adding IdEncoding unit tests for ComputeGateway

* Reacting to code review feedback

* Updating md files

* Change Feed Processor: Adds support for Resource Tokens (#3566)

* Adding rid parsing

* Test

* Removing dead code

* Contract update

* [Internal] AI integration: Refactor code how container and database name is flowing to opentelemetry module (#3532)

* wip

* WIP

* Revert "WIP"

This reverts commit 71275de54b9e67fa54a37e79d450b9597e173934.

* Revert "wip"

This reverts commit 586fa9865cc3f40dabd7ef90fb3e0cf499a045bc.

* wip add containe and database info

* redesign how container and database name information flows into opne telemetry data

* test fix

* fix test

* fix tests

* fix typos

* baseline test fix

Co-authored-by: Sourabh Jain <sourabhjain@microsoft.com>

* [Internal] AI Integration: Adds a new flag in DistributedTracingOptions (#3562)

* add flag in diagnostic options

* test fixes

* rename variable

* test fix

* add validation

* fix baseline

* test fix

Co-authored-by: Sourabh Jain <sourabhjain@microsoft.com>

* Query: Fixes default to BadRequestException in case of internal errors in ServiceInterop (#3399)

* Don't default to BadRequestException in case of errors in ServiceInterop

* Incorporate code review feedback

* Fix build error

* fix up failing test

* [Internal] Query: Adds unit tests for Merge/Split implementation with OptimisticDirectExecution pipeline (#3510)

* Added tests to test different aspects of merge/split support with OptimisticDirectExecution pipeline. Tests check for gone exception handling, pipeline switching etc.

* Added gone exception simulation tests.

* Added new tests and improved test infra

* Removed ParalleContEvocation test. Fixed comments

* Removed CreateParallelCrossPartitionPipelineStateAsync() as it is not being used anymore

* Removed while loop in CreateDocumentContainerAsync()

* Fixed comments.

* Updated ExecuteGoneExceptionOnODEPipeline()

* Added type Assert for ExecuteGoneExceptionOnODEPipeline()

* Updated OptimisticDirectExecution pipeline abbreviation

* Updated TestBaseline folder with new xml

* Client Retry Policy: Adds HTTP timeouts with request-level cross-region retry (#3555)

* Fixes to ReadThroughputAsync for databases with no provisioned throughput and null as request options

* fixed failure to ReadReplaceThroughputResponseTests

* Added Stream Method

* Ran UpdateContract.ps1

* Encryption implemtation

* Fixed spelling error

* Update Microsoft.Azure.Cosmos.Encryption/src/EncryptionDatabase.cs

Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>

* Variable name change

* Update Microsoft.Azure.Cosmos/src/Resource/Database/Database.cs

Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>

* Suggested Changes and fixes

* Removed manufactured ResponseMessage + nits

* Simplified PR

* nits

* nits

* initial changes TODO: Update tests

* updated tests

* nits'

* Ran UpdateContracts.ps1

* nits + requested changes

* Delete NuGet.Config

* Update Microsoft.Azure.Cosmos/src/HttpClient/CosmosHttpClientCore.cs

Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>

* Update Microsoft.Azure.Cosmos/src/HttpClient/HttpTimeoutPolicy.cs

Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>

* Update Microsoft.Azure.Cosmos/src/HttpClient/HttpTimeoutPolicy.cs

Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>

* Update Microsoft.Azure.Cosmos/src/HttpClient/HttpTimeoutPolicy.cs

Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>

* Use Cosmos Exception Factory, Simplified Tests

* removed unused code

* nits: removed unused code

* removed unused code

Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>
Co-authored-by: Nalu Tripician <ntripician@microsoft.com>

* Documentation: Fixes EUAP in Comments (#3579)

* Query: Fixes incorrect FeedResponse.Count when result contains undefined elements (#3574)

* Do not maintain an independent count on QueryResponse that can go out of sync

* Add more test coverage for QueryResponse<T>.Count

* Output the correct count from CosmosElementSerializer when the input contains CosmosUndefined

* Add untyped tests for CosmosUndefined

* Remove commented code

* removed allr eference (#3581)

Co-authored-by: Sourabh Jain <sourabhjain@microsoft.com>

* Trace: Fixes Tracing/diagnostics hour-times to 24Hours (#3577)

* Trace: Fixes Tracing/diagnostics hour-times to 24Hours

* fixing baseline tests

Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>

* AI Integration: Adds cosmetic fixes (#3576)

* wip

* status code int and internal and client kind activity

* remove unused imports

* update baselines

* fix test

* fixed baseline tests

* fix tests

* update base tetss

Co-authored-by: Sourabh Jain <sourabhjain@microsoft.com>

* Query: Adds ALL Scalar Expression (#3509)

* Add SqlAllScalarExpression to v3 DOM

* updated generated parser files

* Parsing for ALL

* Added tests for ALL and baselines

* Added more tests

* added new test, cleanup

* cleaning & fix typos

* fixed typo

* Added new baseline test file names to csproj file

* renamed AggregateAll to AggregateSubquery to accomodate FIRST and LAST later

* Added keywords for 'left' and 'right' and respective function calls

* fixed bug from last commit

* cleaning

* replace tabs with spaces

* cleaning

* Release: Adds API contracts for 3.31.2-preview (#3586)

* [Internal] sccignore: Adds a .sccignore file to apply an exception for artifacts configuration issues (#3589)

* [Internal] PermissionTests: Adds CosmosPermissionTests Coverage (#3593)

* Ensures that both Direct and Gateway connection modes are tested
* Validates that container read works with PermissionMode.Read (test was previously only validating that Delete was blocked - i.e. the negative case).

* [Internal] AI Integration: Refactors to Operation prefix and add tests (#3583)

* add tests for otel and custome listener

* clean up

* null pointer fix

* fix tets

* handle event generation also at operation level

* added documentation

* wip

* change event sourcename

* rename event Name

Co-authored-by: Sourabh Jain <sourabhjain@microsoft.com>

* [Internal] HttpTimeoutPolicy: Removes Data Plane Writes from being able to be retried (#3607)

* data plane writes no longer failover on timeout

* removed duplication of test\

* [Internal] Performance Testing: Adds Distributed Tracing option in benchmarks (#3611)

Co-authored-by: Sourabh Jain <sourabhjain@microsoft.com>

* [Internal] Benchmark: Refactors code to make Memory Stream capacity configurable (#3624)

Co-authored-by: Sourabh Jain <sourabhjain@microsoft.com>

* add new LatestVersion changefeed mode that has same behavior as Incremental; renamed FullFidelity to AllVersionsAndDeletes (#3596)

* Query: Fixes handling of CosmosUndefined, CosmosGuid and CosmosBinary in unordered DISTINCT (#3632)

* Handle CosmosUndefined, CosmosGuid and CosmosBinary in DistinctMap.UnorderedDistinctMap

* Address code review feedback and remove unnecessary allocations from DistinctQueryPipelineStageTests

* [Internal] Subpartitioning: Adds updates to test coverage for subpartitioning (#3618)

* updates to test coverage for subpartitioning

* bug fixes

* now useses Assert.ThrowsException

* Seperated into multiple tests for clarity

* Put MultiHash test into seperate test file

* nit

* [Internal] ContainerProperties: Fixes version reset when setting PartitionKeyPath (#3637)

* Remember previous value

* test

* [Internal] AI Integration: Adds CorrelationId and Activity Id Attributes for query operation (#3630)

* add activityid in Otel attributes

* added correlation id

* operation type fix

* remove test changes

* test fix

* fix baseline test

* rename correlationId

* fix tests again

* include only not null attributes in test

* fixed tests

* changefeedxml

* test fix

* ordering activity in operationname oerder

* fix test

* review comments

* refator header getter setter

* clean up

Co-authored-by: Sourabh Jain <sourabhjain@microsoft.com>

* Documentation: Fixes CosmosClientBuilder.WithConnectionModeGateway parameter description (#3643)

* Fixed CosmosClientBuilder.WithConnectionModeGateway documentation

* Update Microsoft.Azure.Cosmos/src/Fluent/CosmosClientBuilder.cs

Co-authored-by: Ruben Bartelink <ruben@bartelink.com>

Co-authored-by: Augsten <aaugsten@harbourvest.com>
Co-authored-by: Ruben Bartelink <ruben@bartelink.com>

* Upgrade Resiliency: Refactors Implementation for Opening Rntbd Connections to Backend Replicas in Direct Mode. (#3640)

* Code changes to refactor implementations for opening connections to all replicas. Fixed test failures due to Direct package upgrade.

* Code changes to add poland central region as a part of Regions.cs

* Code changes to update contract to reflect new regions.

* Revert "Code changes to update contract to reflect new regions."

This reverts commit f171b3c1c9889043556ddf96bcd33ccd79565ad9.

* Revert "Code changes to add poland central region as a part of Regions.cs"

This reverts commit 1aafbf18f6d80e9a92baa301b6b23cf065e4b155.

* [Preview] AI integration: Adds IsDistributedTracingEnabled flag as public API to enable/disable this feature (#3598)

* make api public for preview

* add null check

* fix tests

* singleton listener initialization

* assign null to listeners

* fix test

* concurrent bag in listener

* renamed to LatencyThresholdForDiagnosticEvent

* renamed to IsDistributedTracingEnabled

* updated xml

* update contract

* made latency threshold flag internal

* fix test

* regeneratebaselines

* update documentation

* rename builder api

* add docs

* updated contracts and all

* doc update

* import cleanup

Co-authored-by: Sourabh Jain <sourabhjain@microsoft.com>

* Change Feed Processor: Fixes behavior with StartTime on Local (#3645)

* To UTC

* Test

* [Internal] Client Telemetry: Refactors code to use base useragent string (#3653)

* [Internal] AI Integration: Refactors code to rename event name (#3648)

* first draft

* rename event name

* updated xmls

* update files

* Region Availability: Adds Poland Central Region For Public Usage (#3656)

* Client Encryption: Adds validation code to check if the Key Vault URI provided in wrap metadata is a valid key identifier. (#3642)

* Check if the key vault uri provided is a valid Kid

* test fix.

* update changelog and build props

* Update Directory.Build.props

* Update Microsoft.Azure.Cosmos.Encryption.csproj

* Fixed preview version

* Refactor

* Update EncryptionDatabaseExtensions.cs

* [Internal] Query: Adds Split Support for Ode (#3572)

* Added tests to test different aspects of merge/split support with OptimisticDirectExecution pipeline. Tests check for gone exception handling, pipeline switching etc.

* Added gone exception simulation tests.

* Added new tests and improved test infra

* Removed ParalleContEvocation test. Fixed comments

* Removed CreateParallelCrossPartitionPipelineStateAsync() as it is not being used anymore

* Removed while loop in CreateDocumentContainerAsync()

* Fixed comments.

* Updated ExecuteGoneExceptionOnODEPipeline()

* Added type Assert for ExecuteGoneExceptionOnODEPipeline()

* Replaced try-catch with if statement in MoveNextAsync()

* Added delegate to access TryCreateCoreContextAsync()

* Added check to confirm Ode pipeline is not called in fallback plan

* Updated method name from OptimisticDirectExecutionContext() to TryCreateOptimisticDirectExecutionContext()

* Using delegate instead of Func<>.

* Ode fallback plan always calls Specialized pipeline

* Using ServiceInterop/Gateway to get QueryPlan for Specialized Pipeline

* Added new test to check handling of failing fallback pipeline

* Code cleanup

* Added logic for handling non ODE continuation tokens

* Moved delegate away from member variables

* Added tests for Merge case

* Updated method names

* Added checks for tryCatch

* Updated SetCancellationToken() to use Try

* Updated TryUnwrapContinuationToken()

* Removed changes in FlakyDocumentContainer.cs

* Removed unused imports

* Updated comments

* Fixed comments and cleaned up test code

* Added CosmosElement null check in TryUnwrapContinuationToken()

* Removed FlakyDocumentContainer.cs from pull request

* Removed unused imports

* Updated TryUnwrapContinuationToken()

* Update MoveNextAsync() call in OptimisticDirectExecutionQueryBaselineTests.cs

* Made MergeTestUtil.IsFailedFallbackPipelineTest a readonly property

* Added IsPartitionSplitException() overload to take CosmosElement

* Fixed bug regarding syntax error queries

* [Internal] AI Integration : Fixes operation type  for batch (#3660)

* fix op type

* fix conflict

* CosmosClientOptions: Adds ServerCertificateCustomValidationCallback for Http and TCP (#3636)

* Adding ServerCertificateCustomValidationCallback in clientoptions

* Adding Server callback for Http and fixing tests

* Fixing failing E2Etests

* Resolving merge conflicts

* Running update contracts script

* Running Update contracts script

* Running Update contracts script

* Reverting the v3 version change

* Update based on review comments

* Added unit tests

* Added remarks for callback delegate

* Ran update contracts script

* Update based on review comments

* Ran update contracts script

* Updated unit tests

* Making ssl validation function private

* Updating test files

* Update remarks for sslvalidation public contract

* Added emulator tests for server validation

Co-authored-by: Debdatta Kunda <87335885+kundadebdatta@users.noreply.github.com>

* Query: Adds EnableOptimisticDirectExecution flag to QueryRequestOptions (#3664)

* Added new flag to QueryRequestOptions to allow customers to use Ode pipeline

* Updated comments in QueryRequestOptions.cs

* Renamed enabledOde to enableOde

* Removed default setting for EnableOptimisticDirectExecution

* [Internal] Tests: Removes Direct/HTTPS emulator tests (#3679)

* Removing direct/https tests

* mppreference

* [Internal] Benchmark : Fixes issue with dependency on Cosmos Project (#3673)

* users/sourabhjain/benchmarkfix

* update pipeline

* Revert "users/sourabhjain/benchmarkfix"

This reverts commit 81b48f0e47aed7a75540c2c83f62cea98d86824f.

* fix compilation error

* add parama for preview pkg also

---------

Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>

* LocalQuorum: Adds Quorum reads on Consistent Prefix Accounts (#3680)

Co-authored-by: DESKTOP-ED57J7H\Prashanth Venkataram <vprashanth1987@hotmail.com>

* 3.32.0: Adds new SDK version and contract files (#3687)

* 3.32.0: Adds new SDK version and contract files

* 3.32.0: Adds new SDK version and contract files

* Updating changelog version

* Updating changelog version

* Added more commits to changelog and updated release contract

* Added documentation tags PR in changelog

* Updated changelog based on reviews

* Updated PR decsription in changelog

* Update changelog.md

Updated full fidelity change description

Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>

---------

Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>

* [Internal] Samples: Adds change feed pull model samples (#3646)

* add change feed pull samples

* refactor appsettings validation

* addressing pr comments

* move task delay

* update sample to use latest change feed mode names

---------

Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>

* [Internal] Tests: Refactors emulator CI (#3688)

* [Internal] GitHub Template: Adds needs-investigation label (#3708)

By default, all "Bug report" issues will have "needs-investigation"

* Adding fabric bot action (#3709)

* CosmosNullReferenceException: Refactors CosmosNullReferenceException to pass along InnerException property on parent NullReferenceException (#3713)

* Passed inner exception details to NullReferenceException ctor when instantiating CosmosNullReferenceException.

* Added unit tests.

* Addressed PR feedback.

* [Internal] PriorityRequests: Fixes header value (#3714)

Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>

* [Internal] Query: Adds single physical partition check for OptimisticDirectExecution queries (#3699)

* Added single physical partition check for Ode queries. Updated test infrastructure for Ode emulator tests too.

* Refactored emulator tests to have all the test cases at the top of the file

* Updated TryGetTargetRangeOptimisticDirectExecutionAsync()

* Uodated logic on how many times CreateIngestQueryDeleteAsync() gets called

* Added debug asserts for partitionKeyDefinition

* Added pageSizeOptions parameter in CreateInput() in EmulatorTests

* Fixed comments

* [Internal] CTL: Fixes Reservoir Sampling Logic (#3712)

* Code changes to fix the reservoir sampling logic in CTL

* Code changes to modify help text on reservoir type.

* Code changes to address minor code refactor.

* Diagnostics: Adds startDate in Summary (#3707)

* Adding start date

* Updated trace files

* PR comment

* Committing missing tests

---------

Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>

* [Internal] Client Telemetry: Adds network information in the payload (#3691)

* first draft

* clean code

* add test

* fix test

* add replica info collection

* fix substatuscode and  operation type error

* fix code

* collect http infor in cache also

* message to stacktrace

* remove rntbd recording from cache

* print proper exception message

* fix test

* cleanup unused code and added few status codes in ignore list

* fixed all exception logging

* refactor conditions

* fix tests

* Documentation: Fixes Database.ReadAsync description (#3457)

* Documentation: Modify retry time to timespan 

Modify retry time in seconds to timespan of parameter maxRetryWaitTimeOnThrottledRequests (Method: [WithThrottlingRetryOptions](https://docs.microsoft.com/en-us/dotnet/api/microsoft.azure.cosmos.fluent.cosmosclientbuilder.withthrottlingretryoptions?view=azure-dotnet#feedback))
Resolves https://github.com/Azure/azure-sdk-for-net/issues/29567

* Documentation: Fixes DeleteItemAsync Example

Documentation: Fixes DeleteItemAsync Example

* Documentation: Fixes ItemRequestOptions Example

Documentation: Fixes ItemRequestOptions Example

* Documentation:Update Database.ReadAsync description

Documentation: Update Database.ReadAsync description

* Documentation: Update Database.ReadAsync description

Documentation: Update Database.ReadAsync description

* Documentation: Updated ToStreamIterator example

Documentation: Updated ToStreamIterator example

* Modified StreamIterator section

* Update Microsoft.Azure.Cosmos/src/Resource/Database/Database.cs

Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>

* Remarks correction

* Revert the StreamIterator changes

Revert the StreamIterator changes

Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>
Co-authored-by: Kiran Kumar Kolli <kirankk@microsoft.com>

* Upgrade Resiliency: Adds Implementation for Validating the Unhealthy Backend Replicas in Direct mode (#3631)

* Code changes to implement replica validation in dotnet v3 sdk.

* Cosmetic changes to add inline code comments.

* Code chages to address review comments.

* Code changes to cover a scenario for async cache.

* Code changes to refactor async non-blocking cache code.

* Code changes to address minor review comments.

---------

Co-authored-by: Kiran Kumar Kolli <kirankk@microsoft.com>

* ReadMany: Fixes BadRequest when using Ids with single quotes (#3732)

* Use parameters

* Emulator tests

* Release: Adds SDK version and changelog for 3.32.1 (#3733)

* version bump

* Contracts

* [Internal] Build: Fixes static tool analysis versions (#3736)

* Update Binskim and follow warnings

* Fixing task

* More version bumps

* binskim args

* Padding

* policheck

* postanalysis parameters

* analysis settings

* Query: Fixes System.ArgumentException when using PartitionKey.None on x86, Linux or in Optimistic Direct Execution (#3730)

* Minor clean up of OptimisticDirectExecutionQueryTests

* More minor cleanup in OptimisticDirectExecutionQueryTests

* Add emulator tests for the bypass query parsing scenario

* Handle PartitionKey.None while creating QueryIterator. This is a workaround for the PartitionKeyInternal.None not following its own contract

* Fix up to correctly handle PartitionKey.None using the CachedContainerQueryProperties

* Add more tests where PartitionKey.None maps to PartitionKey.Undefined

---------

Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>

* Query: Adds FIRST and LAST Scalar Expressions (#3629)

* Add FIRST and LAST objects and update visitors

* add FIRST LAST evaluation and update offline engine visitors

* Add FIRST and LAST to parser

* update another visitor

* Fix typo

* fix typo

* added new tests and baselines

* cleaning

* cleaning

---------

Co-authored-by: neildsh <35383880+neildsh@users.noreply.github.com>
Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>

* Subpartitioning: Adds support for Prefix Partition Key searches for sub partitioned containers (#3109)

* 1st round of changes to support subpartitioning for ChangeFeed

* name change and moved a method to FeedRangePartitionKey

* support for prefix partition change feed and query including unit and emulator tests. need to verify using FeedRange with QueryIterator

* splitting out unit tests from emulator tests

* 1st round of changes to support subpartitioning for ChangeFeed

* name change and moved a method to FeedRangePartitionKey

* support for prefix partition change feed and query including unit and emulator tests. need to verify using FeedRange with QueryIterator

* splitting out unit tests from emulator tests

* moved logic to choose for prefix partition query and change feed

* additional conditional to check for MultiHash partitionkeydefinition kind

* removed unnecessary using

* cleanup

* unnecessary using

* removed PREVIEW from proj

* unit tests for ResolveFeedRangeBasedOnPrefixContainerAsync

* change access modifier

* since I changed to static, needed to fix tests

* dealing with some testing nits

* removed Console.Writeline

* slight change in test use containerProperties and partitionKeyDefinition

* big fix for resolve feedrange, changes to error behavior, added additional test coverage

* test changes

* ran updateContracts.ps1

* reverting to 3ad5309e9e22a7376e836cfdbe11fa2438a59133

* Ran Update Contracts

* ran updateContracts.ps1

* UpdateContracts.ps1

* updatecontracts

* removed bad check from test, removed changes from updatecontracts.ps1

* revert UpdateContracts changes

* Reverting to 756a123160d14c424c5e11c4f3520094115aa5d4

* removed accidental change from changelog

* removed unwanted change from Directory.build.props

* added test clean up

* removed console.writelines

* updates to query test

* removed preview flag

* ran UpdateContrats.ps1

* no longer recread feedRange for queries unless using prefix pk

* simplified if statement

* fixed bug

---------

Co-authored-by: Nalu Tripician <nalutrip@icloud.com>

* [Internal] ClientTelemetry: Adds logic to limit payload size to 2 MB (#3717)

* first draft

wip

fix test and logic

* resolve conflicts

* limit 2 mb

* ad callback

* fix tests

* code refactor

* cosmos json to newtosoft json

* clean up files

* fix logging to argumrnt based

* code refactor

* add null check

* Query: Fixes regression from LINQ custom serializer fix (#3749)

Co-authored-by: Minh Le <leminh@microsoft.com>
Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>

* [Internal] LocalQuorum: Refactors override (i.e. strong) to allow from any account consistency (#3753)

- Localquorum override (i.e. strong) to allow from any account consistency
- Facilitates no-downtime downgrade of existing accounts (i.e. existing Strong/bounded accounts migration to Eventual)

* Release: Adds SDK version and change log for 3.32.2 (#3752)

* version bump

* contract

* changelog

* version bump

* Fixing changelog text

* Add another PR

* Subpartitioning: Adds APIs for public release and increase REST API version (#3763)

* initial commit, Http version issues still needs to be resolved

* updateContracts + update Http Version

* updateded version in test

* update contracts

* requested changed

* changed name in comments to subpartitioning from multihash

* undid changes to TestLiteralSerialization.xml

* removed changes to non API.json files

* removed non XXXAPI.json file changes

* changed verbage on public comments

* changed error message to reflect verbage change

* Change Feed Processor: Fixes LeaseLostException leaks on notification APIs for Renew scenarios (#3775)

* Adding cases

* Tests

* Upgrade Resiliency: Refactors GatewayAddressCache to Mark TransportAddresses to Unhealthy when Connection Reset Event Occurs (#3768)

* Code changes to mark the transport uri to unhealthy for which a connection reset event occures through the connection state listener.

* Code changes to bump up the direct version.

* Code changes to clean up Gateway Address Cache.

* Code changes to fix pipeline build.

* Code changes to fix serilization test failures.

* Code changes to add force refresh to the gateway function callback delegate.

* [Preview] PriorityBasedExecution: Adds PriorityLevel as a RequestOption (#3672)

* Added Priority Level as a Request Option

* Changed Priority Level Low and High to 1 and 2 respectively

* Bumped DirectVersion

* Added made PriorityLevel internal for non preview packages

* Deleted PriorityLevelTests.cs

* Added description of Priority Level in RequestOptions.cs

* Modified comments for PriorityLevel in RequestOptions.cs

* Updated Contracts

* Modified Remarks for PriorityLevel and added see also link.

* Updated contracts

---------

Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>

* [Internal] Client Telemetry: Adds sampling logic for network level telemetry (#3750)

* sampling logic add

* throttlinfix

* fix tests

* fix tests

* remove dispose from sampler

* add 412

* draft push

* refactor code for sampling

* clean up

* start testing

* adding tests

* wip

* test fix

* fix test

* fix tests

* deleted extra file

* remove one toList

* add custome logic for sampling

* code refactor

* replace key

* remove commented code from test

* added more comments

* simpler sampler logic

* refactor code

* [Internal] Emulator Test : Fixes test when running with distributed tracing enabled. (#3751)

* enable DT for everything

* try1

* code refactoring

* fix pipeline

* try 2

* Revert "try 2"

This reverts commit 61643f9b4dcd2ab1898fd68b111897bed0bc6bcf.

* Revert "fix pipeline"

This reverts commit 4b217f5f6a087b1dd889b804fd8b477accd46419.

* Revert "code refactoring"

This reverts commit d1ff0ddc17ad655360988d171bd033617752f91f.

* Revert "try1"

This reverts commit bf9c41b43684f59719c3673d6f9c7450bbdc5142.

* lazy factory and threadsafe

* scope factory in function

* try non static

* add flag

* fix test

* add consoles

* more console with fix

* fix tests

* temporarily enable dt

* fuix tests

* dispose listener

* fix tests

* remove delay

* revert flag change

* dynamically get number of test in trace class

* Release: Adds SDK version and changelog for 3.32.3 (#3788)

* Adding contract and version bump

* Adding changelog

* SummaryDiagnostics: Refactors Code to Remove Dependency of HttpResponseHeadersWrapper to fetch Sub Status Codes (#3792)

* Code changes to fetch sub status code from http response/ content headers.

* Code changes to address review comments.

* Code changes to return the first element from the sub status list.

* Code changes to update first or default.

* [Internal] Documentation: Fixes API name to NoSQL (#3795)

* [Internal] CTL: Fixes docker image pipeline (#3794)

* [Internal] AI Integration : Refactors useragent attribute name as per Otel conventions (#3784)

Co-authored-by: Fabian Meiswinkel <fabian@meiswinkel.com>

* HttpClient: Adds Properties to the Http messages if available (#3803)

* Passing properties

* test

* Documentation: Refactors SQL API reference to NoSQL API (#3793)

Co-authored-by: Kiran Kumar Kolli <kirankk@microsoft.com>

* [Internal] Perf test: Refactors code to re-enable performance tests (#3785)

* enable perf tests

* updated json

* upgrade benchmark

* update results

* updated benchmark results

* HttpClient: Adds detection of DNS changes through use of SocketsHttpHandler for .NET 6 and above (#3762)

* initial commit

* removed unneeded usings

* added validation callback, still needs tests

* nits + fixes

* added additional test

* test change

* removed unneeded Dispose calls

* removed unnneed dispose calls

* requested changes

* added pooledConnectionLifetime as client option

* nit

Co-authored-by: Kevin Pilch <me@pilchie.com>

* Update Microsoft.Azure.Cosmos/src/HttpClient/CosmosHttpClientCore.cs

Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>

* Update Microsoft.Azure.Cosmos/src/CosmosClientOptions.cs

Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>

* suggested changes

* remove test, reorder usings

* updated contracts

* removed all non XXXAPI.json changes from UpdateContracts run

* removed public surface, added random timespan

* removed change from unrelated file

* Update Microsoft.Azure.Cosmos/src/HttpClient/CosmosHttpClientCore.cs

Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>

* added thread safe random method

* nit

* fixed merge mistake

* added reflection failsafe/error tracing

* nits

* added back removed if

* fixed formatting

* changed random method, fixed serverCertificateCustomValidation

---------

Co-authored-by: Kevin Pilch <me@pilchie.com>
Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>

* [Internal] Tests: Fixes Open Telemetry attributes for ReadMany test (#3805)

* Fixing test

* New baseline

* Undo some changes

* [Internal] Client Telemetry: Refactors code to run client telemetry data processing task in background. (#3783)

* first draft

* remove failure count test

* refactporing

* code refactor

* create task with timeout

* fix test

* code refactoring

* fix timeout code

* space fix

* not failing if processor is taking time

* fix procrsser test

* code refactor

* refactor and test fix

* Patch: Adds Move Operation (#3389)

* Basic changes to introduce move operator

* Added "from" object in patch spec operation.
Added testcase block.

* Fixed testcase.

* Changes made to address comments'

* Added comment regarding enum mutations

* Formatted comment

Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>

* Moved summary location.

* Ran UpdateContracts.ps1

---------

Co-authored-by: Amaan Haque <t-amaanhaque@microsoft.com>
Co-authored-by: Amaan Haque <amaanhaque@microsoft.com>
Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>

* [Internal] Pipelines: Adds nightly build to produce packages (#3802)

* Support cleaning

* wire previous content delete

* as text

* with variable

* another test

* param with types

* as string

* no delete

* no quotes

* undoing

* re-adding quotes

* testing empty

* trying another test

* readding version

* fixing publishing artifacts

* fixing parameter

* Fixing official pipeline

* version 5

* fixing main pipeline

* test with true

* using start time

* nightly preview

* passing parameters to pack

* Fixing nuget version

* arguments on the nuget pack

* folder structure

* testing v5

* Using only content

* Removing currentDate

* [Internal] OpenTelemetry: Direct Package update and replacing diagnostic files (#3797)

* Direct Package update and replacing dagnostic files

* Resolve merge conflicts

* Running updateCOnstracts script

* Removed LinqTranslationWithCustomSerializerBaseline file

* Adding isDistributedTracingEnabled flag

* Running update contracts

* Running update contracts

* Running update contracts

* fix test

* Code cleanup for test fix

* Code cleanup for test fix

* Making regex expression readable

* Adding comment for regex expression

---------

Co-authored-by: Sourabh Jain <sourabhjain@microsoft.com>

* [Internal] MerlinBot: Adds auto-merge and cleanup automation (#3813)

* Add config changes

* Polishing automerge config

* Update fabricbot.json (#3824)

* [Internal] Upgrade Resiliency: Adds Logic to Validate `Unknown` Replicas along with `Unhealthy`. (#3820)

* Code changes to add aggressive validation logic.

* Code changes to enable aggressive validation for all regions.

* Code changes to pull in msdata cosmos.direct changes related to aggresive validation logic.

* Code changes to make minor cosmetic changes.

* Code changes to address review comments.

* Serialization: Fixes call to CosmosSerializer.FromStream on Gateway mode when EnableContentResponseOnWrite is false (#3814)

* Do not call serializer if ResponseMessage.Content is empty.

* Add unit test

* Update unit tests

* Remove unused usings

---------

Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>

* [Internal] Documentation: Adds documentation covering build pipelines (#3822)

* Add doc

* Move benchmark

* Fixing texts

* Client Encryption: Adds release version of Microsoft.Azure.Cosmos to Microsoft.Azure.Cosmos.Encryption.Custom (#3799)

* cosmos version change

* changing preview to release

* resolving code review comments

---------

Co-authored-by: Santosh Kulkarni <66682828+kr-santosh@users.noreply.github.com>

* SDK 3.33.0 : Adds version bump and changelog (#3823)

* release 3.30.0

* added changelog

* updated changelog

* updated changelog

* suggested change to changelog

* updated changelog

---------

Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>

* [Internal] Documentation: Adds msdata/direct Sync-up Guide. (#3828)

* Code changes to add msdata/direct sync-up documentation.

* Code changes to address review comments.

* Code changes to address further review comments.

* Code changes to address minor review comments.

* Removed internal links.

* Query: Adds TRIM string system function support in LINQ (#3833)

* add trim support

* Added some test coverage

* address reviews

---------

Co-authored-by: Minh Le <leminh@microsoft.com>

* Query: Fixes Parsing Error in SQL DOM when CultureInfo is available (#3832)

* add fix

* Add cultural info to test to verify correct behavior

* address pr review to restore to restore culture

* fix comment

---------

Co-authored-by: Minh Le <leminh@microsoft.com>

* Client Encryption: Adds api FetchDataEncryptionKeyWithoutRawKeyAsync and FetchDataEncryptionKeyAsync to get DEK without and with raw key respectively.  (#3809)

* added raw key to MdeEncryption

* adding ray key to Mde Algo

* test case changes

* resolving code review comments

* code optimization to reduce keyvault calls

* removed Microsoft.Data.Encryption.Cryptography nuget package

* added api for dek with raw key

* resolved code review comments

* adding change log

* code review changes

* Initial commit (#3826)

* Query: Adds Computed Property SDK Support (#3761)

* Initial commit

* Restored settings.json changes.

* Update

* Addressed comments; still need to be tested using Emulator.

* Fixes after test run.

* Ignored the computed property tests based on the sync this morning (to allow for preview release).

* Suite0 fixes.

* Test update.

* Suite0 fixes

* [Internal] Samples: Adds OpenTelemetry and Application Insights samples (#3818)

* add opentelemetry and application insights samples

* address pr comments

* [Internal] Query: Added custom serializer coverage tests to ExpressionToSQL.cs (#3722)

* Ensure enum as string is preserved for custom serializer

* Failing test

* Added failing tests

* Updated requested names

* Ignore result of test for now

* Added additional comment on why the test is ignored

* Replaced with sample code

* Remove ignore attribute from tests, documented misbehavior for future use

* Updated comment

---------

Co-authored-by: leminh98 <leminh.ams@gmail.com>

* Query: Added remaining Cosmos Type checking functions to CosmosLinqExtensions (#3724)

* Added the remaining Cosmos Type checking functions to the CosmosLinqExtensions

* Added comments requested

* Updated comment

* Updated baseline

* Improve readability of dictionary initialization

* Aligned with code style guide

* Revert change to baseline

* Executed update baseline script

---------

Co-authored-by: neildsh <35383880+neildsh@users.noreply.github.com>
Co-authored-by: leminh98 <leminh.ams@gmail.com>

* update sdk version and section tags (#3841)

* PackageLicense: Removes PackageLicenseUrl and Adds PackageLicenseFile since PackageLicenseUrl is deprecated (#3847)

* proposal to add PackageLicenseFile since PackageLicenseUrl is deprecated. https://github.com/NuGet/Home/issues/4628

* adding attribute Visible=false

* making ChangeFeedMode.LatestVersion accessible to the public (#3854)

* AI Integration: Fixes Operation Name in the activity and end to end Tests. (#3845)

* first draft

* second draft

* 3rd draft

* remove untouched file

* test fix

* fix order

* change order

* refactor

* skip network activities in test

* remove network attributes

* SDK 3.34.0 : Adds version bump and changelog (#3855)

* SDK 3.34.0: Adds version bump and changelog

* adding changelog changes

* added a missing PREVIEW PR

* Update changelog.md

Co-authored-by: Justine Cocchi <jucocchi@microsoft.com>

* Update changelog.md

Co-authored-by: Kiran Kumar Kolli <kirankk@microsoft.com>

* removed 3840 as it was not committed

* change text for 3832

* fix merge issue

* add 3724

* Update changelog.md

Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>

* Update changelog.md

Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>

* including 3845

---------

Co-authored-by: Justine Cocchi <jucocchi@microsoft.com>
Co-authored-by: Kiran Kumar Kolli <kirankk@microsoft.com>
Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>

* Release: Fixes changelog.md change for 3845 to preview (#3859)

* removing ThirdPartyNotice.txt from content and contentfiles folders (#3864)

* Documentation: Adds see also link to Container.CreateTransactionalBatch (#3860)

* Linking limit documentation to Container.CreateTransactionalBatch(PartitionKey) method

* Resolved PR comments

* Links update

* Using learn.microsoft instead of docs.microsoft in the links

---------

Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>

* Query: Adds type-markers with count and length for large arrays (#3852)

* initial commit

* cleanup

* update test output

* cleanup

* typo

* Pr comments

* [Internal] AI Integration or Open Telemetry: Design Document (#3858)

* first draft

* redesign

* ädd link

* updated observability url

* Benchmarking: Adds use of ARM Templates for benchmarking (#3838)

* initial commit DONT REVIEW

* fixes and documentation

* Apply suggestions from code review

Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>

* requested changes

* Apply suggestions from code review

Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>

* name changes

* readme changes

* nits + changing case of parameters file

---------

Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>

* Update README.md (#3875)

URL typo.

* moved to new file (#3876)

* Direct Package Upgrade 3.31.0: Refactors code to make compatible with latest direct (#3877)

* upgrade to 3.31.0

* add more regions

* enable dt for operations

* updated contract file

* [Preview] Integrated cache: Adds BypassIntegratedCache to DedicatedGatewayRequestOptions (#3836)

* Integrated cache: Add BypassIntegratedCache to DedicatedGatewayRequestOptions

Currently, integrated cache is used by default for Dedicated Gateway.
Customers cannot skip cache for particular requests or data unless they
shift to multi-tenant Gateway,which will lose the benefits of Dedicated
Gateway.

For customers to have more control over integrated cache, we're
introducing a new "RequestOption" called "BypassIntegratedCache". This
option will allow the customer to decide whether to use integrated cache
for each request or not. If this value is set to true, the item/query
will be served from backend and won't be cached in Dedicated Gateway.

* Move this feature to public preview

* Address comments

1. Add more tests
2. Add more detail and example code for BypassIntegratedCache

* Revert changes in EncryptionCustomAPI

---------

Co-authored-by: Jiajun Peng <jiajunpeng@microsoft.com>
Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>

* Client Encryption: Adds Microsoft.Azure.Cosmos compatibility to version 3.34.0 (#3874)

* chaging Microsoft.Azure.Cosmos support version

* resolved merge conflicts

* CosmosClient: Fixes missing Trace when converting HTTP Timeout to 503 (#3866)

* Added tracing when converting HTTP Timeout to 503

* Fixed tracing when converting HTTP Timeout to 503

* Resolved PR comments

* Using ITrace as part of ClientSideRequestStatisticsTraceDatum

* Refactoring

* Test update

* Unit tests fix

* AI Integration: Fixes Open Telemetry Example (#3868)

* first draft

* add filter

* revert csproj

* fix sample

* changed log message

* remove unused library

* [Internal] Query: Adds OptimisticDirectExecute and RequiresDistribution headers (#3882)

* Adding ODE and RequiresDistribution Headers

* Fixed comments

* Updated parameter in SwitchToFallbackPipelineAsync

* Renamed TryUnwrapContinuationToken to UnwrapContinuationToken

---------

Co-authored-by: neildsh <35383880+neildsh@users.noreply.github.com>

* Query: Refactors the EnableOptimisticDirectExecution flag to be public (#3883)

* Made EnableOptimisticDirectExecution a public flag

* Updated contract

* [Internal] OpenTelemetry : Adds Telemetry Distributed Tracing functionality (#3801)

* Direct Package update and replacing dagnostic files

* Resolve merge conflicts

* Running updateCOnstracts script

* Add code changes for distributed tracing open telemetry changes

* Add distributed tracing tests

* Updated tests for distributed tracing

* Addin traceID for diagnostics

* Running update contract script

* Removed LinqTranslationWithCustomSerializerBaseline file

* Adding isDistributedTracingEnabled flag

* Running update contracts

* Running update contracts

* Updates based on differnt code review comments

* Running update contracts

* Running update contracts

* Running update contracts

* fix test

* Code cleanup for test fix

* Running Update contracts

* resolving merge conflicts

* resolving merge conflicts

* Set EnableDistributedTracing to true for performance tests

* Benchmark project change for distributed tracing

* Updating tests

* Updated unit tests

* Updated unit tests

* Updated tests and constructors based on review comments

* Updated scope name in recorder

* Updated distributedOtel tests to cover more scenarios

* Updated distributedOtel tests

* Reverting benchmark performance test changes

* Update DistributedOpentelemetry tests

* Update test cleanup

* Update distributed tests with custom builder

* Update distributed open telemetry tests

* Update contracts

* Cleanup files

* Update distributed Otel tests

* Update distributed Otel tests

* code refactoring

* fix custom listener

* Update direct package to 3.31.1

* Code clean up

* Update tests with display name

---------

Co-authored-by: Sourabh Jain <sourabhjain@microsoft.com>

* Documentation: Adds additional remarks to CosmosClient (#3891)

* CosmosClient documentation improvements

* Cref fix

* Link fix

* Documentation fix

* Typo fix

---------

Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>

* Open Telemetry End To End Test: Adds baseline for network level requests trace (#3887)

* enable request level in end to end

* made some changes

* fix tests

* fix display name

* hardcoded containername and databasenam

* fix tests

* temp

* fix tests

* update contracts

* fix tests

* fixed display name

* [Internal] Design Docs: Adds Design Document for Client Telemetry (#3590)

* sdk design for client telemetry

* Otel design

* update optel design

* added more nformation

* updated ct design

* remove otel design

* Client Telemetry Design

* update typos

* fix typos

* fix typos

* added limitation

* updated docs

* updated doc

* updated text

* Update docs/observability.md

Co-authored-by: Kiran Kumar Kolli <kirankk@microsoft.com>

* Update docs/observability.md

Co-authored-by: Kiran Kumar Kolli <kirankk@microsoft.com>

* Update docs/observability.md

Co-authored-by: Kiran Kumar Kolli <kirankk@microsoft.com>

* Update docs/observability.md

Co-authored-by: Kiran Kumar Kolli <kirankk@microsoft.com>

* Update docs/observability.md

Co-authored-by: Kiran Kumar Kolli <kirankk@microsoft.com>

* move stuff here and there.

---------

Co-authored-by: Kiran Kumar Kolli <kirankk@microsoft.com>

* [Internal] Design Docs: Adds Design Document for Client Telemetry Part 2 (#3903)

* updated doc

* Update docs/observability.md

Co-authored-by: Justine Cocchi <jucocchi@microsoft.com>

* updated text

---------

Co-authored-by: Justine Cocchi <jucocchi@microsoft.com>

* ConnectionPolicy: Refactors Code to Reduce Default Request Timeout to 6 Seconds. (#3902)

* Code changes to reduce default request timeout to 6 seconds.

* Code changes to update API doc default request timeout to 6 seconds.

* [Internal] Upgrade Resiliency: Adds Replica Health State Diagnostics. (#3835)

* Code changes to add replica health status in diagnostics.

* Code changes to fix performance test build failure.

* Code changes to add health state capture logic in address cache.

* Code changes to fix benchmark test execution.

* Code changes to add tests to validate health state cache.

* Code changes to reduce default request timeout to 5 seconds.

* Revert "Code changes to reduce default request timeout to 5 seconds."

This reverts commit 139f37e588fc9dfed608431f4186c567a080e622.

* Subpartitioning: Fixes handling of split physical partitions (#3879)

* Initial Commit DO NOT REVIEW

* bug fix, needs Direct Package Changes

* fix for change feed and query plus tests

* clean up

* query + clean up

---------

Co-authored-by: Kiran Kumar Kolli <kirankk@microsoft.com>

* [Query] Fixes empty property name parsing exception (#3907)

* inital commit

* cleanup

* test cleanup

* PR comments

* PR comment

* [Preview] Query: Refactors EnableOptimisticDirectExecution to true by default in Preview mode (#3909)

* Setting EnableODE to true by default in Preview Mode.

* Added seperate if block for default value

* Updated property

* Removed unused Usings

* Updated contracts

* Updated test

* Updated directive indentation

* Documentations: Adds links to PatchItems docs (#3910)

* Added links to PatchItems docs

* Undo changes from internal file

* [Internal] Direct Package Upgrade: Refactors Code to Bump Up `Cosmos.Direct` Package to `3.31.2` (#3918)

* Code changes to bump up the direct version.

* Code changes to mark the Israel Central region as public.

* Code changes to update contracts.

* Code changes to fix test failure. Some clean ups.

* Code changes to add detailed message for open channels count.

* SDK 3.35.0 : Adds version bump and changelog (#3920)

* release PR

* updated changelog.md

* more changelog updates

* [Internal] Last minute fix to changelog for 3.35.0 (#3921)

* release PR

* updated changelog.md

* more changelog updates

* changelog fix

* Update changelog.md

* Update changelog.md

* [Internal] Query: Adds new header SupportedSerializationFormats (#3911)

* Binary Serilaization Response test

* Added new header SupportedSerializationFormats

* Modified existing use of CosmosSerializationFormatOptions

* Modified tests and removed unused code

* Addressed comments

* Added more negative cases

* Revert changes

* Added spaces

* Addressed comments

* Addressed comments

* Removed SupportedSerializationFormats from Headers file

* Removed unused JsonSerilazationFormats option

* Addressed comments

* Addressed comments

* Addressed comments

* Addressed comments

* Added new enum TransportSerializationFormat

* Added new enum TransportSerializationFormat

* Addressed comments

* Removed unused parameter

* Addressed comments

* updating API

* remove tests

* Text fixes

* fix typo

* remove TransportSerializationFormat header

* text reverts

* revert

* test update

* PR comments

* remove test owner headers HeadersValidationTests.cs

* PR comments - remove unsupported tests and scope client

---------

Co-authored-by: Heet <detrojaheet@gmail.com>
Co-authored-by: neildsh <35383880+neildsh@users.noreply.github.com>
Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>

* Code changes to optimize the rntbd open connection logic to open connections in parallel. (#3939)

* Query : Adds support for newtonsoft member access via ExtensionData (#3834)

* Support newtonsoft member access via ExtensionData

* Return null instead of empty string

* Added tests for select & where

* Updated baseline with note

---------

Co-authored-by: leminh98 <leminh.ams@gmail.com>

* HttpTransport: Fixes HttpTimeoutPolicies to not accidentally suppress retries (#3944)

* Fix HttpTimeoutPolicies to not accidentally suppress retries

* Removing HttpTimeoutPolicy.MaxRetryTimeLimit altogether

* SDK 3.35.1 : Adds version bump and changelog (#3945)

* version bump

* changelog

* contract

* [Internal] Changelog: Fixes recommended version and title (#3948)

* SDK 3.35.1: Adds version bump and changelog

* Update changelog.md

* Update changelog.md

* Update changelog.md

* Update changelog.md

* Update changelog.md

* [Internal] Dependencies: Fixes dependabot alert for System.Linq.Dynamic.Core (#3957)

* Removing 1

* Removing 2

* Removing 3

* [Internal] Upgrade Resiliency: Adds Code to Enable Replica Validation Feature for Preview (#3951)

* Code changes to add replica validation feature in cosmos client options.

* Code changes to upgrade the cosmos direct version to 3.31.3.

* Adding emulator test to cover replica validation.

* Code changes to address cosmetic clean ups.

* Code changes to address review comments. Fixed preview build failures.

* Code changes to enable replica validation for preview package by default.

* Code changes to address review comments.

* Code changes to fix preview unit tests.

* Code changes to disable environment variable at the end of the test.

* Client Encryption: Adds package reference Microsoft.Azure.Cosmos version 3.35.1-preview (#3956)

* changing cosmos preview version

* updating build file

---------

Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>

* [Internal] FabricBot: Adds GitOps.ResourceManagement because of FabricBot decommissioning (#3966)

* Add prIssueManagement.yml to onboard repo to GitOps.ResourceManagement as FabricBot replacement

Owners of the FabricBot configuration should have received email notification. The same information contained in the email is published internally at: https://aka.ms/gim/fabricbot. Details on the replacement service and the syntax of the new yaml configuration file is available publicly at: https://microsoft.github.io/GitOps/policies/resource-management.html

Please review and merge this PR to complete the process of onboarding to the new service.

* Deleting fabricbot.json

---------

Co-authored-by: microsoft-github-policy-service[bot] <77245923+microsoft-github-policy-service[bot]@users.noreply.github.com>

* [Internal] Query: Refactors certain tests to not fail when EnableOptimisticDirectExecution is set to true in 3.35.0-preview package (#3955)

* Updated emulator and baseline tests to not fail when ODE is set to default true in PREVIEW mode

* Fixed QueryAsync() test

* Fixed QueryAsync() in EndToEndTraceBaselineTests

* Undid changes to IndexMetrics baseline file

* Updated EndToEndTraceWriterBaselineTests.QueryAsync xml

* Updated xml

* Updated xml to have request options tag

* Diagnostics: Fixes verbose levels for "Operation will NOT be retried" (#3969)

* Query: Fixes malformed continuation token exception type and message (#3917)

* Fixed malformed continuation token issue where Exception was not CosmosExceptionan and did not have the correct Status and Sub Status codes.

* Fixed incorrect indentation

* Added type check for incoming exception

* Replaced if/else with extra catch block

* Moved fix to a higher point in the call stack

* Removed unused Usings

* Updated test code

---------

Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>

* [Internal] Upgrade Resiliency: Refactors Code to Enable Replica Validation Feature Through `CosmosClientOptions` And Environment Variable (#3974)

* Code changes to use client options to enable or disable replica validation.

* Code changes to fix preview build failures.

* Query : Adds string comparison alternative when converting LINQ to SQL (#3668)

* string.Compare supported with LINQ to SQL

* Update tests

* Update test name

* Update tests

* Add test

* Create helper ReverseExpressionTypeForStrings

* PR feedback

* Update tests

* Update base line

---------

Co-authored-by: Aditya <adityasa@users.noreply.github.com>
Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>

* AI Integration: Fixes event generation for failed requests (#3973)

* first draft

* fix code

* included feedback

* flip condition

* updated docs

* Update docs/observability.md

Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>

* Update observability.md

* updated contract

---------

Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>

* [Internal] Category: Refactors Cosmos benchmark operations (#3961)

* Refactoring: base classes for operations.

* Updating comments.

* Adding new line at the end of the file.

* Fixing code review points.

* Restore PrepareAsync to be virtual.

* 3.35.2: Adds new SDK versions and contract files (#3985)

* Updated change log and bumped up the version.

* Changing the version to 3.35.2

* Code changes to address review comments.

* Code changes to make minor fixes.

* Code changes to move some fixes into preview.

* [INTERNAL] LocalQuorum: Adds documentation for LocalQuorum (#3993)

* Draft of local-quorum documentation

* Adding experimental to header

* Adding cross-region read guarantees

* Reads Bounded clarification

* Adding account consistency step also

* Non-Prod usage note at top

* Addressing review comments

* Some more refinement

* Code changes to update release note. (#3996)

* Client Encryption: Adds fix for supporting Prefix Partition Key (Hierarchical partitioning) (#3979)

* Hirarchical pk bug fix

* Hirarchical pk bug fix

* Hirarchical pk bug fix

* Hirarchical pk bug fix

* Hirarchical pk bug fix

* testing new version

* adding more tests

* adding more tests

* adding more tests

* code review changes

* test fix

* test fix

* test fix

* test fix

---------

Co-authored-by: Nalu Tripician <27316859+NaluTripician@users.noreply.github.com>

* Query: Refactors changelog.md with Optimistic Direct Execution recommendation (#4004)

* Update changelog.md

This is a recommendation for customers if they would like to use the ODE features.

* Updated release notes for ODE

* [Internal] Query: Adds performance testing for OptimisticDirectExecution pipeline (#3839)

* Infrastructure for performance testing with ODE pipeline.

* Resolve comments

* Removed randomization from data creation process

* Fixed comments

* Removed Query and EnableODE from QueryStatisticsMetrics, as they do not relate to query statistics.

* Removed try catch to make CreateItemAsync call always succeed

* Removed one liner functions

* Removed code from MetricsSerializer and QueryStatisticsDatumVisitor files

* Fixed comments

* Removed request Charge check

* Bug in Debug Assert

* Test

* Bug in debug assert fix

* Fixed second bug in Metrics Accumalator class

* Added ignore flag to ode perf tests so that they do not run on every loop build

* Added comment explaining the Ignore flag.

* Query: Adds ODE continuation token support for non-ODE pipelines (#4009)

* Added code to throw exception if ODE continuation token goes into non ODE pipeline

* Removed count variable

* Updated test name

* Removed ODE continuation token logic from caller class

* Simplified code

* Fixed comments

* Updated continuation token cast

* Removed const string for continuation token

* Added Ignore flag for test

* Added baseline test

* Updated baseline test

* Code changes to fix concurrency issues.

* Code changes to disable replica validation in preview package. (#4019)

* 3.35.3: Adds new SDK versions and contract files (#4024)

* Updated change log and bumped up the patch version.

* Code changes to update the change log message.

* [Internal] Distributed tracing: Adds a sample to collect activities and events using custom listener (#4021)

* custom listener example

* removed unwanted code

* add comments

* fix appsettings

* revert changes

* Code changes to fix race condition by calling dispose too early. (#4030)

* Code changes to update change log for release 3.35.3 (#4032)

* Documentation: Fixes article links (replaced links V2 to V3 SDK version) + Azure Cosmos DB typo (#4031)

* Documentation link fix

* Fixed Typo "Azure CosmosDB"→"Azure Cosmos DB"

* [Internal] Benchmark tool: Adds Cosmos Benchmark Metrics (#3950)

* Adding metrics for Benchmark tool.

* Adding OpenTelemetry.

* Revert "Adding OpenTelemetry."

This reverts commit c7da0884697064103145099e284892365f4ebb68.

* Telemetry for windowed percentiles.

* OpenTelemetry, AppInsights and Dashboard.

* Removing DiagnosticDataListener.

* Code styling, comments and clean-up.

* Fixing issues with dashboard.

* Fixing positions of charts on the dashboard.

* Fixing the dashboard.

* Updating titles and subtitles.

* Removing ILogger and other not required references.

* Fixing code review points.

* Fixing issues after rebase.

* Removing unnecessary changes.

* Fixing code review points.

* Adding metrics for Benchmark tool.

* Adding OpenTelemetry.

* Revert "Adding OpenTelemetry."

This reverts commit c7da0884697064103145099e284892365f4ebb68.

* Telemetry for windowed percentiles.

* OpenTelemetry, AppInsights and Dashboard.

* Removing DiagnosticDataListener.

* Code styling, comments and clean-up.

* Fixing issues with dashboard.

* Fixing positions of charts on the dashboard.

* Fixing the dashboard.

* Updating titles and subtitles.

* Removing ILogger and other not required references.

* Fixing code review points.

* Fixing issues after rebase.

* Removing unnecessary changes.

* Fixing code review points.

* Fixing code review points.

* make MetrcisCollectorProvider non static and remove locks

* fix

* fixes

* use static class name TelemetrySpan.IncludePercentile

* use app insights connection string

* modified:   Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/Program.cs

* modified:   Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/Program.cs

* rename AppInsightsConnectionString

* fix

* fix comments

* fix if AppInsights c string is not set

* summary

* fix

* remove unnecessary collector types

* remove unnecesary metere provicer

* add event source

* remove folder

* fix

* split success and failed latencies

* fix

* fix

---------

Co-authored-by: David Chaava <chaava01@gmail.com>
Co-authored-by: David Chaava <v-dchaava@microsoft.com>

* GatewayAddressCache: Fixes Unobserved Exception During Background Address Refresh (#4039)

* Code changes to fix unobserved exception during background address refresh.

* Code changes to add exception handler in task.

* Code changes to fix null ref exception.

* Revert "Code changes to fix null ref exception."

This reverts commit 83f90d578bd301339f6fa13981a0fe2fc3d65fa6.

* Revert "Code changes to add exception handler i…
microsoft-github-policy-service bot added a commit that referenced this pull request Dec 1, 2023
…v3 master and `Cosmos.Direct` Release version `3.32.0` (#4200)

* [Internal] Client Telemetry: Fixes tests leaking environment variables (#3517)

* Adding log lines

* More logs

* Debugging further

* Removing other builds

* And more debugging

* Wrong build parameters

* Wrong category

* Removing noise

* Fixing test

* Adding utils

* Adding test with client telemetry enabled

* Fixing leak in Client Telemetry Tests

* Reenabling test

* cpu monitor initialization

* Adding name details

* Undo another file

* Updated change log and bumped up the version. (#3526)

* Query: Fixes performance regression on target partition on some ORDER BY queries with continuation (#3525)

* Revert performance regression caused by https://github.com/Azure/azure-cosmos-dotnet-v3/pull/1289/

* Remove irrelevant comment

* Add a test for validating formatted filters for the target partition

* [Internal] AI Integration: Adds SubStatusCode Information in attributes (#3533)

* wip

* regenerated baseline

* add test

* fix test

Co-authored-by: Sourabh Jain <sourabhjain@microsoft.com>

* Diagnostics: Removes unused properties and reduces size (#3519)

* Remove starttime and id from diagnostics string

* Remove starttime and id from diagnostics string

* Update xml files for trace baseline tests

* Update xml files for trace baseline tests

* Update xml files for trace baseline tests

* Whitespaces update

* Changed starttime position based on code review

Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>

* [Internal] docs: Add address caches conceptual flow (#3534)

* Rough draft

* Some more changes

* Adding a new section

* Some more refinement

* Some changes 

Lets get the feedback

* Some MISC changes

* Release: Adds SDK version and changelog for 3.31.2 (#3546)

* Bumped SDK version and changelog

* Added contracts file for 3.31.2

* [Internal] Documentation: Removes invalid comment from ReadThroughputAsync (#3516)

* [Internal] nugetconfig: Removes specific overrides (#3551)

* Query: Fixes partition range evaluation for spatial queries (#3495)

* Initial commit

* Update.

* Pull/Rebase

* Addressed comments.

* Build fix

* [Internal] Documentation: Refactors cache content on its own document (#3554)

* Add cache file

* Moving content away

* [Internal] Emulator unit tests: Adds IdEncoding unit tests for ComputeGateway (#3556)

* Adding IdEncoding unit tests for ComputeGateway

* Reacting to code review feedback

* Updating md files

* Change Feed Processor: Adds support for Resource Tokens (#3566)

* Adding rid parsing

* Test

* Removing dead code

* Contract update

* [Internal] AI integration: Refactor code how container and database name is flowing to opentelemetry module (#3532)

* wip

* WIP

* Revert "WIP"

This reverts commit 71275de54b9e67fa54a37e79d450b9597e173934.

* Revert "wip"

This reverts commit 586fa9865cc3f40dabd7ef90fb3e0cf499a045bc.

* wip add containe and database info

* redesign how container and database name information flows into opne telemetry data

* test fix

* fix test

* fix tests

* fix typos

* baseline test fix

Co-authored-by: Sourabh Jain <sourabhjain@microsoft.com>

* [Internal] AI Integration: Adds a new flag in DistributedTracingOptions (#3562)

* add flag in diagnostic options

* test fixes

* rename variable

* test fix

* add validation

* fix baseline

* test fix

Co-authored-by: Sourabh Jain <sourabhjain@microsoft.com>

* Query: Fixes default to BadRequestException in case of internal errors in ServiceInterop (#3399)

* Don't default to BadRequestException in case of errors in ServiceInterop

* Incorporate code review feedback

* Fix build error

* fix up failing test

* [Internal] Query: Adds unit tests for Merge/Split implementation with OptimisticDirectExecution pipeline (#3510)

* Added tests to test different aspects of merge/split support with OptimisticDirectExecution pipeline. Tests check for gone exception handling, pipeline switching etc.

* Added gone exception simulation tests.

* Added new tests and improved test infra

* Removed ParalleContEvocation test. Fixed comments

* Removed CreateParallelCrossPartitionPipelineStateAsync() as it is not being used anymore

* Removed while loop in CreateDocumentContainerAsync()

* Fixed comments.

* Updated ExecuteGoneExceptionOnODEPipeline()

* Added type Assert for ExecuteGoneExceptionOnODEPipeline()

* Updated OptimisticDirectExecution pipeline abbreviation

* Updated TestBaseline folder with new xml

* Client Retry Policy: Adds HTTP timeouts with request-level cross-region retry (#3555)

* Fixes to ReadThroughputAsync for databases with no provisioned throughput and null as request options

* fixed failure to ReadReplaceThroughputResponseTests

* Added Stream Method

* Ran UpdateContract.ps1

* Encryption implemtation

* Fixed spelling error

* Update Microsoft.Azure.Cosmos.Encryption/src/EncryptionDatabase.cs

Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>

* Variable name change

* Update Microsoft.Azure.Cosmos/src/Resource/Database/Database.cs

Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>

* Suggested Changes and fixes

* Removed manufactured ResponseMessage + nits

* Simplified PR

* nits

* nits

* initial changes TODO: Update tests

* updated tests

* nits'

* Ran UpdateContracts.ps1

* nits + requested changes

* Delete NuGet.Config

* Update Microsoft.Azure.Cosmos/src/HttpClient/CosmosHttpClientCore.cs

Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>

* Update Microsoft.Azure.Cosmos/src/HttpClient/HttpTimeoutPolicy.cs

Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>

* Update Microsoft.Azure.Cosmos/src/HttpClient/HttpTimeoutPolicy.cs

Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>

* Update Microsoft.Azure.Cosmos/src/HttpClient/HttpTimeoutPolicy.cs

Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>

* Use Cosmos Exception Factory, Simplified Tests

* removed unused code

* nits: removed unused code

* removed unused code

Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>
Co-authored-by: Nalu Tripician <ntripician@microsoft.com>

* Documentation: Fixes EUAP in Comments (#3579)

* Query: Fixes incorrect FeedResponse.Count when result contains undefined elements (#3574)

* Do not maintain an independent count on QueryResponse that can go out of sync

* Add more test coverage for QueryResponse<T>.Count

* Output the correct count from CosmosElementSerializer when the input contains CosmosUndefined

* Add untyped tests for CosmosUndefined

* Remove commented code

* removed allr eference (#3581)

Co-authored-by: Sourabh Jain <sourabhjain@microsoft.com>

* Trace: Fixes Tracing/diagnostics hour-times to 24Hours (#3577)

* Trace: Fixes Tracing/diagnostics hour-times to 24Hours

* fixing baseline tests

Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>

* AI Integration: Adds cosmetic fixes (#3576)

* wip

* status code int and internal and client kind activity

* remove unused imports

* update baselines

* fix test

* fixed baseline tests

* fix tests

* update base tetss

Co-authored-by: Sourabh Jain <sourabhjain@microsoft.com>

* Query: Adds ALL Scalar Expression (#3509)

* Add SqlAllScalarExpression to v3 DOM

* updated generated parser files

* Parsing for ALL

* Added tests for ALL and baselines

* Added more tests

* added new test, cleanup

* cleaning & fix typos

* fixed typo

* Added new baseline test file names to csproj file

* renamed AggregateAll to AggregateSubquery to accomodate FIRST and LAST later

* Added keywords for 'left' and 'right' and respective function calls

* fixed bug from last commit

* cleaning

* replace tabs with spaces

* cleaning

* Release: Adds API contracts for 3.31.2-preview (#3586)

* [Internal] sccignore: Adds a .sccignore file to apply an exception for artifacts configuration issues (#3589)

* [Internal] PermissionTests: Adds CosmosPermissionTests Coverage (#3593)

* Ensures that both Direct and Gateway connection modes are tested
* Validates that container read works with PermissionMode.Read (test was previously only validating that Delete was blocked - i.e. the negative case).

* [Internal] AI Integration: Refactors to Operation prefix and add tests (#3583)

* add tests for otel and custome listener

* clean up

* null pointer fix

* fix tets

* handle event generation also at operation level

* added documentation

* wip

* change event sourcename

* rename event Name

Co-authored-by: Sourabh Jain <sourabhjain@microsoft.com>

* [Internal] HttpTimeoutPolicy: Removes Data Plane Writes from being able to be retried (#3607)

* data plane writes no longer failover on timeout

* removed duplication of test\

* [Internal] Performance Testing: Adds Distributed Tracing option in benchmarks (#3611)

Co-authored-by: Sourabh Jain <sourabhjain@microsoft.com>

* [Internal] Benchmark: Refactors code to make Memory Stream capacity configurable (#3624)

Co-authored-by: Sourabh Jain <sourabhjain@microsoft.com>

* add new LatestVersion changefeed mode that has same behavior as Incremental; renamed FullFidelity to AllVersionsAndDeletes (#3596)

* Query: Fixes handling of CosmosUndefined, CosmosGuid and CosmosBinary in unordered DISTINCT (#3632)

* Handle CosmosUndefined, CosmosGuid and CosmosBinary in DistinctMap.UnorderedDistinctMap

* Address code review feedback and remove unnecessary allocations from DistinctQueryPipelineStageTests

* [Internal] Subpartitioning: Adds updates to test coverage for subpartitioning (#3618)

* updates to test coverage for subpartitioning

* bug fixes

* now useses Assert.ThrowsException

* Seperated into multiple tests for clarity

* Put MultiHash test into seperate test file

* nit

* [Internal] ContainerProperties: Fixes version reset when setting PartitionKeyPath (#3637)

* Remember previous value

* test

* [Internal] AI Integration: Adds CorrelationId and Activity Id Attributes for query operation (#3630)

* add activityid in Otel attributes

* added correlation id

* operation type fix

* remove test changes

* test fix

* fix baseline test

* rename correlationId

* fix tests again

* include only not null attributes in test

* fixed tests

* changefeedxml

* test fix

* ordering activity in operationname oerder

* fix test

* review comments

* refator header getter setter

* clean up

Co-authored-by: Sourabh Jain <sourabhjain@microsoft.com>

* Documentation: Fixes CosmosClientBuilder.WithConnectionModeGateway parameter description (#3643)

* Fixed CosmosClientBuilder.WithConnectionModeGateway documentation

* Update Microsoft.Azure.Cosmos/src/Fluent/CosmosClientBuilder.cs

Co-authored-by: Ruben Bartelink <ruben@bartelink.com>

Co-authored-by: Augsten <aaugsten@harbourvest.com>
Co-authored-by: Ruben Bartelink <ruben@bartelink.com>

* Upgrade Resiliency: Refactors Implementation for Opening Rntbd Connections to Backend Replicas in Direct Mode. (#3640)

* Code changes to refactor implementations for opening connections to all replicas. Fixed test failures due to Direct package upgrade.

* Code changes to add poland central region as a part of Regions.cs

* Code changes to update contract to reflect new regions.

* Revert "Code changes to update contract to reflect new regions."

This reverts commit f171b3c1c9889043556ddf96bcd33ccd79565ad9.

* Revert "Code changes to add poland central region as a part of Regions.cs"

This reverts commit 1aafbf18f6d80e9a92baa301b6b23cf065e4b155.

* [Preview] AI integration: Adds IsDistributedTracingEnabled flag as public API to enable/disable this feature (#3598)

* make api public for preview

* add null check

* fix tests

* singleton listener initialization

* assign null to listeners

* fix test

* concurrent bag in listener

* renamed to LatencyThresholdForDiagnosticEvent

* renamed to IsDistributedTracingEnabled

* updated xml

* update contract

* made latency threshold flag internal

* fix test

* regeneratebaselines

* update documentation

* rename builder api

* add docs

* updated contracts and all

* doc update

* import cleanup

Co-authored-by: Sourabh Jain <sourabhjain@microsoft.com>

* Change Feed Processor: Fixes behavior with StartTime on Local (#3645)

* To UTC

* Test

* [Internal] Client Telemetry: Refactors code to use base useragent string (#3653)

* [Internal] AI Integration: Refactors code to rename event name (#3648)

* first draft

* rename event name

* updated xmls

* update files

* Region Availability: Adds Poland Central Region For Public Usage (#3656)

* Client Encryption: Adds validation code to check if the Key Vault URI provided in wrap metadata is a valid key identifier. (#3642)

* Check if the key vault uri provided is a valid Kid

* test fix.

* update changelog and build props

* Update Directory.Build.props

* Update Microsoft.Azure.Cosmos.Encryption.csproj

* Fixed preview version

* Refactor

* Update EncryptionDatabaseExtensions.cs

* [Internal] Query: Adds Split Support for Ode (#3572)

* Added tests to test different aspects of merge/split support with OptimisticDirectExecution pipeline. Tests check for gone exception handling, pipeline switching etc.

* Added gone exception simulation tests.

* Added new tests and improved test infra

* Removed ParalleContEvocation test. Fixed comments

* Removed CreateParallelCrossPartitionPipelineStateAsync() as it is not being used anymore

* Removed while loop in CreateDocumentContainerAsync()

* Fixed comments.

* Updated ExecuteGoneExceptionOnODEPipeline()

* Added type Assert for ExecuteGoneExceptionOnODEPipeline()

* Replaced try-catch with if statement in MoveNextAsync()

* Added delegate to access TryCreateCoreContextAsync()

* Added check to confirm Ode pipeline is not called in fallback plan

* Updated method name from OptimisticDirectExecutionContext() to TryCreateOptimisticDirectExecutionContext()

* Using delegate instead of Func<>.

* Ode fallback plan always calls Specialized pipeline

* Using ServiceInterop/Gateway to get QueryPlan for Specialized Pipeline

* Added new test to check handling of failing fallback pipeline

* Code cleanup

* Added logic for handling non ODE continuation tokens

* Moved delegate away from member variables

* Added tests for Merge case

* Updated method names

* Added checks for tryCatch

* Updated SetCancellationToken() to use Try

* Updated TryUnwrapContinuationToken()

* Removed changes in FlakyDocumentContainer.cs

* Removed unused imports

* Updated comments

* Fixed comments and cleaned up test code

* Added CosmosElement null check in TryUnwrapContinuationToken()

* Removed FlakyDocumentContainer.cs from pull request

* Removed unused imports

* Updated TryUnwrapContinuationToken()

* Update MoveNextAsync() call in OptimisticDirectExecutionQueryBaselineTests.cs

* Made MergeTestUtil.IsFailedFallbackPipelineTest a readonly property

* Added IsPartitionSplitException() overload to take CosmosElement

* Fixed bug regarding syntax error queries

* [Internal] AI Integration : Fixes operation type  for batch (#3660)

* fix op type

* fix conflict

* CosmosClientOptions: Adds ServerCertificateCustomValidationCallback for Http and TCP (#3636)

* Adding ServerCertificateCustomValidationCallback in clientoptions

* Adding Server callback for Http and fixing tests

* Fixing failing E2Etests

* Resolving merge conflicts

* Running update contracts script

* Running Update contracts script

* Running Update contracts script

* Reverting the v3 version change

* Update based on review comments

* Added unit tests

* Added remarks for callback delegate

* Ran update contracts script

* Update based on review comments

* Ran update contracts script

* Updated unit tests

* Making ssl validation function private

* Updating test files

* Update remarks for sslvalidation public contract

* Added emulator tests for server validation

Co-authored-by: Debdatta Kunda <87335885+kundadebdatta@users.noreply.github.com>

* Query: Adds EnableOptimisticDirectExecution flag to QueryRequestOptions (#3664)

* Added new flag to QueryRequestOptions to allow customers to use Ode pipeline

* Updated comments in QueryRequestOptions.cs

* Renamed enabledOde to enableOde

* Removed default setting for EnableOptimisticDirectExecution

* [Internal] Tests: Removes Direct/HTTPS emulator tests (#3679)

* Removing direct/https tests

* mppreference

* [Internal] Benchmark : Fixes issue with dependency on Cosmos Project (#3673)

* users/sourabhjain/benchmarkfix

* update pipeline

* Revert "users/sourabhjain/benchmarkfix"

This reverts commit 81b48f0e47aed7a75540c2c83f62cea98d86824f.

* fix compilation error

* add parama for preview pkg also

---------

Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>

* LocalQuorum: Adds Quorum reads on Consistent Prefix Accounts (#3680)

Co-authored-by: DESKTOP-ED57J7H\Prashanth Venkataram <vprashanth1987@hotmail.com>

* 3.32.0: Adds new SDK version and contract files (#3687)

* 3.32.0: Adds new SDK version and contract files

* 3.32.0: Adds new SDK version and contract files

* Updating changelog version

* Updating changelog version

* Added more commits to changelog and updated release contract

* Added documentation tags PR in changelog

* Updated changelog based on reviews

* Updated PR decsription in changelog

* Update changelog.md

Updated full fidelity change description

Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>

---------

Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>

* [Internal] Samples: Adds change feed pull model samples (#3646)

* add change feed pull samples

* refactor appsettings validation

* addressing pr comments

* move task delay

* update sample to use latest change feed mode names

---------

Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>

* [Internal] Tests: Refactors emulator CI (#3688)

* [Internal] GitHub Template: Adds needs-investigation label (#3708)

By default, all "Bug report" issues will have "needs-investigation"

* Adding fabric bot action (#3709)

* CosmosNullReferenceException: Refactors CosmosNullReferenceException to pass along InnerException property on parent NullReferenceException (#3713)

* Passed inner exception details to NullReferenceException ctor when instantiating CosmosNullReferenceException.

* Added unit tests.

* Addressed PR feedback.

* [Internal] PriorityRequests: Fixes header value (#3714)

Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>

* [Internal] Query: Adds single physical partition check for OptimisticDirectExecution queries (#3699)

* Added single physical partition check for Ode queries. Updated test infrastructure for Ode emulator tests too.

* Refactored emulator tests to have all the test cases at the top of the file

* Updated TryGetTargetRangeOptimisticDirectExecutionAsync()

* Uodated logic on how many times CreateIngestQueryDeleteAsync() gets called

* Added debug asserts for partitionKeyDefinition

* Added pageSizeOptions parameter in CreateInput() in EmulatorTests

* Fixed comments

* [Internal] CTL: Fixes Reservoir Sampling Logic (#3712)

* Code changes to fix the reservoir sampling logic in CTL

* Code changes to modify help text on reservoir type.

* Code changes to address minor code refactor.

* Diagnostics: Adds startDate in Summary (#3707)

* Adding start date

* Updated trace files

* PR comment

* Committing missing tests

---------

Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>

* [Internal] Client Telemetry: Adds network information in the payload (#3691)

* first draft

* clean code

* add test

* fix test

* add replica info collection

* fix substatuscode and  operation type error

* fix code

* collect http infor in cache also

* message to stacktrace

* remove rntbd recording from cache

* print proper exception message

* fix test

* cleanup unused code and added few status codes in ignore list

* fixed all exception logging

* refactor conditions

* fix tests

* Documentation: Fixes Database.ReadAsync description (#3457)

* Documentation: Modify retry time to timespan 

Modify retry time in seconds to timespan of parameter maxRetryWaitTimeOnThrottledRequests (Method: [WithThrottlingRetryOptions](https://docs.microsoft.com/en-us/dotnet/api/microsoft.azure.cosmos.fluent.cosmosclientbuilder.withthrottlingretryoptions?view=azure-dotnet#feedback))
Resolves https://github.com/Azure/azure-sdk-for-net/issues/29567

* Documentation: Fixes DeleteItemAsync Example

Documentation: Fixes DeleteItemAsync Example

* Documentation: Fixes ItemRequestOptions Example

Documentation: Fixes ItemRequestOptions Example

* Documentation:Update Database.ReadAsync description

Documentation: Update Database.ReadAsync description

* Documentation: Update Database.ReadAsync description

Documentation: Update Database.ReadAsync description

* Documentation: Updated ToStreamIterator example

Documentation: Updated ToStreamIterator example

* Modified StreamIterator section

* Update Microsoft.Azure.Cosmos/src/Resource/Database/Database.cs

Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>

* Remarks correction

* Revert the StreamIterator changes

Revert the StreamIterator changes

Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>
Co-authored-by: Kiran Kumar Kolli <kirankk@microsoft.com>

* Upgrade Resiliency: Adds Implementation for Validating the Unhealthy Backend Replicas in Direct mode (#3631)

* Code changes to implement replica validation in dotnet v3 sdk.

* Cosmetic changes to add inline code comments.

* Code chages to address review comments.

* Code changes to cover a scenario for async cache.

* Code changes to refactor async non-blocking cache code.

* Code changes to address minor review comments.

---------

Co-authored-by: Kiran Kumar Kolli <kirankk@microsoft.com>

* ReadMany: Fixes BadRequest when using Ids with single quotes (#3732)

* Use parameters

* Emulator tests

* Release: Adds SDK version and changelog for 3.32.1 (#3733)

* version bump

* Contracts

* [Internal] Build: Fixes static tool analysis versions (#3736)

* Update Binskim and follow warnings

* Fixing task

* More version bumps

* binskim args

* Padding

* policheck

* postanalysis parameters

* analysis settings

* Query: Fixes System.ArgumentException when using PartitionKey.None on x86, Linux or in Optimistic Direct Execution (#3730)

* Minor clean up of OptimisticDirectExecutionQueryTests

* More minor cleanup in OptimisticDirectExecutionQueryTests

* Add emulator tests for the bypass query parsing scenario

* Handle PartitionKey.None while creating QueryIterator. This is a workaround for the PartitionKeyInternal.None not following its own contract

* Fix up to correctly handle PartitionKey.None using the CachedContainerQueryProperties

* Add more tests where PartitionKey.None maps to PartitionKey.Undefined

---------

Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>

* Query: Adds FIRST and LAST Scalar Expressions (#3629)

* Add FIRST and LAST objects and update visitors

* add FIRST LAST evaluation and update offline engine visitors

* Add FIRST and LAST to parser

* update another visitor

* Fix typo

* fix typo

* added new tests and baselines

* cleaning

* cleaning

---------

Co-authored-by: neildsh <35383880+neildsh@users.noreply.github.com>
Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>

* Subpartitioning: Adds support for Prefix Partition Key searches for sub partitioned containers (#3109)

* 1st round of changes to support subpartitioning for ChangeFeed

* name change and moved a method to FeedRangePartitionKey

* support for prefix partition change feed and query including unit and emulator tests. need to verify using FeedRange with QueryIterator

* splitting out unit tests from emulator tests

* 1st round of changes to support subpartitioning for ChangeFeed

* name change and moved a method to FeedRangePartitionKey

* support for prefix partition change feed and query including unit and emulator tests. need to verify using FeedRange with QueryIterator

* splitting out unit tests from emulator tests

* moved logic to choose for prefix partition query and change feed

* additional conditional to check for MultiHash partitionkeydefinition kind

* removed unnecessary using

* cleanup

* unnecessary using

* removed PREVIEW from proj

* unit tests for ResolveFeedRangeBasedOnPrefixContainerAsync

* change access modifier

* since I changed to static, needed to fix tests

* dealing with some testing nits

* removed Console.Writeline

* slight change in test use containerProperties and partitionKeyDefinition

* big fix for resolve feedrange, changes to error behavior, added additional test coverage

* test changes

* ran updateContracts.ps1

* reverting to 3ad5309e9e22a7376e836cfdbe11fa2438a59133

* Ran Update Contracts

* ran updateContracts.ps1

* UpdateContracts.ps1

* updatecontracts

* removed bad check from test, removed changes from updatecontracts.ps1

* revert UpdateContracts changes

* Reverting to 756a123160d14c424c5e11c4f3520094115aa5d4

* removed accidental change from changelog

* removed unwanted change from Directory.build.props

* added test clean up

* removed console.writelines

* updates to query test

* removed preview flag

* ran UpdateContrats.ps1

* no longer recread feedRange for queries unless using prefix pk

* simplified if statement

* fixed bug

---------

Co-authored-by: Nalu Tripician <nalutrip@icloud.com>

* [Internal] ClientTelemetry: Adds logic to limit payload size to 2 MB (#3717)

* first draft

wip

fix test and logic

* resolve conflicts

* limit 2 mb

* ad callback

* fix tests

* code refactor

* cosmos json to newtosoft json

* clean up files

* fix logging to argumrnt based

* code refactor

* add null check

* Query: Fixes regression from LINQ custom serializer fix (#3749)

Co-authored-by: Minh Le <leminh@microsoft.com>
Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>

* [Internal] LocalQuorum: Refactors override (i.e. strong) to allow from any account consistency (#3753)

- Localquorum override (i.e. strong) to allow from any account consistency
- Facilitates no-downtime downgrade of existing accounts (i.e. existing Strong/bounded accounts migration to Eventual)

* Release: Adds SDK version and change log for 3.32.2 (#3752)

* version bump

* contract

* changelog

* version bump

* Fixing changelog text

* Add another PR

* Subpartitioning: Adds APIs for public release and increase REST API version (#3763)

* initial commit, Http version issues still needs to be resolved

* updateContracts + update Http Version

* updateded version in test

* update contracts

* requested changed

* changed name in comments to subpartitioning from multihash

* undid changes to TestLiteralSerialization.xml

* removed changes to non API.json files

* removed non XXXAPI.json file changes

* changed verbage on public comments

* changed error message to reflect verbage change

* Change Feed Processor: Fixes LeaseLostException leaks on notification APIs for Renew scenarios (#3775)

* Adding cases

* Tests

* Upgrade Resiliency: Refactors GatewayAddressCache to Mark TransportAddresses to Unhealthy when Connection Reset Event Occurs (#3768)

* Code changes to mark the transport uri to unhealthy for which a connection reset event occures through the connection state listener.

* Code changes to bump up the direct version.

* Code changes to clean up Gateway Address Cache.

* Code changes to fix pipeline build.

* Code changes to fix serilization test failures.

* Code changes to add force refresh to the gateway function callback delegate.

* [Preview] PriorityBasedExecution: Adds PriorityLevel as a RequestOption (#3672)

* Added Priority Level as a Request Option

* Changed Priority Level Low and High to 1 and 2 respectively

* Bumped DirectVersion

* Added made PriorityLevel internal for non preview packages

* Deleted PriorityLevelTests.cs

* Added description of Priority Level in RequestOptions.cs

* Modified comments for PriorityLevel in RequestOptions.cs

* Updated Contracts

* Modified Remarks for PriorityLevel and added see also link.

* Updated contracts

---------

Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>

* [Internal] Client Telemetry: Adds sampling logic for network level telemetry (#3750)

* sampling logic add

* throttlinfix

* fix tests

* fix tests

* remove dispose from sampler

* add 412

* draft push

* refactor code for sampling

* clean up

* start testing

* adding tests

* wip

* test fix

* fix test

* fix tests

* deleted extra file

* remove one toList

* add custome logic for sampling

* code refactor

* replace key

* remove commented code from test

* added more comments

* simpler sampler logic

* refactor code

* [Internal] Emulator Test : Fixes test when running with distributed tracing enabled. (#3751)

* enable DT for everything

* try1

* code refactoring

* fix pipeline

* try 2

* Revert "try 2"

This reverts commit 61643f9b4dcd2ab1898fd68b111897bed0bc6bcf.

* Revert "fix pipeline"

This reverts commit 4b217f5f6a087b1dd889b804fd8b477accd46419.

* Revert "code refactoring"

This reverts commit d1ff0ddc17ad655360988d171bd033617752f91f.

* Revert "try1"

This reverts commit bf9c41b43684f59719c3673d6f9c7450bbdc5142.

* lazy factory and threadsafe

* scope factory in function

* try non static

* add flag

* fix test

* add consoles

* more console with fix

* fix tests

* temporarily enable dt

* fuix tests

* dispose listener

* fix tests

* remove delay

* revert flag change

* dynamically get number of test in trace class

* Release: Adds SDK version and changelog for 3.32.3 (#3788)

* Adding contract and version bump

* Adding changelog

* SummaryDiagnostics: Refactors Code to Remove Dependency of HttpResponseHeadersWrapper to fetch Sub Status Codes (#3792)

* Code changes to fetch sub status code from http response/ content headers.

* Code changes to address review comments.

* Code changes to return the first element from the sub status list.

* Code changes to update first or default.

* [Internal] Documentation: Fixes API name to NoSQL (#3795)

* [Internal] CTL: Fixes docker image pipeline (#3794)

* [Internal] AI Integration : Refactors useragent attribute name as per Otel conventions (#3784)

Co-authored-by: Fabian Meiswinkel <fabian@meiswinkel.com>

* HttpClient: Adds Properties to the Http messages if available (#3803)

* Passing properties

* test

* Documentation: Refactors SQL API reference to NoSQL API (#3793)

Co-authored-by: Kiran Kumar Kolli <kirankk@microsoft.com>

* [Internal] Perf test: Refactors code to re-enable performance tests (#3785)

* enable perf tests

* updated json

* upgrade benchmark

* update results

* updated benchmark results

* HttpClient: Adds detection of DNS changes through use of SocketsHttpHandler for .NET 6 and above (#3762)

* initial commit

* removed unneeded usings

* added validation callback, still needs tests

* nits + fixes

* added additional test

* test change

* removed unneeded Dispose calls

* removed unnneed dispose calls

* requested changes

* added pooledConnectionLifetime as client option

* nit

Co-authored-by: Kevin Pilch <me@pilchie.com>

* Update Microsoft.Azure.Cosmos/src/HttpClient/CosmosHttpClientCore.cs

Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>

* Update Microsoft.Azure.Cosmos/src/CosmosClientOptions.cs

Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>

* suggested changes

* remove test, reorder usings

* updated contracts

* removed all non XXXAPI.json changes from UpdateContracts run

* removed public surface, added random timespan

* removed change from unrelated file

* Update Microsoft.Azure.Cosmos/src/HttpClient/CosmosHttpClientCore.cs

Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>

* added thread safe random method

* nit

* fixed merge mistake

* added reflection failsafe/error tracing

* nits

* added back removed if

* fixed formatting

* changed random method, fixed serverCertificateCustomValidation

---------

Co-authored-by: Kevin Pilch <me@pilchie.com>
Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>

* [Internal] Tests: Fixes Open Telemetry attributes for ReadMany test (#3805)

* Fixing test

* New baseline

* Undo some changes

* [Internal] Client Telemetry: Refactors code to run client telemetry data processing task in background. (#3783)

* first draft

* remove failure count test

* refactporing

* code refactor

* create task with timeout

* fix test

* code refactoring

* fix timeout code

* space fix

* not failing if processor is taking time

* fix procrsser test

* code refactor

* refactor and test fix

* Patch: Adds Move Operation (#3389)

* Basic changes to introduce move operator

* Added "from" object in patch spec operation.
Added testcase block.

* Fixed testcase.

* Changes made to address comments'

* Added comment regarding enum mutations

* Formatted comment

Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>

* Moved summary location.

* Ran UpdateContracts.ps1

---------

Co-authored-by: Amaan Haque <t-amaanhaque@microsoft.com>
Co-authored-by: Amaan Haque <amaanhaque@microsoft.com>
Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>

* [Internal] Pipelines: Adds nightly build to produce packages (#3802)

* Support cleaning

* wire previous content delete

* as text

* with variable

* another test

* param with types

* as string

* no delete

* no quotes

* undoing

* re-adding quotes

* testing empty

* trying another test

* readding version

* fixing publishing artifacts

* fixing parameter

* Fixing official pipeline

* version 5

* fixing main pipeline

* test with true

* using start time

* nightly preview

* passing parameters to pack

* Fixing nuget version

* arguments on the nuget pack

* folder structure

* testing v5

* Using only content

* Removing currentDate

* [Internal] OpenTelemetry: Direct Package update and replacing diagnostic files (#3797)

* Direct Package update and replacing dagnostic files

* Resolve merge conflicts

* Running updateCOnstracts script

* Removed LinqTranslationWithCustomSerializerBaseline file

* Adding isDistributedTracingEnabled flag

* Running update contracts

* Running update contracts

* Running update contracts

* fix test

* Code cleanup for test fix

* Code cleanup for test fix

* Making regex expression readable

* Adding comment for regex expression

---------

Co-authored-by: Sourabh Jain <sourabhjain@microsoft.com>

* [Internal] MerlinBot: Adds auto-merge and cleanup automation (#3813)

* Add config changes

* Polishing automerge config

* Update fabricbot.json (#3824)

* [Internal] Upgrade Resiliency: Adds Logic to Validate `Unknown` Replicas along with `Unhealthy`. (#3820)

* Code changes to add aggressive validation logic.

* Code changes to enable aggressive validation for all regions.

* Code changes to pull in msdata cosmos.direct changes related to aggresive validation logic.

* Code changes to make minor cosmetic changes.

* Code changes to address review comments.

* Serialization: Fixes call to CosmosSerializer.FromStream on Gateway mode when EnableContentResponseOnWrite is false (#3814)

* Do not call serializer if ResponseMessage.Content is empty.

* Add unit test

* Update unit tests

* Remove unused usings

---------

Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>

* [Internal] Documentation: Adds documentation covering build pipelines (#3822)

* Add doc

* Move benchmark

* Fixing texts

* Client Encryption: Adds release version of Microsoft.Azure.Cosmos to Microsoft.Azure.Cosmos.Encryption.Custom (#3799)

* cosmos version change

* changing preview to release

* resolving code review comments

---------

Co-authored-by: Santosh Kulkarni <66682828+kr-santosh@users.noreply.github.com>

* SDK 3.33.0 : Adds version bump and changelog (#3823)

* release 3.30.0

* added changelog

* updated changelog

* updated changelog

* suggested change to changelog

* updated changelog

---------

Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>

* [Internal] Documentation: Adds msdata/direct Sync-up Guide. (#3828)

* Code changes to add msdata/direct sync-up documentation.

* Code changes to address review comments.

* Code changes to address further review comments.

* Code changes to address minor review comments.

* Removed internal links.

* Query: Adds TRIM string system function support in LINQ (#3833)

* add trim support

* Added some test coverage

* address reviews

---------

Co-authored-by: Minh Le <leminh@microsoft.com>

* Query: Fixes Parsing Error in SQL DOM when CultureInfo is available (#3832)

* add fix

* Add cultural info to test to verify correct behavior

* address pr review to restore to restore culture

* fix comment

---------

Co-authored-by: Minh Le <leminh@microsoft.com>

* Client Encryption: Adds api FetchDataEncryptionKeyWithoutRawKeyAsync and FetchDataEncryptionKeyAsync to get DEK without and with raw key respectively.  (#3809)

* added raw key to MdeEncryption

* adding ray key to Mde Algo

* test case changes

* resolving code review comments

* code optimization to reduce keyvault calls

* removed Microsoft.Data.Encryption.Cryptography nuget package

* added api for dek with raw key

* resolved code review comments

* adding change log

* code review changes

* Initial commit (#3826)

* Query: Adds Computed Property SDK Support (#3761)

* Initial commit

* Restored settings.json changes.

* Update

* Addressed comments; still need to be tested using Emulator.

* Fixes after test run.

* Ignored the computed property tests based on the sync this morning (to allow for preview release).

* Suite0 fixes.

* Test update.

* Suite0 fixes

* [Internal] Samples: Adds OpenTelemetry and Application Insights samples (#3818)

* add opentelemetry and application insights samples

* address pr comments

* [Internal] Query: Added custom serializer coverage tests to ExpressionToSQL.cs (#3722)

* Ensure enum as string is preserved for custom serializer

* Failing test

* Added failing tests

* Updated requested names

* Ignore result of test for now

* Added additional comment on why the test is ignored

* Replaced with sample code

* Remove ignore attribute from tests, documented misbehavior for future use

* Updated comment

---------

Co-authored-by: leminh98 <leminh.ams@gmail.com>

* Query: Added remaining Cosmos Type checking functions to CosmosLinqExtensions (#3724)

* Added the remaining Cosmos Type checking functions to the CosmosLinqExtensions

* Added comments requested

* Updated comment

* Updated baseline

* Improve readability of dictionary initialization

* Aligned with code style guide

* Revert change to baseline

* Executed update baseline script

---------

Co-authored-by: neildsh <35383880+neildsh@users.noreply.github.com>
Co-authored-by: leminh98 <leminh.ams@gmail.com>

* update sdk version and section tags (#3841)

* PackageLicense: Removes PackageLicenseUrl and Adds PackageLicenseFile since PackageLicenseUrl is deprecated (#3847)

* proposal to add PackageLicenseFile since PackageLicenseUrl is deprecated. https://github.com/NuGet/Home/issues/4628

* adding attribute Visible=false

* making ChangeFeedMode.LatestVersion accessible to the public (#3854)

* AI Integration: Fixes Operation Name in the activity and end to end Tests. (#3845)

* first draft

* second draft

* 3rd draft

* remove untouched file

* test fix

* fix order

* change order

* refactor

* skip network activities in test

* remove network attributes

* SDK 3.34.0 : Adds version bump and changelog (#3855)

* SDK 3.34.0: Adds version bump and changelog

* adding changelog changes

* added a missing PREVIEW PR

* Update changelog.md

Co-authored-by: Justine Cocchi <jucocchi@microsoft.com>

* Update changelog.md

Co-authored-by: Kiran Kumar Kolli <kirankk@microsoft.com>

* removed 3840 as it was not committed

* change text for 3832

* fix merge issue

* add 3724

* Update changelog.md

Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>

* Update changelog.md

Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>

* including 3845

---------

Co-authored-by: Justine Cocchi <jucocchi@microsoft.com>
Co-authored-by: Kiran Kumar Kolli <kirankk@microsoft.com>
Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>

* Release: Fixes changelog.md change for 3845 to preview (#3859)

* removing ThirdPartyNotice.txt from content and contentfiles folders (#3864)

* Documentation: Adds see also link to Container.CreateTransactionalBatch (#3860)

* Linking limit documentation to Container.CreateTransactionalBatch(PartitionKey) method

* Resolved PR comments

* Links update

* Using learn.microsoft instead of docs.microsoft in the links

---------

Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>

* Query: Adds type-markers with count and length for large arrays (#3852)

* initial commit

* cleanup

* update test output

* cleanup

* typo

* Pr comments

* [Internal] AI Integration or Open Telemetry: Design Document (#3858)

* first draft

* redesign

* ädd link

* updated observability url

* Benchmarking: Adds use of ARM Templates for benchmarking (#3838)

* initial commit DONT REVIEW

* fixes and documentation

* Apply suggestions from code review

Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>

* requested changes

* Apply suggestions from code review

Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>

* name changes

* readme changes

* nits + changing case of parameters file

---------

Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>

* Update README.md (#3875)

URL typo.

* moved to new file (#3876)

* Direct Package Upgrade 3.31.0: Refactors code to make compatible with latest direct (#3877)

* upgrade to 3.31.0

* add more regions

* enable dt for operations

* updated contract file

* [Preview] Integrated cache: Adds BypassIntegratedCache to DedicatedGatewayRequestOptions (#3836)

* Integrated cache: Add BypassIntegratedCache to DedicatedGatewayRequestOptions

Currently, integrated cache is used by default for Dedicated Gateway.
Customers cannot skip cache for particular requests or data unless they
shift to multi-tenant Gateway,which will lose the benefits of Dedicated
Gateway.

For customers to have more control over integrated cache, we're
introducing a new "RequestOption" called "BypassIntegratedCache". This
option will allow the customer to decide whether to use integrated cache
for each request or not. If this value is set to true, the item/query
will be served from backend and won't be cached in Dedicated Gateway.

* Move this feature to public preview

* Address comments

1. Add more tests
2. Add more detail and example code for BypassIntegratedCache

* Revert changes in EncryptionCustomAPI

---------

Co-authored-by: Jiajun Peng <jiajunpeng@microsoft.com>
Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>

* Client Encryption: Adds Microsoft.Azure.Cosmos compatibility to version 3.34.0 (#3874)

* chaging Microsoft.Azure.Cosmos support version

* resolved merge conflicts

* CosmosClient: Fixes missing Trace when converting HTTP Timeout to 503 (#3866)

* Added tracing when converting HTTP Timeout to 503

* Fixed tracing when converting HTTP Timeout to 503

* Resolved PR comments

* Using ITrace as part of ClientSideRequestStatisticsTraceDatum

* Refactoring

* Test update

* Unit tests fix

* AI Integration: Fixes Open Telemetry Example (#3868)

* first draft

* add filter

* revert csproj

* fix sample

* changed log message

* remove unused library

* [Internal] Query: Adds OptimisticDirectExecute and RequiresDistribution headers (#3882)

* Adding ODE and RequiresDistribution Headers

* Fixed comments

* Updated parameter in SwitchToFallbackPipelineAsync

* Renamed TryUnwrapContinuationToken to UnwrapContinuationToken

---------

Co-authored-by: neildsh <35383880+neildsh@users.noreply.github.com>

* Query: Refactors the EnableOptimisticDirectExecution flag to be public (#3883)

* Made EnableOptimisticDirectExecution a public flag

* Updated contract

* [Internal] OpenTelemetry : Adds Telemetry Distributed Tracing functionality (#3801)

* Direct Package update and replacing dagnostic files

* Resolve merge conflicts

* Running updateCOnstracts script

* Add code changes for distributed tracing open telemetry changes

* Add distributed tracing tests

* Updated tests for distributed tracing

* Addin traceID for diagnostics

* Running update contract script

* Removed LinqTranslationWithCustomSerializerBaseline file

* Adding isDistributedTracingEnabled flag

* Running update contracts

* Running update contracts

* Updates based on differnt code review comments

* Running update contracts

* Running update contracts

* Running update contracts

* fix test

* Code cleanup for test fix

* Running Update contracts

* resolving merge conflicts

* resolving merge conflicts

* Set EnableDistributedTracing to true for performance tests

* Benchmark project change for distributed tracing

* Updating tests

* Updated unit tests

* Updated unit tests

* Updated tests and constructors based on review comments

* Updated scope name in recorder

* Updated distributedOtel tests to cover more scenarios

* Updated distributedOtel tests

* Reverting benchmark performance test changes

* Update DistributedOpentelemetry tests

* Update test cleanup

* Update distributed tests with custom builder

* Update distributed open telemetry tests

* Update contracts

* Cleanup files

* Update distributed Otel tests

* Update distributed Otel tests

* code refactoring

* fix custom listener

* Update direct package to 3.31.1

* Code clean up

* Update tests with display name

---------

Co-authored-by: Sourabh Jain <sourabhjain@microsoft.com>

* Documentation: Adds additional remarks to CosmosClient (#3891)

* CosmosClient documentation improvements

* Cref fix

* Link fix

* Documentation fix

* Typo fix

---------

Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>

* Open Telemetry End To End Test: Adds baseline for network level requests trace (#3887)

* enable request level in end to end

* made some changes

* fix tests

* fix display name

* hardcoded containername and databasenam

* fix tests

* temp

* fix tests

* update contracts

* fix tests

* fixed display name

* [Internal] Design Docs: Adds Design Document for Client Telemetry (#3590)

* sdk design for client telemetry

* Otel design

* update optel design

* added more nformation

* updated ct design

* remove otel design

* Client Telemetry Design

* update typos

* fix typos

* fix typos

* added limitation

* updated docs

* updated doc

* updated text

* Update docs/observability.md

Co-authored-by: Kiran Kumar Kolli <kirankk@microsoft.com>

* Update docs/observability.md

Co-authored-by: Kiran Kumar Kolli <kirankk@microsoft.com>

* Update docs/observability.md

Co-authored-by: Kiran Kumar Kolli <kirankk@microsoft.com>

* Update docs/observability.md

Co-authored-by: Kiran Kumar Kolli <kirankk@microsoft.com>

* Update docs/observability.md

Co-authored-by: Kiran Kumar Kolli <kirankk@microsoft.com>

* move stuff here and there.

---------

Co-authored-by: Kiran Kumar Kolli <kirankk@microsoft.com>

* [Internal] Design Docs: Adds Design Document for Client Telemetry Part 2 (#3903)

* updated doc

* Update docs/observability.md

Co-authored-by: Justine Cocchi <jucocchi@microsoft.com>

* updated text

---------

Co-authored-by: Justine Cocchi <jucocchi@microsoft.com>

* ConnectionPolicy: Refactors Code to Reduce Default Request Timeout to 6 Seconds. (#3902)

* Code changes to reduce default request timeout to 6 seconds.

* Code changes to update API doc default request timeout to 6 seconds.

* [Internal] Upgrade Resiliency: Adds Replica Health State Diagnostics. (#3835)

* Code changes to add replica health status in diagnostics.

* Code changes to fix performance test build failure.

* Code changes to add health state capture logic in address cache.

* Code changes to fix benchmark test execution.

* Code changes to add tests to validate health state cache.

* Code changes to reduce default request timeout to 5 seconds.

* Revert "Code changes to reduce default request timeout to 5 seconds."

This reverts commit 139f37e588fc9dfed608431f4186c567a080e622.

* Subpartitioning: Fixes handling of split physical partitions (#3879)

* Initial Commit DO NOT REVIEW

* bug fix, needs Direct Package Changes

* fix for change feed and query plus tests

* clean up

* query + clean up

---------

Co-authored-by: Kiran Kumar Kolli <kirankk@microsoft.com>

* [Query] Fixes empty property name parsing exception (#3907)

* inital commit

* cleanup

* test cleanup

* PR comments

* PR comment

* [Preview] Query: Refactors EnableOptimisticDirectExecution to true by default in Preview mode (#3909)

* Setting EnableODE to true by default in Preview Mode.

* Added seperate if block for default value

* Updated property

* Removed unused Usings

* Updated contracts

* Updated test

* Updated directive indentation

* Documentations: Adds links to PatchItems docs (#3910)

* Added links to PatchItems docs

* Undo changes from internal file

* [Internal] Direct Package Upgrade: Refactors Code to Bump Up `Cosmos.Direct` Package to `3.31.2` (#3918)

* Code changes to bump up the direct version.

* Code changes to mark the Israel Central region as public.

* Code changes to update contracts.

* Code changes to fix test failure. Some clean ups.

* Code changes to add detailed message for open channels count.

* SDK 3.35.0 : Adds version bump and changelog (#3920)

* release PR

* updated changelog.md

* more changelog updates

* [Internal] Last minute fix to changelog for 3.35.0 (#3921)

* release PR

* updated changelog.md

* more changelog updates

* changelog fix

* Update changelog.md

* Update changelog.md

* [Internal] Query: Adds new header SupportedSerializationFormats (#3911)

* Binary Serilaization Response test

* Added new header SupportedSerializationFormats

* Modified existing use of CosmosSerializationFormatOptions

* Modified tests and removed unused code

* Addressed comments

* Added more negative cases

* Revert changes

* Added spaces

* Addressed comments

* Addressed comments

* Removed SupportedSerializationFormats from Headers file

* Removed unused JsonSerilazationFormats option

* Addressed comments

* Addressed comments

* Addressed comments

* Addressed comments

* Added new enum TransportSerializationFormat

* Added new enum TransportSerializationFormat

* Addressed comments

* Removed unused parameter

* Addressed comments

* updating API

* remove tests

* Text fixes

* fix typo

* remove TransportSerializationFormat header

* text reverts

* revert

* test update

* PR comments

* remove test owner headers HeadersValidationTests.cs

* PR comments - remove unsupported tests and scope client

---------

Co-authored-by: Heet <detrojaheet@gmail.com>
Co-authored-by: neildsh <35383880+neildsh@users.noreply.github.com>
Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>

* Code changes to optimize the rntbd open connection logic to open connections in parallel. (#3939)

* Query : Adds support for newtonsoft member access via ExtensionData (#3834)

* Support newtonsoft member access via ExtensionData

* Return null instead of empty string

* Added tests for select & where

* Updated baseline with note

---------

Co-authored-by: leminh98 <leminh.ams@gmail.com>

* HttpTransport: Fixes HttpTimeoutPolicies to not accidentally suppress retries (#3944)

* Fix HttpTimeoutPolicies to not accidentally suppress retries

* Removing HttpTimeoutPolicy.MaxRetryTimeLimit altogether

* SDK 3.35.1 : Adds version bump and changelog (#3945)

* version bump

* changelog

* contract

* [Internal] Changelog: Fixes recommended version and title (#3948)

* SDK 3.35.1: Adds version bump and changelog

* Update changelog.md

* Update changelog.md

* Update changelog.md

* Update changelog.md

* Update changelog.md

* [Internal] Dependencies: Fixes dependabot alert for System.Linq.Dynamic.Core (#3957)

* Removing 1

* Removing 2

* Removing 3

* [Internal] Upgrade Resiliency: Adds Code to Enable Replica Validation Feature for Preview (#3951)

* Code changes to add replica validation feature in cosmos client options.

* Code changes to upgrade the cosmos direct version to 3.31.3.

* Adding emulator test to cover replica validation.

* Code changes to address cosmetic clean ups.

* Code changes to address review comments. Fixed preview build failures.

* Code changes to enable replica validation for preview package by default.

* Code changes to address review comments.

* Code changes to fix preview unit tests.

* Code changes to disable environment variable at the end of the test.

* Client Encryption: Adds package reference Microsoft.Azure.Cosmos version 3.35.1-preview (#3956)

* changing cosmos preview version

* updating build file

---------

Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>

* [Internal] FabricBot: Adds GitOps.ResourceManagement because of FabricBot decommissioning (#3966)

* Add prIssueManagement.yml to onboard repo to GitOps.ResourceManagement as FabricBot replacement

Owners of the FabricBot configuration should have received email notification. The same information contained in the email is published internally at: https://aka.ms/gim/fabricbot. Details on the replacement service and the syntax of the new yaml configuration file is available publicly at: https://microsoft.github.io/GitOps/policies/resource-management.html

Please review and merge this PR to complete the process of onboarding to the new service.

* Deleting fabricbot.json

---------

Co-authored-by: microsoft-github-policy-service[bot] <77245923+microsoft-github-policy-service[bot]@users.noreply.github.com>

* [Internal] Query: Refactors certain tests to not fail when EnableOptimisticDirectExecution is set to true in 3.35.0-preview package (#3955)

* Updated emulator and baseline tests to not fail when ODE is set to default true in PREVIEW mode

* Fixed QueryAsync() test

* Fixed QueryAsync() in EndToEndTraceBaselineTests

* Undid changes to IndexMetrics baseline file

* Updated EndToEndTraceWriterBaselineTests.QueryAsync xml

* Updated xml

* Updated xml to have request options tag

* Diagnostics: Fixes verbose levels for "Operation will NOT be retried" (#3969)

* Query: Fixes malformed continuation token exception type and message (#3917)

* Fixed malformed continuation token issue where Exception was not CosmosExceptionan and did not have the correct Status and Sub Status codes.

* Fixed incorrect indentation

* Added type check for incoming exception

* Replaced if/else with extra catch block

* Moved fix to a higher point in the call stack

* Removed unused Usings

* Updated test code

---------

Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>

* [Internal] Upgrade Resiliency: Refactors Code to Enable Replica Validation Feature Through `CosmosClientOptions` And Environment Variable (#3974)

* Code changes to use client options to enable or disable replica validation.

* Code changes to fix preview build failures.

* Query : Adds string comparison alternative when converting LINQ to SQL (#3668)

* string.Compare supported with LINQ to SQL

* Update tests

* Update test name

* Update tests

* Add test

* Create helper ReverseExpressionTypeForStrings

* PR feedback

* Update tests

* Update base line

---------

Co-authored-by: Aditya <adityasa@users.noreply.github.com>
Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>

* AI Integration: Fixes event generation for failed requests (#3973)

* first draft

* fix code

* included feedback

* flip condition

* updated docs

* Update docs/observability.md

Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>

* Update observability.md

* updated contract

---------

Co-authored-by: Matias Quaranta <ealsur@users.noreply.github.com>

* [Internal] Category: Refactors Cosmos benchmark operations (#3961)

* Refactoring: base classes for operations.

* Updating comments.

* Adding new line at the end of the file.

* Fixing code review points.

* Restore PrepareAsync to be virtual.

* 3.35.2: Adds new SDK versions and contract files (#3985)

* Updated change log and bumped up the version.

* Changing the version to 3.35.2

* Code changes to address review comments.

* Code changes to make minor fixes.

* Code changes to move some fixes into preview.

* [INTERNAL] LocalQuorum: Adds documentation for LocalQuorum (#3993)

* Draft of local-quorum documentation

* Adding experimental to header

* Adding cross-region read guarantees

* Reads Bounded clarification

* Adding account consistency step also

* Non-Prod usage note at top

* Addressing review comments

* Some more refinement

* Code changes to update release note. (#3996)

* Client Encryption: Adds fix for supporting Prefix Partition Key (Hierarchical partitioning) (#3979)

* Hirarchical pk bug fix

* Hirarchical pk bug fix

* Hirarchical pk bug fix

* Hirarchical pk bug fix

* Hirarchical pk bug fix

* testing new version

* adding more tests

* adding more tests

* adding more tests

* code review changes

* test fix

* test fix

* test fix

* test fix

---------

Co-authored-by: Nalu Tripician <27316859+NaluTripician@users.noreply.github.com>

* Query: Refactors changelog.md with Optimistic Direct Execution recommendation (#4004)

* Update changelog.md

This is a recommendation for customers if they would like to use the ODE features.

* Updated release notes for ODE

* [Internal] Query: Adds performance testing for OptimisticDirectExecution pipeline (#3839)

* Infrastructure for performance testing with ODE pipeline.

* Resolve comments

* Removed randomization from data creation process

* Fixed comments

* Removed Query and EnableODE from QueryStatisticsMetrics, as they do not relate to query statistics.

* Removed try catch to make CreateItemAsync call always succeed

* Removed one liner functions

* Removed code from MetricsSerializer and QueryStatisticsDatumVisitor files

* Fixed comments

* Removed request Charge check

* Bug in Debug Assert

* Test

* Bug in debug assert fix

* Fixed second bug in Metrics Accumalator class

* Added ignore flag to ode perf tests so that they do not run on every loop build

* Added comment explaining the Ignore flag.

* Query: Adds ODE continuation token support for non-ODE pipelines (#4009)

* Added code to throw exception if ODE continuation token goes into non ODE pipeline

* Removed count variable

* Updated test name

* Removed ODE continuation token logic from caller class

* Simplified code

* Fixed comments

* Updated continuation token cast

* Removed const string for continuation token

* Added Ignore flag for test

* Added baseline test

* Updated baseline test

* Code changes to disable replica validation in preview package. (#4019)

* 3.35.3: Adds new SDK versions and contract files (#4024)

* Updated change log and bumped up the patch version.

* Code changes to update the change log message.

* [Internal] Distributed tracing: Adds a sample to collect activities and events using custom listener (#4021)

* custom listener example

* removed unwanted code

* add comments

* fix appsettings

* revert changes

* Code changes to fix race condition by calling dispose too early. (#4030)

* Code changes to update change log for release 3.35.3 (#4032)

* Documentation: Fixes article links (replaced links V2 to V3 SDK version) + Azure Cosmos DB typo (#4031)

* Documentation link fix

* Fixed Typo "Azure CosmosDB"→"Azure Cosmos DB"

* [Internal] Benchmark tool: Adds Cosmos Benchmark Metrics (#3950)

* Adding metrics for Benchmark tool.

* Adding OpenTelemetry.

* Revert "Adding OpenTelemetry."

This reverts commit c7da0884697064103145099e284892365f4ebb68.

* Telemetry for windowed percentiles.

* OpenTelemetry, AppInsights and Dashboard.

* Removing DiagnosticDataListener.

* Code styling, comments and clean-up.

* Fixing issues with dashboard.

* Fixing positions of charts on the dashboard.

* Fixing the dashboard.

* Updating titles and subtitles.

* Removing ILogger and other not required references.

* Fixing code review points.

* Fixing issues after rebase.

* Removing unnecessary changes.

* Fixing code review points.

* Adding metrics for Benchmark tool.

* Adding OpenTelemetry.

* Revert "Adding OpenTelemetry."

This reverts commit c7da0884697064103145099e284892365f4ebb68.

* Telemetry for windowed percentiles.

* OpenTelemetry, AppInsights and Dashboard.

* Removing DiagnosticDataListener.

* Code styling, comments and clean-up.

* Fixing issues with dashboard.

* Fixing positions of charts on the dashboard.

* Fixing the dashboard.

* Updating titles and subtitles.

* Removing ILogger and other not required references.

* Fixing code review points.

* Fixing issues after rebase.

* Removing unnecessary changes.

* Fixing code review points.

* Fixing code review points.

* make MetrcisCollectorProvider non static and remove locks

* fix

* fixes

* use static class name TelemetrySpan.IncludePercentile

* use app insights connection string

* modified:   Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/Program.cs

* modified:   Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/Program.cs

* rename AppInsightsConnectionString

* fix

* fix comments

* fix if AppInsights c string is not set

* summary

* fix

* remove unnecessary collector types

* remove unnecesary metere provicer

* add event source

* remove folder

* fix

* split success and failed latencies

* fix

* fix

---------

Co-authored-by: David Chaava <chaava01@gmail.com>
Co-authored-by: David Chaava <v-dchaava@microsoft.com>

* GatewayAddressCache: Fixes Unobserved Exception During Background Address Refresh (#4039)

* Code changes to fix unobserved exception during background address refresh.

* Code changes to add exception handler in task.

* Code changes to fix null ref exception.

* Revert "Code changes to fix null ref exception."

This reverts commit 83f90d578bd301339f6fa13981a0fe2fc3d65fa6.

* Revert "Code changes to add exception handler in task."

This reverts commit c49ed8162758217a09df28417a6f76649eab6a26.

* Code changes to address review comments.

* Revert "Code changes to address review comments."

This reverts commit d2b9f6b501f64f1a50b8a49de3ea76fbb9b5c853.

* Documentation: Adds additional note for GetContactedRegions method (#4042)

* Added small remark for GetContactedRegions method documentation

* Moved to remarks

* [Internal] Client Telemetry: Adds Client Telemetry pipeline sending data to service (#3900)

* first draft

* comment other pipelines

* pint variables

* commnet other pipelines

* added env variable

* minor changes

* update env variable

* print env variable

* add space in end

* fix test

* fix tests

* fix test

* fix tests

* remove response interceptor

* logs

* debuug mode

* 3failing test to print llgs

* minor refactoring

* 2nd windows-2019

* fix ct tests

* 2remove debugging

* fix tests

* revert

* ncomment pipelines

* fix test

* minor changes

* release and emulator pipeline

* update pipelines

* ignore abstract class test

* fixing pipeline

* refactor code

* change it to class name to run tests

* added emulator setup

* 1 temp commit

* env variable

* renames env variable

* fix tests

* add condition

* fix tests

* reorder env variable

* revert pipeline

* did some clean up

* change to revert

* Revert "change to revert"

This reverts commit 03db3c104505dc7b8f3cea267835c92ca530f8f4.

* fix typos

* throw if exception intercepter is null

* remove modelling changes

* removed virtaul

* Update Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Utils/HttpHandlerHelper.cs

Co-authored-by: Matias Quaranta <ealsur…
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.

IndexOutOfRange exception occured in HttpResponseHeadersWrapper ctor, while doing cosmosException.ToString()
4 participants