Skip to content

ci: test with MongoDB 7.0 by default - #309

Merged
uniqueg merged 2 commits into
devfrom
ci/mongodb-7
Oct 19, 2026
Merged

uniqueg merged 2 commits into
devfrom
ci/mongodb-7

Conversation

@uniqueg

@uniqueg uniqueg commented Oct 19, 2026 •

Copy link
Copy Markdown
Member

Summary

MongoDB 8.0 refuses to start on Linux kernels 6.19 to 7.0.13 ("MongoDB cannot start: Linux kernel versions 6.19 and newer has a known incompatibility with this version of MongoDB", SERVER-121912): its TCMalloc violates the kernel's rseq ABI. Some GitHub runners now have such kernels, so CI jobs using MongoDB 8.0 fail at random (seen in two runs of #308: a unit test job whose MongoDB container never started, and the petstore integration tests, whose app could not reach MongoDB). No MongoDB release with a confirmed fix is known; MongoDB 7.0 is not affected and passed in all runs.

  • Unit tests run with MongoDB 7.0; one job (Python 3.13) keeps testing MongoDB 8.0, with continue-on-error, so it does not fail the workflow. Coverage is uploaded from the Python 3.13 / MongoDB 7.0 job.
  • The example apps (and therefore the integration tests) use mongo:7.0.
  • The migration guide mentions the issue.

Verification

  • Workflow and compose files parse; mkdocs build --strict passes.
  • CI: pending.

Open questions

None.

🤖 Generated with Claude Code

Summary by Sourcery

Make MongoDB 7.0 the default test and example version while preserving non-blocking MongoDB 8.0 coverage and documenting the compatibility issue.

Bug Fixes:

  • Use MongoDB 7.0 as the reliable default for CI and example applications to avoid MongoDB 8.0 startup failures on affected Linux kernels.

Enhancements:

  • Retain MongoDB 8.0 coverage in a non-blocking Python 3.13 CI job while collecting coverage from MongoDB 7.0.
  • Document the MongoDB 8.0 kernel incompatibility and migration guidance.

CI:

  • Run unit tests and integration examples against MongoDB 7.0 by default, with MongoDB 8.0 tested non-blockingly.

Documentation:

  • Document the affected Linux kernels and recommend MongoDB 7.0 on those hosts.

MongoDB 8.0 refuses to start on Linux kernels 6.19 to 7.0.13
(SERVER-121912), which some GitHub runners have, so that jobs using it
fail at random. Run the unit tests with MongoDB 7.0, keep one job with
MongoDB 8.0 that does not fail the workflow, and use MongoDB 7.0 in the
example apps (also used by the integration tests). Mention the issue in
the migration guide.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@sourcery-ai

sourcery-ai Bot commented Oct 19, 2026 •

Copy link
Copy Markdown
Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

The PR avoids intermittent MongoDB 8.0 startup failures by making MongoDB 7.0 the default for CI and example applications, while preserving MongoDB 8.0 coverage in a non-blocking Python 3.13 job and documenting the affected Linux kernels and workaround.

File-Level Changes

Change Details Files
Make MongoDB 7.0 the reliable default for unit-test CI while retaining non-blocking MongoDB 8.0 coverage.
  • Change the test matrix default from MongoDB 8.0 to 7.0 across supported Python versions.
  • Add a Python 3.13/MongoDB 8.0 compatibility job that is allowed to fail.
  • Move Codecov upload to the Python 3.13/MongoDB 7.0 job.
.github/workflows/checks.yml
Pin example application environments to MongoDB 7.0 to prevent integration-test and local startup failures on affected kernels.
  • Replace the MongoDB 8.0 image with 7.0 in both petstore Compose configurations.
  • Add comments documenting the kernel incompatibility.
examples/petstore-access-control/docker-compose.yaml
examples/petstore/docker-compose.yaml
Document the MongoDB 8.0 kernel incompatibility and the recommended fallback.
  • Record the affected Linux kernel range and upstream issue in the migration guide.
  • Recommend MongoDB 7.0 on affected hosts.
docs/migration-0.14.md

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@codecov

codecov Bot commented Oct 19, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (0b92b3d) to head (5f33051).

Additional details and impacted files
@@            Coverage Diff            @@
##               dev      #309   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           22        22           
  Lines         1322      1322           
=========================================
  Hits          1322      1322           
Flag Coverage Δ
test_unit 100.00% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 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.

@uniqueg
uniqueg marked this pull request as ready for review October 19, 2026 20:51

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Hey - I've found 1 issue

Prompt for AI Agents
Please address the comments from this code review:

## Individual Comments

### Comment 1
<location path="examples/petstore/docker-compose.yaml" line_range="29" />
<code_context>
-    image: mongo:8.0
+    # MongoDB 8.0 refuses to start on Linux kernels 6.19 to 7.0.13
+    # (https://jira.mongodb.org/browse/SERVER-121912)
+    image: mongo:7.0
     restart: unless-stopped
     volumes:
</code_context>
<issue_to_address>
**Existing databases become unavailable**

When an example has a persisted bind-mounted database initialized by MongoDB 8.0 and the updated Compose configuration switches it to 7.0, `docker compose up` starts `mongo:7.0` against the MongoDB 8.0 data; MongoDB rejects the downgrade, including data at FCV 8.0, so the database service exits and the example app loses access to its existing database.

Keep the MongoDB image compatible with existing data, or provide and document a supported downgrade or backup-and-restore path before switching existing deployments to 7.0.

Also at `examples/petstore-access-control/docker-compose.yaml:30`.
</issue_to_address>

Sourcery assessment

Approval pending. 1 finding to address first.

Blocking findings: examples/petstore/docker-compose.yaml:29


Sourcery is free for open source - if you like our reviews please consider sharing them ✨

Comment thread examples/petstore/docker-compose.yaml Resolved
Co-Authored-By: Claude Opus 5.5 <[email protected]>
@uniqueg
uniqueg merged commit 99030b8 into dev Oct 19, 2026
13 checks passed
@uniqueg
uniqueg deleted the ci/mongodb-7 branch October 19, 2026 21:13
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.

1 participant