Skip to content

Update MongoDB driver and EF providers - #20041

Closed
Jose Perez Rodriguez (joperezr) wants to merge 1 commit into
mainfrom
joperezr-mongodb-driver-migration
Closed

Jose Perez Rodriguez (joperezr) wants to merge 1 commit into
mainfrom
joperezr-mongodb-driver-migration

Conversation

@joperezr

@joperezr Jose Perez Rodriguez (joperezr) commented Sep 10, 2026 •

Copy link
Copy Markdown
Member

Description

Updates the MongoDB client dependency family independently from the third-party bulk update so this customer-breaking change can be reviewed, released, and rolled back separately.

  • Updates MongoDB.Driver from 3.9.0 to 3.11.2 for the root pin and from 3.3.0 to 3.11.2 for the net9 override.
  • Updates MongoDB.EntityFrameworkCore from 8.4.1 to 8.4.3 for net8 and from 9.0.0 to 9.1.3 for net9.
  • Keeps Aspire.MongoDB.EntityFrameworkCore limited to net8/net9. EF Core 10 support remains a separate feature.
  • Includes MongoDB.Driver 3.11.2 fixes for LINQ regex/character-set query injection, connection-string option injection, credential redaction, and GridFS file-ID matching.

The net9 driver override originally matched MongoDB.EntityFrameworkCore 9.0.0's exact MongoDB.Driver 3.3.0 dependency. MongoDB.EntityFrameworkCore 9.1.3 now requires MongoDB.Driver 3.11.0, so both TFM paths are aligned on 3.11.2.

Validation is blocked because MongoDB.Driver 3.11.2 is not yet available on the approved dotnet-public feed (3.11.1 is the newest mirrored version). A clean-cache restore fails with NU1102. Both requested EF provider versions are already present. Package imports are currently paused after the sequential migration pipeline encountered the secure intermediate-feed quarantine for newly published packages. Once ingestion clears, mirror MongoDB.Driver 3.11.2 and run the focused MongoDB integration builds and tests before marking this PR ready.

Breaking changes

MongoDB.Driver 3.10 raised the minimum supported MongoDB server version from 4.2 to 4.4 and the minimum wire version to 9 (CSHARP-6007, release notes). This affects applications using the Aspire.MongoDB.Driver or Aspire.MongoDB.EntityFrameworkCore client integrations against MongoDB 4.2 or a wire-compatible service that reports a maximum wire version below 9.

Before updating, check the deployed MongoDB server version (for example, with db.version()) or inspect the service's hello command response and compatibility documentation. Upgrade the server or wire-compatible service deployment to MongoDB 4.4+ / wire version 9+ before consuming this Aspire integration update. If that cannot be done yet, retain the prior Aspire integration version until the deployment is upgraded.

Rollback: revert these four central package pins to MongoDB.Driver 3.9.0 (root), 3.3.0 (net9), MongoDB.EntityFrameworkCore 8.4.1 (net8), and 9.0.0 (net9).

Fixes # (issue)

Checklist

  • Is this feature complete?
    • Yes. Ready to ship.
    • No. Follow-up changes expected.
  • Are you including unit tests for the changes and scenario tests if relevant?
    • Yes
    • No
  • Did you add public API?
    • Yes
      • If yes, did you have an API Review for it?
        • Yes
        • No
      • Did you add <remarks /> and <code /> elements on your triple slash comments?
        • Yes
        • No
    • No
  • Does the change make any security assumptions or guarantees?
    • Yes
      • If yes, have you done a threat model and had a security review?
        • Yes
        • No
    • No

Co-authored-by: Copilot App <[email protected]>
@github-actions

Copy link
Copy Markdown
Contributor

🚀 Dogfood this PR with:

⚠️ WARNING: Do not do this without first carefully reviewing the code of this PR to satisfy yourself it is safe.

curl -fsSL https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 20041

Or

  • Run remotely in PowerShell:
iex "& { $(irm https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 20041"

@aspire-repo-bot
aspire-repo-bot Bot requested a balanced review from Copilot September 10, 2026 19:02
@joperezr Jose Perez Rodriguez (joperezr) added the breaking-change Issue or PR that represents a breaking API or functional change over a prerelease. label Sep 10, 2026
@github-actions github-actions Bot added the area-integrations Issues pertaining to Aspire Integrations packages label Sep 10, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Tests selector

Selects the full PR test matrix + all PR-gated jobs (ALL) — a rule matching 'Directory.Packages.props' selects ALL

Advisory workflow impact (4)

  • Aspire.Deployment.EndToEnd.Tests (deployment workflow-only)
  • Aspire.EndToEnd.Tests (outerloop-only)
  • Aspire.Oracle.EntityFrameworkCore.Tests (outerloop-only)
  • deployment-e2e (schedule/dispatch-only)

Selection computed for commit 9fb1635.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot review overview

🟡 Changes recommended

MongoDB.Driver 3.11.2 must be mirrored to the approved feed and validated before the solution can restore successfully.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Review tier: Balanced
Findings: 1 High severity

New issues introduced by this change (1)
Severity Finding
High severity Directory.Packages.props — Mirror the driver before pinning it
What changed in this PR

Updates MongoDB client dependencies while retaining net8/net9-only EF provider support.

Changes:

  • Updates MongoDB.Driver to 3.11.2.
  • Updates EF providers to 8.4.3 and 9.1.3.
File Description
Directory.Packages.props Updates MongoDB package pins by target framework.

Comment thread Directory.Packages.props
<PackageVersion Include="Milvus.Client" Version="2.3.0-preview.1" /> <!-- No stable release available -->
<PackageVersion Include="ModelContextProtocol" Version="1.3.0" />
<PackageVersion Include="MongoDB.Driver" Version="3.9.0" />
<PackageVersion Include="MongoDB.Driver" Version="3.11.2" />
@github-actions

Copy link
Copy Markdown
Contributor

Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt.

@github-actions

Copy link
Copy Markdown
Contributor

Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt.

@github-actions

Copy link
Copy Markdown
Contributor

Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-integrations Issues pertaining to Aspire Integrations packages breaking-change Issue or PR that represents a breaking API or functional change over a prerelease.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants