Skip to content

Add CI that checks the function writes to Neo4j - #4

Merged
HarshCasper merged 1 commit into
mainfrom
ci/assert-graph-write
Oct 13, 2026
Merged

HarshCasper merged 1 commit into
mainfrom
ci/assert-graph-write

Conversation

@HarshCasper

Copy link
Copy Markdown
Member

CI deployed the SAM app but never started Neo4j, never set the function's connection variables and never invoked the function, so it could not tell whether the sample works.

Test:

  • New test.sh (make test) invokes the function with event.json plus a unique marker and checks:
    • the invocation succeeds and returns the Lambda account usage (FunctionCount, TotalCodeSize)
    • Neo4j has exactly one LambdaEvent node holding that event, queried with cypher-shell

Sample fixes:

  • The Neo4j connection came from a manual update-function-configuration step after deploy. The template now sets NEO4J_URI, NEO4J_USERNAME and NEO4J_PASSWORD from parameters whose defaults match the compose setup, so make deploy produces a working function. The README shows --parameter-overrides for other databases.
  • The neo4j 4.3.5 driver speaks a Bolt version current Neo4j no longer accepts. Moved to the neo4j 5.28 driver (execute_write replaces write_transaction) and pinned the database image to neo4j:5.26 instead of latest.
  • Runtime python3.10 is past its deprecation date. Moved to python3.12, with jsonpickle 4.1 and aws-xray-sdk 2.15.
  • make start and make stop used docker-compose, which current runners and Docker installs no longer ship. They use docker compose, and make start waits until LocalStack and Neo4j are ready. Dropped the obsolete compose version key and LOCALSTACK_API_KEY.

Workflow:

  • Starts LocalStack and Neo4j with make start (Docker Compose, so the Lambda containers can resolve neo4j), then runs make deploy and make test, and prints the container logs on failure.
  • Python 3.12, Node 22, permissions: contents: read, 20 minute timeout.

Verified by CI.

https://claude.ai/code/session_01DZfDmzUBPqNAu3yFKyfCNM

CI deployed the SAM app but never started Neo4j or invoked the function. Start both with Docker Compose, set the Neo4j connection through template parameters, and test that an invocation stores the event as a LambdaEvent node. Move to python3.12 and the neo4j 5 driver, since the 4.3 driver cannot talk to current Neo4j.

Claude-Session: https://claude.ai/code/session_01DZfDmzUBPqNAu3yFKyfCNM
@HarshCasper
HarshCasper merged commit 3464078 into main Oct 13, 2026
1 check passed
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