Skip to content

feat(scripts): report what is stopping each example from running - #599

Draft
williedoran-neo4j wants to merge 1 commit into
neo4j:willie/examples-requirement-modelfrom
williedoran-neo4j:willie/examples-setup-doctor
Draft

feat(scripts): report what is stopping each example from running#599
williedoran-neo4j wants to merge 1 commit into
neo4j:willie/examples-requirement-modelfrom
williedoran-neo4j:willie/examples-setup-doctor

Conversation

@williedoran-neo4j

@williedoran-neo4j williedoran-neo4j commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Second of the chain-B PRs. Stacked on #597 — the diff above contains it until it merges; this PR's own change is the final commit.

Adds scripts/check_setup.py: resolves every example against the requirement model, probes this machine, and reports the single first thing in the way of each one — grouped so the biggest wins surface first, and carrying the command that fixes it.

python scripts/check_setup.py            # what is missing
python scripts/check_setup.py --strict   # exit non-zero if anything is blocked

Writes nothing and needs no credentials of its own. Network use is limited to TCP connects, except that resolving Google credentials shells out to gcloud.

Four defects found while building it, fixed here

  1. A wrong NEO4J_PASSWORD produced a clean bill of health. service_available only opens a TCP socket, and the APOC and index checks both gate on authenticated — so all three silently passed while every Neo4j example failed at runtime. A reachable-but-unauthenticated database is now a blocker in its own right, which also gives Neo4jState.reachable and .error their first reader.
  2. The missing-index fix advised setup_examples.py --tier 0 — a flag that exists nowhere in the repo. Following it gets you unrecognized arguments. It now points at the example that creates the index.
  3. The Ollama check only ever suggested pulling the chat model, though the embedding examples need a different one, so nomic-embed-text was never mentioned. Both are reported now.
  4. Azure looked ready when it cannot be. It declares no env vars and had no probe, so the doctor reported nothing blocking it — but its endpoint and key are hardcoded placeholders in the example file. It now says so.

Each of the four is pinned by a test; the first was confirmed to fail against the code without the fix.

Type of Change

  • New feature
  • Bug fix
  • Breaking change
  • Documentation update
  • Project configuration change

Complexity

Complexity: Medium

How Has This Been Tested?

  • Unit tests
  • E2E tests
  • Manual tests

13 tests over blockers_for, driven through the four probe seams so nothing touches the network or a service. Run against this machine with Neo4j stopped and confirmed it reports blocked rather than passing.

Checklist

  • Documentation has been updated
  • Unit tests have been updated
  • E2E tests have been updated
  • Examples have been updated
  • New files have copyright header
  • CLA (https://neo4j.com/developer/cla/) has been signed
  • CHANGELOG.md updated if appropriate

🤖 Generated with Claude Code

@williedoran-neo4j
williedoran-neo4j force-pushed the willie/examples-setup-doctor branch 3 times, most recently from 077cec2 to 0d57cce Compare August 12, 2026 10:30
@williedoran-neo4j williedoran-neo4j changed the title feat(scripts): add a doctor and installer for the example environment feat(scripts): report what is stopping each example from running Aug 12, 2026
@williedoran-neo4j
williedoran-neo4j force-pushed the willie/examples-setup-doctor branch 4 times, most recently from 8db8353 to 7c18582 Compare August 13, 2026 09:06
Adds scripts/check_setup.py: resolves every example against the requirement
model, probes this machine, and reports the single first thing in the way of
each one, grouped so the biggest wins surface first and carrying the command
that fixes it. Writes nothing and needs no credentials of its own.

Four defects found while building it, fixed here:

- A wrong NEO4J_PASSWORD produced a clean bill of health. service_available only
  opens a TCP socket, and the APOC and index checks both gate on `authenticated`,
  so all three silently passed while every Neo4j example failed at runtime. A
  reachable-but-unauthenticated database is now a blocker in its own right.
- The missing-index fix advised `setup_examples.py --tier 0`, a flag that exists
  nowhere. It now points at the example that creates the index.
- The Ollama check only ever suggested pulling the chat model, though the
  embedding examples need a different one. Both are reported.
- The unset-key fix named a command this tool does not ship.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@williedoran-neo4j
williedoran-neo4j force-pushed the willie/examples-setup-doctor branch from 7c18582 to 1684979 Compare August 17, 2026 10:02
@williedoran-neo4j
williedoran-neo4j changed the base branch from main to willie/examples-requirement-model August 17, 2026 10:12
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