Implementation of in-memory-emulator with external endpoint#4786
Implementation of in-memory-emulator with external endpoint#4786FabianMeiswinkel wants to merge 50 commits into
Conversation
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
…-008 Address reviewer feedback: key/entra auth must require HTTPS (else credentials leak over plaintext h2c), and entra mode must define the full set of JWT validation trust inputs (JWKS source, issuer, audience, allowed OIDs) rather than rely on an allow-list alone. Co-authored-by: FabianMeiswinkel <19165014+FabianMeiswinkel@users.noreply.github.com>
Normalize ADR-003 to the repository's canonical Gateway 2.0 terminology. This keeps the document aligned with the Cosmos Gateway naming guidance without changing any other ADR content. Co-authored-by: FabianMeiswinkel <19165014+FabianMeiswinkel@users.noreply.github.com>
Co-authored-by: FabianMeiswinkel <19165014+FabianMeiswinkel@users.noreply.github.com>
Co-authored-by: FabianMeiswinkel <19165014+FabianMeiswinkel@users.noreply.github.com>
Co-authored-by: FabianMeiswinkel <19165014+FabianMeiswinkel@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
|
/azp run rust - cosmos - weekly |
|
Azure Pipelines: Successfully started running 1 pipeline(s). |
|
/azp run rust - cosmos - weekly |
|
Azure Pipelines: Successfully started running 1 pipeline(s). |
|
/azp run rust - cosmos - weekly |
|
Azure Pipelines: Successfully started running 1 pipeline(s). |
There was a problem hiding this comment.
Review details
Comments suppressed due to low confidence (3)
sdk/cosmos/azure_data_cosmos_driver/tests/in_memory_emulator_tests/split_merge.rs:186
- This reads from the source region, where the item was written before replication, so the test still passes if the deferred replication is lost during the split. Read from
ctx.west_urlas the merge test does; that makes the assertion actually verify replication into the target region.
sdk/cosmos/ci.yml:74 - The PR promises non-blocking emulator legs, but
ci.tests.yml:28-31defaults jobs to blocking unless their matrix setsContinueOnError. The new in-memory matrix omits it, and this PR also removes it from the existing vnext matrix, so emulator failures now block the build. Restore"ContinueOnError": ["true"]in both emulator matrices (or update the stated intent if blocking is deliberate).
sdk/cosmos/azure_data_cosmos_driver/src/driver/transport/gateway_v2_dispatch.rs:501 - These mappings make additional Gateway 2.0 metadata visible through public response headers, which is customer-visible driver behavior. The Cosmos changelog rule requires every customer-visible change to be recorded (
sdk/cosmos/.github/instructions/cosmos.changelog.instructions.md:6-12), but this PR has no unreleased changelog entry; add one describing the newly surfaced Gateway 2.0 metadata.
if let Some(item_count) = response.item_count {
headers.insert(response_header_names::ITEM_COUNT, item_count.to_string());
}
if let Some(query_metrics) = response.query_metrics {
headers.insert(response_header_names::QUERY_METRICS, query_metrics);
- Files reviewed: 60/61 changed files
- Comments generated: 0 new
- Review effort level: Medium
|
/azp run rust - cosmos - weekly |
|
Azure Pipelines: Successfully started running 1 pipeline(s). |
There was a problem hiding this comment.
Review details
Comments suppressed due to low confidence (1)
sdk/cosmos/ci.yml:75
- The PR description promises non-blocking emulator CI legs, but this change explicitly makes both hosted-emulator jobs blocking and also moves the vNext leg out of
AdditionalMatrixConfigsafter removing itsContinueOnErrorsetting. This changes release gating rather than merely adding non-blocking coverage. Please either restore the non-blocking matrix configuration or update the stated requirement if blocking CI is intentional.
- Files reviewed: 61/62 changed files
- Comments generated: 0 new
- Review effort level: Medium
There was a problem hiding this comment.
You might consider naming this AGENTS.md and putting it in the crate root. Gets discovered automatically. I used to do this whole plan.md thing as well, but you have to remember to refer to it each time...unless that's your intention.
| complete design (configuration schema, management REST API, Gateway 2.0 | ||
| support, and CI integration). | ||
|
|
||
| `publish = false` — this crate is never published to crates.io. |
There was a problem hiding this comment.
This seems like something that should be in AGENTS.md, not a customer-focused README.md.
| cargo build -p azure_data_cosmos_emulator | ||
| ./target/debug/azure_data_cosmos_emulator --config sdk/cosmos/azure_data_cosmos_emulator/config/ci-gateway-v1.json |
There was a problem hiding this comment.
Suggestion: depends on PWD, path delimiter (depending on your shell), etc. As long as you're config path is normalizing paths (it should), just the following would work more universally:
| cargo build -p azure_data_cosmos_emulator | |
| ./target/debug/azure_data_cosmos_emulator --config sdk/cosmos/azure_data_cosmos_emulator/config/ci-gateway-v1.json | |
| cargo run -p azure_data_cosmos_emulator -- --config sdk/cosmos/azure_data_cosmos_emulator/config/ci-gateway-v1.json |
| `"emulator_inmemory_gateway_v2"` for Gateway 2.0-specific tests). See | ||
| `sdk/cosmos/eng/scripts/Invoke-CosmosTestSetup.ps1` | ||
| for how CI builds, starts, and health-checks the host process before running | ||
| those suites. |
There was a problem hiding this comment.
Even though you're not publishing, the README should still probably have the security, license, etc. footers as other READMEs generally do.
Adds an out-of-process Cosmos DB in-memory emulator with Gateway V1 and cleartext Gateway 2.0 support.
Changes:
See spec at
sdk\cosmos\azure_data_cosmos_emulator\docs