chore(deps): upgrade the Neo4j Python driver from 6.2.0 to 6.4.1
Upgrade the Neo4j Python driver from 6.2.0 to 6.4.1 for its connection-pool fixes
This PR upgrades neo4j and neo4j-rust-ext from 6.2.0 to 6.4.1. Infrahub servers and task workers hold many database sessions at once, and versions 6.3.1 and 6.4.0 of the driver fix connection-pool bugs on the path every database query uses.
Jira: INBOX-370
Driver changes between 6.2.0 and 6.4.1
From the driver's 6.x changelog. It marks no change in this range as breaking or as a deprecation.
- 6.3.1 fixes an application-error path that could release a session's connection to the pool while a
Resultstill held it (neo4j-python-driver#1333). The changelog says this "can lead to protocol errors, data races, and in the worst case reading records from another query." - 6.4.0 fixes a race condition in the Bolt connection pool (#1346), and discards broken sockets in more cases before taking them from the pool (#1345).
- 6.4.1 fixes a regression from 6.4.0 where acquiring a connection from the pool spins actively (#1362). This is why the upgrade does not stop at 6.4.0.
- The other changes add features Infrahub does not use: Python 3.15 support, Bolt 6.1 with
uuid.UUIDvalues,pyarrow25 support, and a preview client for the HTTP Query API. From 6.3.0, SSL contexts created by the driver log TLS keys when theSSLKEYLOGFILEenvironment variable is set, as Python's ownssl.create_default_contextdoes.
Changes
neo4j6.2.0 → 6.4.1 andneo4j-rust-ext6.2.0.0 → 6.4.1.0 inpyproject.tomlanduv.lock. No other package changes inuv.lock, and no package is added or removed.backend/tests/component/conftest.py: theneo4j_factoryfixture imports the driver's private hydration classes to build fakeNodeandRelationshipobjects. 6.4.0 moved them fromneo4j._codec.hydration.v1toneo4j._codec.hydration.bolt.v1when it added the HTTP Query API. The import path is updated; the class names and method signatures are the same.AGENTS.md: the tech stack line now says driver 6.4.
No changelog fragment: Infrahub's own code and behaviour do not change.
The infrahub.database mypy override stays
The card asked to check whether the arg-type entry in the infrahub.database mypy override is still needed with 6.4.1. It is: without it, mypy reports 13 arg-type errors in backend/infrahub/database/__init__.py on this branch, including the **pool_connection_kwargs passed to AsyncGraphDatabase.driver().
Base branch
This PR targets stable, which pins the same driver version as develop. dev/guidelines/git-workflow.md sends bug fixes for released code to the oldest maintained branch that should ship them, and the change reaches develop through the stable→develop merge.
How this was verified
ty check .reported the moved hydration module (unresolved-importinbackend/tests/component/conftest.py) after the upgrade, and passes after the import fix.- Local checks pass: ruff, ty, mypy (
invoke backend.lint),uv lock --check, yamllint, generated-file and schema validation, the frontend lint trio, and 2776 backend unit tests. - Component tests against Neo4j (
--neo4j, testcontainers):backend/tests/component/core/test_query.py: 12 passed. These include the two tests that useneo4j_factory.backend/tests/component/coreandbackend/tests/component/databasewith 4 workers: 2508 passed, 0 failed, 21 skipped, 1 expected failure (test_diff_get_nodes_multiple_changes, marked xfail onstable).
uv run pytest --neo4j backend/tests/component/core/test_query.py
🤖 Generated with Claude Code