Verified Commit 14a3a63e authored by Michael Usachenko's avatar Michael Usachenko Committed by GitLab
Browse files

refactor(code-graph): reorganize into parent crate with sub-crates

parent 4ea5ca11
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -81,15 +81,16 @@ Single binary: `gkg-server` (4 modes: Webserver, Indexer, DispatchIndexing, Heal
| `query-engine/formatters` | Result formatters (graph, raw row, goon) |
| `indexer` | NATS consumer, SDLC + code + namespace deletion handler modules, worker pools, scheduler, `testkit/` |
| `ontology` | Loads/validates YAML ontology, query validation helpers |
| `code-parser` | Multi-language parser (7 langs), tree-sitter + swc, extracts definitions/imports/references |
| `code-graph` | Builds in-memory property graphs from parsed code |
| `code-graph` | Parent crate for code parsing and graph construction; re-exports `treesitter-visit`, `parser-core`, `code-graph-linker` |
| `code-graph/treesitter-visit` | Tree-sitter language bindings wrapper |
| `code-graph/parser` | Multi-language parser (7 langs), tree-sitter + swc, extracts definitions/imports/references |
| `code-graph/linker` | Builds in-memory property graphs from parsed code |
| `utils` | Shared ClickHouse parameter types (`ChScalar`, `ChType`) and Arrow extraction utilities |
| `clickhouse-client` | Async ClickHouse client, Arrow-IPC streaming, `QueryProfiler` for per-query stats |
| `query-engine/profiler` | Standalone CLI for profiling GKG queries directly against ClickHouse |
| `siphon-proto` | Protobuf types for CDC replication events |
| `labkit-rs` | Logging, correlation IDs, OpenTelemetry metrics |
| `health-check` | K8s readiness/liveness probes |
| `treesitter-visit` | Tree-sitter language bindings wrapper |
| `cli` | Local `orbit index` and `orbit query` commands |
| `gitlab-client` | GitLab REST/JWT client for Rails API calls |
| `integration-testkit` | Shared ClickHouse testcontainer helpers, `MockRedactionService`, and `ResponseView` assertion framework for integration tests |
+4 −3
Original line number Diff line number Diff line
@@ -81,15 +81,16 @@ Single binary: `gkg-server` (4 modes: Webserver, Indexer, DispatchIndexing, Heal
| `query-engine/formatters` | Result formatters (graph, raw row, goon) |
| `indexer` | NATS consumer, SDLC + code + namespace deletion handler modules, worker pools, scheduler, `testkit/` |
| `ontology` | Loads/validates YAML ontology, query validation helpers |
| `code-parser` | Multi-language parser (7 langs), tree-sitter + swc, extracts definitions/imports/references |
| `code-graph` | Builds in-memory property graphs from parsed code |
| `code-graph` | Parent crate for code parsing and graph construction; re-exports `treesitter-visit`, `parser-core`, `code-graph-linker` |
| `code-graph/treesitter-visit` | Tree-sitter language bindings wrapper |
| `code-graph/parser` | Multi-language parser (7 langs), tree-sitter + swc, extracts definitions/imports/references |
| `code-graph/linker` | Builds in-memory property graphs from parsed code |
| `utils` | Shared ClickHouse parameter types (`ChScalar`, `ChType`) and Arrow extraction utilities |
| `clickhouse-client` | Async ClickHouse client, Arrow-IPC streaming, `QueryProfiler` for per-query stats |
| `query-engine/profiler` | Standalone CLI for profiling GKG queries directly against ClickHouse |
| `siphon-proto` | Protobuf types for CDC replication events |
| `labkit-rs` | Logging, correlation IDs, OpenTelemetry metrics |
| `health-check` | K8s readiness/liveness probes |
| `treesitter-visit` | Tree-sitter language bindings wrapper |
| `cli` | Local `orbit index` and `orbit query` commands |
| `gitlab-client` | GitLab REST/JWT client for Rails API calls |
| `integration-testkit` | Shared ClickHouse testcontainer helpers, `MockRedactionService`, and `ResponseView` assertion framework for integration tests |
+9 −0
Original line number Diff line number Diff line
@@ -1209,6 +1209,15 @@ dependencies = [
[[package]]
name = "code-graph"
version = "0.1.0"
dependencies = [
 "code-graph-linker",
 "parser-core",
 "treesitter-visit",
]

[[package]]
name = "code-graph-linker"
version = "0.1.0"
dependencies = [
 "anyhow",
 "chrono",
+4 −3
Original line number Diff line number Diff line
@@ -4,9 +4,10 @@ version = "0.1.0"
[workspace]
resolver = "2"
members = [
  "crates/treesitter-visit",
  "crates/code-parser",
  "crates/code-graph",
  "crates/code-graph/treesitter-visit",
  "crates/code-graph/parser",
  "crates/code-graph/linker",
  "crates/clickhouse-client",
  "crates/indexer",
  "crates/query-engine",
@@ -84,7 +85,7 @@ criterion = { version = "0.8.1", features = ["html_reports"] }
tracing-test = "0.2.5"

# Parser-core
parser-core = { path = "crates/code-parser" }
parser-core = { path = "crates/code-graph/parser" }
clickhouse-client = { path = "crates/clickhouse-client" }
duckdb = { version = "1.10501.0", features = ["vtab-arrow", "appender-arrow"] }
gitalisk-core = { git = "https://gitlab.com/gitlab-org/rust/gitalisk.git", tag = "v0.7.0" }
+3 −3
Original line number Diff line number Diff line
@@ -2,8 +2,8 @@ mod workspace;

use anyhow::{Context, Result};
use clap::{Parser, Subcommand};
use code_graph::indexer::{IndexingConfig, RepositoryIndexer};
use code_graph::loading::DirectoryFileSource;
use code_graph::linker::indexer::{IndexingConfig, RepositoryIndexer, RepositoryIndexingResult};
use code_graph::linker::loading::DirectoryFileSource;
use ontology::Ontology;
use query_engine::compiler::SecurityContext;
use serde::Serialize;
@@ -220,7 +220,7 @@ async fn run_index(path: PathBuf, threads: usize, show_stats: bool) -> Result<()
fn build_index_output(
    repo_name: &str,
    path: &str,
    result: &code_graph::indexer::RepositoryIndexingResult,
    result: &RepositoryIndexingResult,
    show_stats: bool,
) -> IndexOutput {
    let (graph, rel_counts, def_counts) = match result.graph_data {
Loading