Skip to content

Remove code for end-of-life MongoDB, Kafka, Neo4j and Redis Stack versions - #1597

Open
cristianrgreco wants to merge 32 commits into
mainfrom
claude/drop-eol-kafka-mongodb-code
Open

cristianrgreco wants to merge 32 commits into
mainfrom
claude/drop-eol-kafka-mongodb-code

Conversation

@cristianrgreco

@cristianrgreco cristianrgreco commented Oct 13, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Removes module code that exists only for versions past the vendor's end of life. Follow-up to #1589, #1592, #1593 and #1595, which stopped testing those versions.

MongoDB

  • MongoDBContainer always uses mongosh. The isV5OrLater() check and the legacy mongo shell branch for MongoDB below 5.0 are gone, and so is the compare-versions dependency of @testcontainers/mongodb.

  • MongoDB 4.4 ended 2024-02-29 and 5.0 ended 2024-10-31 (endoflife.date). Supported today: 7.0, 8.0, 8.3, 9.0.

  • Side effect, a fix: a tag that is not a version (mongo:latest, mongo:noble) made the version check throw, which selected the legacy mongo shell. Current images do not ship it, so the health check could never pass. Probe on main:

    latest => mongo admin --quiet --eval x
    noble  => mongo admin --quiet --eval x
    9.0.2  => mongosh --quiet --eval x
    

Kafka

Everything at or below Confluent Platform 7.7 is past community end of support (Supported Versions and Interoperability). Removed:

  • The custom KRaft setup for 7.0 to 7.3 (commandKraft() and the two <7.4.0 branches). From 7.4 the image configures KRaft itself.
  • The guard that rejected KRaft below 7.0.0, and the guard that rejected KRaft with SASL below 7.5.0, with their two tests. Both existed only to reject versions that are no longer supported.

Kept: ZooKeeper mode and the >=8.0.0 switch, which serve the supported 7.9 and 8.x lines.

Neo4j

Neo4j 4.4 ended 2025-11-30 (endoflife.date). Supported today: 5.26 and 2026.09.

  • NEO4JLABS_PLUGINS is no longer set. Neo4j 5 renamed it to NEO4J_PLUGINS, which the module already sets.
  • dbms.security.procedures.whitelist becomes dbms.security.procedures.allowlist. On 5.26.31 and 2026.09.0 the old name only logged Use of deprecated setting 'dbms.security.procedures.whitelist' and was mapped to allowlist, so the effective setting is unchanged (checked with SHOW SETTINGS on both).

Redis Stack

Redis Stack is discontinued: its README says maintenance releases of 6.2, 7.2 and 7.4 stopped in December 2025 and points users to Redis 8, which includes the Stack modules. The last redis/redis-stack-server image was pushed on 2025-11-03.

  • RedisContainer no longer special-cases images whose name contains redis-stack (passing its arguments through REDIS_ARGS and the image's /entrypoint.sh).
  • The three Redis Stack tests, the redis/redis-stack-server:7.4.0-v4 line in the module Dockerfile and the "Redis stack" docs section are removed.

Other implementations

  • Kafka: Go rejects KRaft below 7.4.0 (modules/kafka/kafka.go L385-L386 at 9d2885db), and Java's current ConfluentKafkaContainer is documented as compatible with cp-kafka 7.4.0 and later (docs/modules/kafka.md L39 at 9bb3c2dc). Neither supports KRaft below 7.4; unlike Go, this PR does not keep a guard for it.
  • MongoDB: Java and Go keep the old shell with mongosh … || mongo … and no version check (Java MongoDBContainer.java L135, Go modules/mongodb/cli.go L30). Not followed here: the maintainer's decision is not to keep code for end-of-life versions.

Verification

Local, macOS arm64, Docker Desktop:

Run Result
npx vitest run packages/modules/mongodb/src/mongodb-container.test.ts --maxConcurrency=2 6 passed (9.0.2, 7.0.43, 8.0.32, 8.3.11)
npx vitest run packages/modules/kafka --maxConcurrency=2 15 passed in 2 files (8.3.2 and 7.9.1 KRaft, ZooKeeper, SASL)
npx vitest run packages/modules/redis 27 passed (6.2.24, 7.4.11 and the Dockerfile image)
npx vitest run packages/modules/neo4j --maxConcurrency=2 4 passed on 5.26.31, and 4 passed on 2026.09.0 with the Dockerfile switched locally (APOC, APOC Extended and Graph Data Science load on both)
  • npm run format, npm run lint, npm run knip, npm run check-compiles: clean.
  • package-lock.json changes only the compare-versions entry of @testcontainers/mongodb.
  • Docs: the Kafka, MongoDB and Neo4j pages name none of the removed versions or settings. The Redis page loses its "Redis stack" section; its other inside_block markers still resolve.

Left to CI: Podman, Node 22 and 24, linux/amd64, the Atlas Local file.

Breaking

  • new MongoDBContainer("mongo:4.4…") and any other image without mongosh no longer becomes healthy; start() fails after the startup timeout.
  • KafkaContainer#withKraft() on Confluent Platform below 7.4, and with SASL below 7.5, is no longer rejected with a message and no longer set up; the broker fails to start. ZooKeeper mode on those versions is unchanged.
  • Neo4jContainer#withApoc() and withPlugins() no longer install plugins on Neo4j 4 images.
  • RedisContainer with a redis/redis-stack-server image now starts plain redis-server with the given arguments, so the Stack modules are not loaded. Redis 8 has them built in.
  • No exports or signatures changed.

@cristianrgreco cristianrgreco added maintenance Improvements that do not change functionality major An incompatible API change labels Oct 13, 2026
@cristianrgreco cristianrgreco changed the title Drop support for MongoDB below 5.0 and Kafka KRaft below Confluent Platform 7.4 Remove code for end-of-life MongoDB, Kafka and Neo4j versions Oct 13, 2026
@cristianrgreco cristianrgreco changed the title Remove code for end-of-life MongoDB, Kafka and Neo4j versions Remove code for end-of-life MongoDB, Kafka, Neo4j and Redis Stack versions Oct 13, 2026
@cristianrgreco
cristianrgreco marked this pull request as ready for review October 14, 2026 14:38
@cristianrgreco cristianrgreco added minor Backward compatible functionality and removed major An incompatible API change labels Oct 14, 2026

This branch has not been deployed

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

Labels

maintenance Improvements that do not change functionality minor Backward compatible functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant