Skip to content

feat: Azure Cosmos DB outbox repository (NetEvolve.Pulse.CosmosDb)#422

Merged
samtrion merged 12 commits intomainfrom
copilot/add-cosmos-db-outbox-repository
Apr 20, 2026
Merged

feat: Azure Cosmos DB outbox repository (NetEvolve.Pulse.CosmosDb)#422
samtrion merged 12 commits intomainfrom
copilot/add-cosmos-db-outbox-repository

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 17, 2026

  • Create src/NetEvolve.Pulse.CosmosDb/ project structure
  • Implement CosmosDbOutboxOptions, CosmosDbOutboxDocument, CosmosDbOutboxRepository, CosmosDbOutboxManagement, CosmosDbExtensions
  • Add Microsoft.Azure.Cosmos 3.58.0, Newtonsoft.Json 13.0.4, and Testcontainers.CosmosDb 4.11.0 to Directory.Packages.props
  • Add unit tests (CosmosDbExtensionsTests, CosmosDbOutboxRepositoryTests, CosmosDbOutboxManagementTests) — all passing
  • Add integration tests (CosmosDbOutboxTests) using Testcontainers.CosmosDb with the Linux emulator image
  • Add CosmosDbContainerFixture, CosmosDbDatabaseServiceFixture, CosmosDbOutboxInitializer to integration test infrastructure
  • Mark docker image in CosmosDbContainerFixture with /*dockerimage*/ comment, consistent with other container fixtures

Copilot AI linked an issue Apr 17, 2026 that may be closed by this pull request
8 tasks
Copilot AI changed the title [WIP] Add Azure Cosmos DB outbox repository package feat: Azure Cosmos DB outbox repository (NetEvolve.Pulse.CosmosDb) Apr 17, 2026
Copilot AI requested a review from samtrion April 17, 2026 17:50
@samtrion samtrion marked this pull request as ready for review April 18, 2026 10:52
@samtrion samtrion requested a review from a team as a code owner April 18, 2026 10:52
@samtrion samtrion force-pushed the copilot/add-cosmos-db-outbox-repository branch 4 times, most recently from 15828ef to 75ca57d Compare April 20, 2026 16:00
@samtrion
Copy link
Copy Markdown
Contributor

@copilot Add Unit and Integration Tests

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 20, 2026

Codecov Report

❌ Patch coverage is 94.15205% with 20 lines in your changes missing coverage. Please review.
✅ Project coverage is 92.62%. Comparing base (4ffc7d8) to head (f2dfa16).
⚠️ Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
....Pulse.CosmosDb/Outbox/CosmosDbOutboxRepository.cs 92.51% 11 Missing and 3 partials ⚠️
....Pulse.CosmosDb/Outbox/CosmosDbOutboxManagement.cs 94.89% 3 Missing and 2 partials ⚠️
...ve.Pulse.CosmosDb/Outbox/CosmosDbOutboxDocument.cs 97.05% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #422      +/-   ##
==========================================
+ Coverage   92.43%   92.62%   +0.18%     
==========================================
  Files         159      164       +5     
  Lines        5960     6302     +342     
  Branches      539      561      +22     
==========================================
+ Hits         5509     5837     +328     
- Misses        298      306       +8     
- Partials      153      159       +6     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Copy Markdown
Contributor Author

Copilot AI commented Apr 20, 2026

@copilot Add Unit and Integration Tests

Added in commit c639ca8:

Unit tests (tests/NetEvolve.Pulse.Tests.Unit/CosmosDb/):

  • CosmosDbExtensionsTests — covers AddCosmosDbOutbox and UseCosmosDbOutbox null-arg validation, chaining, service registration lifetimes, and options propagation
  • CosmosDbOutboxRepositoryTests — covers constructor null/empty validation and valid construction
  • CosmosDbOutboxManagementTests — covers constructor null/empty validation and valid construction

Integration tests (tests/NetEvolve.Pulse.Tests.Integration/Outbox/CosmosDbOutboxTests):

  • Inherits all tests from OutboxTestsBase (pending count, GetPending, batch size, mark completed/failed/dead-letter, retry scheduling, delete completed, etc.)
  • Uses the Cosmos DB Linux emulator via Testcontainers.CosmosDb (mcr.microsoft.com/cosmosdb/linux/azure-cosmos-emulator:vnext-preview)
  • Infrastructure: CosmosDbContainerFixture, CosmosDbDatabaseServiceFixture, CosmosDbOutboxInitializer — each test method gets an isolated container (mapped from OutboxOptions.TableName) to prevent cross-test interference

Comment thread tests/NetEvolve.Pulse.Tests.Integration/Internals/CosmosDbContainerFixture.cs Outdated
Copilot AI and others added 6 commits April 20, 2026 22:34
Add <AzureCosmosDisableNewtonsoftJsonCheck>true</AzureCosmosDisableNewtonsoftJsonCheck> to both integration and unit test .csproj files. This disables the explicit-reference check for Newtonsoft.Json in Azure Cosmos DB SDK, as these projects use System.Text.Json via CosmosSystemTextJsonSerializer.
Consolidate CosmosDb outbox classes under NetEvolve.Pulse.Outbox namespace. Update XML doc references to match new namespace. Refactor CosmosDbOutboxRepository to iterate over item IDs for deletion. Remove unused using directives for cleaner code.
@samtrion samtrion force-pushed the copilot/add-cosmos-db-outbox-repository branch from 3cf9291 to 7634142 Compare April 20, 2026 20:34
@samtrion
Copy link
Copy Markdown
Contributor

@coderabbitai review

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 20, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 20, 2026

Warning

Rate limit exceeded

@samtrion has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 30 minutes and 4 seconds before requesting another review.

Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 30 minutes and 4 seconds.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: b617c2cc-66a6-4b87-bb91-46aa65ea8b6e

📥 Commits

Reviewing files that changed from the base of the PR and between 6fc0bd0 and ddc8577.

📒 Files selected for processing (19)
  • Directory.Packages.props
  • Pulse.slnx
  • src/NetEvolve.Pulse.CosmosDb/CosmosDbExtensions.cs
  • src/NetEvolve.Pulse.CosmosDb/NetEvolve.Pulse.CosmosDb.csproj
  • src/NetEvolve.Pulse.CosmosDb/Outbox/CosmosDbOutboxDocument.cs
  • src/NetEvolve.Pulse.CosmosDb/Outbox/CosmosDbOutboxManagement.cs
  • src/NetEvolve.Pulse.CosmosDb/Outbox/CosmosDbOutboxOptions.cs
  • src/NetEvolve.Pulse.CosmosDb/Outbox/CosmosDbOutboxRepository.cs
  • src/NetEvolve.Pulse.Redis/RedisIdempotencyMediatorBuilderExtensions.cs
  • tests/NetEvolve.Pulse.Tests.Integration/Internals/CosmosDbContainerFixture.cs
  • tests/NetEvolve.Pulse.Tests.Integration/Internals/CosmosDbDatabaseServiceFixture.cs
  • tests/NetEvolve.Pulse.Tests.Integration/Internals/CosmosDbOutboxInitializer.cs
  • tests/NetEvolve.Pulse.Tests.Integration/Internals/ServiceType.cs
  • tests/NetEvolve.Pulse.Tests.Integration/NetEvolve.Pulse.Tests.Integration.csproj
  • tests/NetEvolve.Pulse.Tests.Integration/Outbox/CosmosDbOutboxTests.cs
  • tests/NetEvolve.Pulse.Tests.Unit/CosmosDb/CosmosDbExtensionsTests.cs
  • tests/NetEvolve.Pulse.Tests.Unit/CosmosDb/CosmosDbOutboxManagementTests.cs
  • tests/NetEvolve.Pulse.Tests.Unit/CosmosDb/CosmosDbOutboxRepositoryTests.cs
  • tests/NetEvolve.Pulse.Tests.Unit/NetEvolve.Pulse.Tests.Unit.csproj

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@samtrion samtrion merged commit 8ef934c into main Apr 20, 2026
11 checks passed
@samtrion samtrion deleted the copilot/add-cosmos-db-outbox-repository branch April 20, 2026 21:54
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.

feat: Azure Cosmos DB outbox repository (NetEvolve.Pulse.CosmosDb)

2 participants