[Cosmos] Add preview support for change feed previous images - #49063
Simon Moreno (simorenoh) wants to merge 6 commits into
Conversation
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 6c56dbeb-5747-439d-80ff-e9e21e3eff34
|
Azure Pipelines: Successfully started running 3 pipeline(s). 7 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
This comment has been minimized.
This comment has been minimized.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 6c56dbeb-5747-439d-80ff-e9e21e3eff34
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 6c56dbeb-5747-439d-80ff-e9e21e3eff34
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 6c56dbeb-5747-439d-80ff-e9e21e3eff34
This comment has been minimized.
This comment has been minimized.
|
Azure Pipelines: Successfully started running 3 pipeline(s). 7 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
There was a problem hiding this comment.
🟡 Changes recommended
Replace previous images and TTL expirations need service-backed assertions, and the required changelog entry is missing.
Get a fresh assessment by requesting another Copilot review.
Pull request overview
Adds provisional Azure Cosmos change-feed previous-image support documentation, samples, emulator configuration, and validation.
Changes:
- Documents and demonstrates optional
previousimages. - Enables emulator preview behavior.
- Expands sync and async change-feed tests.
File summaries
| File | Description |
|---|---|
tests/test_change_feed_all_versions.py |
Expands sync coverage. |
tests/test_change_feed_all_versions_async.py |
Expands async coverage. |
samples/change_feed_management.py |
Demonstrates sync consumption. |
samples/change_feed_management_async.py |
Demonstrates async consumption. |
azure/cosmos/container.py |
Documents sync response contract. |
azure/cosmos/aio/_container.py |
Documents async response contract. |
eng/pipelines/templates/stages/cosmos-sdk-client.yml |
Enables emulator preview override. |
Review details
Suppressed comments (2)
sdk/cosmos/azure-cosmos/tests/test_change_feed_all_versions.py:185
- The real emulator replace response does not verify the feature being added here.
assert_change_feedonly checks fields present inexpected_change_feeds, and this expectation omitsprevious, so the test still passes if replace events lose their previous image. Add the prior item body to the emulator expectation (and seed a version-1 field if the version transition should be asserted).
expected_change_feeds = [
{CURRENT: {ID: f'doc{i}', VERSION: 2}, METADATA: {OPERATION_TYPE: REPLACE}}
for i in range(4)
]
sdk/cosmos/azure-cosmos/tests/test_change_feed_all_versions_async.py:193
- The real emulator replace response does not verify the feature being added here.
assert_change_feedonly checks fields present inexpected_change_feeds, and this expectation omitsprevious, so the test still passes if replace events lose their previous image. Add the prior item body to the emulator expectation (and seed a version-1 field if the version transition should be asserted).
expected_change_feeds = [
{CURRENT: {ID: f'doc{i}', VERSION: 2}, METADATA: {OPERATION_TYPE: REPLACE}}
for i in range(4)
]
- Files reviewed: 7/7 changed files
- Comments generated: 3
- Review effort level: Balanced
💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 6c56dbeb-5747-439d-80ff-e9e21e3eff34
[Pilot] PR Pipeline Failure AnalysisWhat failedAzure Pipeline build 6850060 ( Root cause 1 (dominant, ~1,900 of the failures): A shared test database's collection quota (max 25 collections per database offer) is exhausted mid-run, causing cascading Root cause 2 (40 failures): Relevant pipeline outputRecommended next steps
Automated fix: Fix found, view and apply fix
|
Adds provisional support for consuming previous item images returned by
AllVersionsAndDeleteschange feed.previousresponse member for sync and async change feed APIs.No new SDK request option is introduced because previous-image enablement is service-side, consistent with the .NET implementation.
Closes #49054
Targeted sync and async pass-through and live-account AVAD tests pass. Cosmos mypy checks also pass.