Graph files adjustments#8
Merged
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates Link’s on-disk graph storage defaults to use a hidden data directory (.data/graph) and aligns configuration, docs, and container defaults with the new layout. It also removes the checked-in example graph schema JSON files (relying on runtime bootstrap) and adjusts MCP tooling to avoid empty input schemas.
Changes:
- Switch default graph location to
./.data/graphand replaceLINK_GRAPH_PATH/GRAPH_PATHwithLINK_DATA_DIR. - Update Docker/README to use the new data directory conventions.
- Remove committed example node/edge type JSON files and add/extend tests to cover CRUD and MCP HTTP lifecycle.
Reviewed changes
Copilot reviewed 28 out of 28 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/server/config.ts | Default graph path now derived from LINK_DATA_DIR (defaults to ./.data) and uses <dataDir>/graph. |
| src/server/config.test.ts | Updates config tests for the new default path and env var. |
| src/mcp/server.ts | Replaces empty get_graph input schema with a compatibility placeholder field. |
| src/index.ts | --validate now validates config.graphPath only (CLI --graph-path override removed). |
| src/api/http.test.ts | Adds broader HTTP CRUD coverage and MCP HTTP lifecycle test via SDK client. |
| README.md | Documents .data/graph default, LINK_DATA_DIR, and updated local/docker commands. |
| Dockerfile | Sets LINK_DATA_DIR=/data and creates /data in the image. |
| data/graph/node-types/technology.json | Removed example node type file. |
| data/graph/node-types/team.json | Removed example node type file. |
| data/graph/node-types/project.json | Removed example node type file. |
| data/graph/node-types/product.json | Removed example node type file. |
| data/graph/node-types/product-group.json | Removed example node type file. |
| data/graph/node-types/person.json | Removed example node type file. |
| data/graph/node-types/other.json | Removed example node type file. |
| data/graph/node-types/org.json | Removed example node type file. |
| data/graph/node-types/issue.json | Removed example node type file. |
| data/graph/node-types/info.json | Removed example node type file. |
| data/graph/node-types/customer.json | Removed example node type file. |
| data/graph/node-types/aka.json | Removed example node type file. |
| data/graph/edge-types/works-on.json | Removed example edge type file. |
| data/graph/edge-types/status-for.json | Removed example edge type file. |
| data/graph/edge-types/related-to.json | Removed example edge type file. |
| data/graph/edge-types/owns.json | Removed example edge type file. |
| data/graph/edge-types/member-of.json | Removed example edge type file. |
| data/graph/edge-types/knows-about.json | Removed example edge type file. |
| data/graph/edge-types/depends-on.json | Removed example edge type file. |
| data/graph/edge-types/alias-of.json | Removed example edge type file. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
7
to
+11
| if (Bun.argv.includes("--validate")) { | ||
| const config = loadConfig(); | ||
| const graphPath = argValue("--graph-path") ?? config.graphPath; | ||
| try { | ||
| validateGraphPath(graphPath); | ||
| console.log(`Graph data is valid: ${graphPath}`); | ||
| validateGraphPath(config.graphPath); | ||
| console.log(`Graph data is valid: ${config.graphPath}`); |
Comment on lines
55
to
+59
| 1. `git pull`. | ||
| 2. Run Link locally and edit through the UI, HTTP API, or MCP tools. | ||
| 3. Inspect JSON changes under `data/graph`. | ||
| 4. `bun src/index.ts --validate --graph-path ./data/graph`. | ||
| 5. `git add data/graph && git commit`. | ||
| 3. Inspect JSON changes under `.data/graph`. | ||
| 4. `bun src/index.ts --validate`. | ||
| 5. `git add .data/graph && git commit`. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces a significant update to how graph data is stored and referenced, shifting from a
data/graphdirectory to a hidden.data/graphdirectory. It also updates related documentation and environment variables to reflect this change. Additionally, it removes all example node and edge type JSON files from the repository, which likely signals a move to dynamic or user-defined schemas.Key changes:
Data Directory Structure and Environment Variables
data/graphto.data/graphthroughout the codebase and documentation, making the data storage location hidden by default. Updated the relevant environment variable fromLINK_GRAPH_PATHtoLINK_DATA_DIRand adjusted the Dockerfile and Docker instructions accordingly. [1] [2] [3] [4] [5]Removal of Example Node and Edge Type Schemas
person.json,project.json) and edge types (e.g.,owns.json,depends-on.json) fromdata/graph/node-types/anddata/graph/edge-types/, indicating a move away from hardcoded example schemas. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14] [15] [16] [17] [18] [19]Documentation Updates
README.mdto reflect the new data directory (.data/graph), environment variable (LINK_DATA_DIR), and adjusted all usage and example commands accordingly for both local and Docker usage. [1] [2] [3] [4]