Three review findings on the Mem0 n8n node: - Memory IDs and event IDs were interpolated raw into request paths, so a value containing / or .. could reach a different endpoint than intended. Wrap all four sites in encodeURIComponent. - Search and Get Many could only filter by user_id, leaving agent- and run-scoped memories unreachable from the node. Both now accept User ID, Agent ID, and Run ID. Multiple ids combine with OR because Mem0 indexes entities separately and an AND across them matches nothing. User ID is no longer marked required; the node still fails with a clear message when all three are empty, rather than letting the API return a raw 400. - n8n-nodes-mem0-checks.yml ran lint and build but never the jest suite, so the tests could rot unnoticed. Add a test job matching the layout of pi-agent-plugin-checks.yml. Tests cover flat single-entity filters, the OR combination, agent-only listing, the empty-entity guard on both operations, and id escaping in the get/delete/poll URLs. Docs and README document the new fields and the OR semantics.
89 lines
2.6 KiB
YAML
89 lines
2.6 KiB
YAML
name: n8n-nodes-mem0 checks
|
|
|
|
# On PRs this is invoked by ci-gate.yml (the single required check);
|
|
# push-to-main and manual runs remain standalone.
|
|
on:
|
|
workflow_dispatch:
|
|
push:
|
|
branches: [main]
|
|
paths:
|
|
- 'integrations/n8n-nodes-mem0/**'
|
|
- '.github/workflows/n8n-nodes-mem0-checks.yml'
|
|
workflow_call:
|
|
|
|
jobs:
|
|
lint:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Install pnpm
|
|
uses: pnpm/action-setup@v4
|
|
with:
|
|
version: 9
|
|
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: 20
|
|
cache: 'pnpm'
|
|
cache-dependency-path: integrations/n8n-nodes-mem0/pnpm-lock.yaml
|
|
|
|
- name: Install dependencies
|
|
run: cd integrations/n8n-nodes-mem0 && pnpm install --frozen-lockfile --ignore-scripts
|
|
|
|
- name: Lint
|
|
run: cd integrations/n8n-nodes-mem0 && pnpm run lint
|
|
|
|
test:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Install pnpm
|
|
uses: pnpm/action-setup@v4
|
|
with:
|
|
version: 9
|
|
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: 20
|
|
cache: 'pnpm'
|
|
cache-dependency-path: integrations/n8n-nodes-mem0/pnpm-lock.yaml
|
|
|
|
- name: Install dependencies
|
|
run: cd integrations/n8n-nodes-mem0 && pnpm install --frozen-lockfile --ignore-scripts
|
|
|
|
- name: Run tests
|
|
run: cd integrations/n8n-nodes-mem0 && pnpm test
|
|
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Install pnpm
|
|
uses: pnpm/action-setup@v4
|
|
with:
|
|
version: 9
|
|
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: 20
|
|
cache: 'pnpm'
|
|
cache-dependency-path: integrations/n8n-nodes-mem0/pnpm-lock.yaml
|
|
|
|
- name: Install dependencies
|
|
run: cd integrations/n8n-nodes-mem0 && pnpm install --frozen-lockfile --ignore-scripts
|
|
|
|
- name: Build
|
|
run: cd integrations/n8n-nodes-mem0 && pnpm run build
|
|
|
|
- name: Verify dist output exists
|
|
run: |
|
|
test -f integrations/n8n-nodes-mem0/dist/nodes/Mem0/Mem0.node.js || (echo "Build output missing: dist/nodes/Mem0/Mem0.node.js" && exit 1)
|
|
test -f integrations/n8n-nodes-mem0/dist/credentials/Mem0Api.credentials.js || (echo "Build output missing: dist/credentials/Mem0Api.credentials.js" && exit 1)
|
|
test -f integrations/n8n-nodes-mem0/dist/nodes/Mem0/mem0.svg || (echo "Build output missing: dist/nodes/Mem0/mem0.svg" && exit 1)
|