From 3b73da8025fc911d3ea64a398b8dd8efe82c21f3 Mon Sep 17 00:00:00 2001 From: Vineeth Wilson Date: Sat, 7 Mar 2026 17:27:43 +0530 Subject: [PATCH 1/4] fix(ci): address CodeRabbit review comments on qdrant health-check - Pin qdrant image from 'latest' to 'v1.17.0' for reproducibility - Upgrade health-check from bare TCP to HTTP /healthz probe via bash TCP so the job waits for Qdrant to be fully serving, not just port-open - Replace deprecated codecov/test-results-action@v1 with codecov/codecov-action@v5 using report_type: test_results - Guard integration test step: skip gracefully when no test_*.py files exist yet (avoids pytest exit code 4 on empty directory) --- .github/workflows/ci.yml | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 391eeb5..4735094 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -77,9 +77,11 @@ jobs: - name: Upload test results to Codecov if: ${{ !cancelled() && matrix.python-version == '3.11' }} - uses: codecov/test-results-action@v1 + uses: codecov/codecov-action@v5 with: token: ${{ secrets.CODECOV_TOKEN }} + files: ./junit.xml + report_type: test_results # ────────────────────────────────────────────────────────────────────────── # Integration tests (spins up Neo4j + Qdrant in Docker) @@ -103,11 +105,11 @@ jobs: --health-retries 10 qdrant: - image: qdrant/qdrant:latest + image: qdrant/qdrant:v1.17.0 ports: - 6333:6333 options: >- - --health-cmd "bash -c ':> /dev/tcp/localhost/6333'" + --health-cmd "bash -ec 'exec 3<>/dev/tcp/127.0.0.1/6333 && printf \"GET /healthz HTTP/1.1\\r\\nHost: 127.0.0.1\\r\\nConnection: close\\r\\n\\r\\n\" >&3 && read -r status <&3 && [[ $status == *\" 200 \"* ]]'" --health-interval 10s --health-timeout 5s --health-retries 10 @@ -132,4 +134,9 @@ jobs: NEO4J_PASSWORD: codemind123 QDRANT_HOST: localhost QDRANT_PORT: 6333 - run: pytest tests/integration/ -m integration -v + run: | + if find tests/integration -name 'test_*.py' 2>/dev/null | grep -q .; then + python -m pytest tests/integration/ -m integration -v + else + echo "No integration tests found — skipping." + fi From 0f4cc6ec7b3bc9e6c1ba840ba16424f9ef9f5d0d Mon Sep 17 00:00:00 2001 From: Vineeth Wilson Date: Sat, 7 Mar 2026 17:32:11 +0530 Subject: [PATCH 2/4] docs(contributing): add Git branch discipline rules to copilot instructions --- .github/copilot-instructions.md | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md index be3b05c..b8150fa 100644 --- a/.github/copilot-instructions.md +++ b/.github/copilot-instructions.md @@ -61,6 +61,32 @@ python -m cli chat Run tests: `pytest tests/unit/` (unit, no Docker) · `pytest tests/integration/` (needs Docker) +## Git Workflow — Branch Discipline + +**`master` is protected. Every change — no matter how small — must go through a PR.** + +### Rules for all commits (AI agent and human alike) +1. **Always create a feature branch first** before making any file edits or commits: + ```bash + git checkout master && git pull + git checkout -b / + ``` +2. **Never commit directly to `master`**. Pushing to `master` is blocked by branch protection and will be rejected. +3. **Before committing**, verify the active branch is not `master`: + ```bash + git branch --show-current # must NOT print "master" + ``` +4. **Branch naming convention**: `/` + - `feat/` — new feature + - `fix/` — bug or CI fix + - `chore/` — housekeeping (deps, config, docs) + - `test/` — adding or fixing tests +5. **One logical change per PR** — keep diffs focused and reviewable. +6. After a PR is merged, **always sync local master** before starting the next branch: + ```bash + git checkout master && git reset --hard origin/master + ``` + ## Module Conventions ### `core/config.py` From d3f9992ff8ff7003ca2846583e28748d6d834122 Mon Sep 17 00:00:00 2001 From: Vineeth Wilson Date: Sat, 7 Mar 2026 20:25:02 +0530 Subject: [PATCH 3/4] fix(ci): address CodeRabbit critical review - drop qdrant health-cmd, add runner-side wait step qdrant/qdrant:v1.17.0 (debian:bookworm-slim) ships no curl, wget, or nc, and Debian's bash does not compile with --enable-net-redirections so /dev/tcp is also unavailable. Any --health-cmd inside the container fails. Fix: remove --health-cmd from the qdrant service block entirely and add a 'Wait for services' step in the job where the ubuntu-latest runner's own curl polls http://localhost:6333/healthz until Qdrant is fully up. Neo4j health-check is unaffected (cypher-shell is in that image). Also add 'git fetch origin' before reset in copilot-instructions as requested by CodeRabbit. --- .github/copilot-instructions.md | 1 + .github/workflows/ci.yml | 18 +++++++++++++----- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md index b8150fa..41b5211 100644 --- a/.github/copilot-instructions.md +++ b/.github/copilot-instructions.md @@ -84,6 +84,7 @@ Run tests: `pytest tests/unit/` (unit, no Docker) · `pytest tests/integration/` 5. **One logical change per PR** — keep diffs focused and reviewable. 6. After a PR is merged, **always sync local master** before starting the next branch: ```bash + git fetch origin git checkout master && git reset --hard origin/master ``` diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4735094..a0db25e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -108,11 +108,6 @@ jobs: image: qdrant/qdrant:v1.17.0 ports: - 6333:6333 - options: >- - --health-cmd "bash -ec 'exec 3<>/dev/tcp/127.0.0.1/6333 && printf \"GET /healthz HTTP/1.1\\r\\nHost: 127.0.0.1\\r\\nConnection: close\\r\\n\\r\\n\" >&3 && read -r status <&3 && [[ $status == *\" 200 \"* ]]'" - --health-interval 10s - --health-timeout 5s - --health-retries 10 steps: - uses: actions/checkout@v6 @@ -127,6 +122,19 @@ jobs: pip install -r requirements.txt pip install -e . + - name: Wait for services + run: | + echo "Waiting for Neo4j..." + for i in $(seq 1 30); do + cypher-shell -u neo4j -p codemind123 'RETURN 1' 2>/dev/null && break + sleep 2 + done + echo "Waiting for Qdrant..." + for i in $(seq 1 30); do + curl -sf http://localhost:6333/healthz && break + sleep 2 + done + - name: Run integration tests env: NEO4J_URI: bolt://localhost:7687 From ef8b3dede7f72620f4cc939b76d5d32ad943e5eb Mon Sep 17 00:00:00 2001 From: Vineeth Wilson Date: Sat, 7 Mar 2026 20:30:47 +0530 Subject: [PATCH 4/4] fix(ci): replace cypher-shell with bash /dev/tcp check for Neo4j readiness MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit cypher-shell is not installed on ubuntu-latest runners so the wait step was failing immediately. Use bash built-in /dev/tcp to probe the bolt port (7687) instead — works on ubuntu-latest without any external tools. Also add explicit failure exits for both Neo4j and Qdrant if they do not become ready within 60 s, surfacing the real cause instead of continuing silently into a broken integration run. --- .github/workflows/ci.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a0db25e..cbe26ca 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -126,14 +126,16 @@ jobs: run: | echo "Waiting for Neo4j..." for i in $(seq 1 30); do - cypher-shell -u neo4j -p codemind123 'RETURN 1' 2>/dev/null && break + (timeout 1 bash -c 'cat < /dev/null > /dev/tcp/localhost/7687' 2>/dev/null) && break sleep 2 done + (timeout 1 bash -c 'cat < /dev/null > /dev/tcp/localhost/7687' 2>/dev/null) || { echo "Neo4j failed to start"; exit 1; } echo "Waiting for Qdrant..." for i in $(seq 1 30); do curl -sf http://localhost:6333/healthz && break sleep 2 done + curl -sf http://localhost:6333/healthz || { echo "Qdrant failed to start"; exit 1; } - name: Run integration tests env: