Skip to content

Commit 929d831

Browse files
Caik PigossoCaik Pigosso
authored andcommitted
fix(setup): enable GraphRAG automatically when selected in wizard
- Fix GraphRAG not being enabled when toggle is selected in Setup Wizard - Add enable_graph_for_collection call after indexing when enable_graph=true - Return graph_enabled status in collection response - Fix collapsible_else_if clippy warning in vectorizer-cli.rs - Add #[allow(dead_code)] for unused init_tracing in metal tests - Fix file_watcher using temp path in metadata (use original path) - Add enable graph endpoint for existing collections - Update GraphPage to show enable button when graph not enabled - Standardize wizard UI to neutral color theme - Remove dark mode toggle (single theme system) Closes: GraphRAG activation issue in Setup Wizard
1 parent a87a7b4 commit 929d831

25 files changed

Lines changed: 5042 additions & 4501 deletions

.github/workflows/release-artifacts.yml

Lines changed: 64 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,42 @@ on:
77
types: [published]
88

99
jobs:
10+
# Build dashboard first - shared by all jobs
11+
build-dashboard:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v6
15+
- name: Setup Node.js
16+
uses: actions/setup-node@v4
17+
with:
18+
node-version: '20'
19+
- name: Install pnpm
20+
run: npm install -g pnpm
21+
- name: Build dashboard
22+
run: |
23+
cd dashboard
24+
pnpm install --frozen-lockfile
25+
pnpm build
26+
- name: Upload dashboard artifacts
27+
uses: actions/upload-artifact@v4
28+
with:
29+
name: dashboard-dist
30+
path: dashboard/dist
31+
retention-days: 1
32+
1033
# Separated Linux builds - each runs independently
1134
# If one fails, others continue
1235

1336
build-linux-x86_64-gnu:
37+
needs: build-dashboard
1438
runs-on: ubuntu-latest
1539
steps:
1640
- uses: actions/checkout@v6
41+
- name: Download dashboard artifacts
42+
uses: actions/download-artifact@v4
43+
with:
44+
name: dashboard-dist
45+
path: dashboard/dist
1746
- name: Install dependencies
1847
run: |
1948
sudo apt-get update
@@ -34,9 +63,15 @@ jobs:
3463
token: ${{ secrets.GITHUB_TOKEN }}
3564

3665
build-linux-x86_64-musl:
66+
needs: build-dashboard
3767
runs-on: ubuntu-latest
3868
steps:
3969
- uses: actions/checkout@v6
70+
- name: Download dashboard artifacts
71+
uses: actions/download-artifact@v4
72+
with:
73+
name: dashboard-dist
74+
path: dashboard/dist
4075
- name: Install dependencies
4176
run: |
4277
sudo apt-get update
@@ -48,7 +83,7 @@ jobs:
4883
run: cargo install cross --git https://github.com/cross-rs/cross
4984
- name: Build musl binaries with cross
5085
run: |
51-
cross build --release --target x86_64-unknown-linux-musl --no-default-features
86+
cross build --release --target x86_64-unknown-linux-musl --no-default-features --features vendored-openssl
5287
mkdir -p dist
5388
cp target/x86_64-unknown-linux-musl/release/vectorizer dist/vectorizer-x86_64-unknown-linux-musl
5489
cp target/x86_64-unknown-linux-musl/release/vectorizer-cli dist/vectorizer-cli-x86_64-unknown-linux-musl
@@ -63,7 +98,7 @@ jobs:
6398
- name: Build Debian Package
6499
run: |
65100
cargo install cargo-deb
66-
cross build --release --target x86_64-unknown-linux-musl --no-default-features
101+
cross build --release --target x86_64-unknown-linux-musl --no-default-features --features vendored-openssl
67102
cargo deb --no-build --no-strip --target x86_64-unknown-linux-musl
68103
- name: Upload Debian package
69104
uses: svenstaro/upload-release-action@v2
@@ -75,9 +110,15 @@ jobs:
75110
file_glob: true
76111

77112
build-linux-aarch64-musl:
113+
needs: build-dashboard
78114
runs-on: ubuntu-latest
79115
steps:
80116
- uses: actions/checkout@v6
117+
- name: Download dashboard artifacts
118+
uses: actions/download-artifact@v4
119+
with:
120+
name: dashboard-dist
121+
path: dashboard/dist
81122
- name: Install dependencies
82123
run: |
83124
sudo apt-get update
@@ -89,7 +130,7 @@ jobs:
89130
run: cargo install cross --git https://github.com/cross-rs/cross
90131
- name: Build musl binaries with cross
91132
run: |
92-
cross build --release --target aarch64-unknown-linux-musl --no-default-features
133+
cross build --release --target aarch64-unknown-linux-musl --no-default-features --features vendored-openssl
93134
mkdir -p dist
94135
cp target/aarch64-unknown-linux-musl/release/vectorizer dist/vectorizer-aarch64-unknown-linux-musl
95136
cp target/aarch64-unknown-linux-musl/release/vectorizer-cli dist/vectorizer-cli-aarch64-unknown-linux-musl
@@ -103,6 +144,7 @@ jobs:
103144
file_glob: true
104145

105146
build-mac-binaries:
147+
needs: build-dashboard
106148
strategy:
107149
matrix:
108150
include:
@@ -112,6 +154,12 @@ jobs:
112154
os: macos-latest
113155
runs-on: ${{ matrix.os }}
114156
steps:
157+
- uses: actions/checkout@v6
158+
- name: Download dashboard artifacts
159+
uses: actions/download-artifact@v4
160+
with:
161+
name: dashboard-dist
162+
path: dashboard/dist
115163
- name: Install dependencies
116164
run: |
117165
brew update-reset
@@ -120,7 +168,6 @@ jobs:
120168
rustup update
121169
rustup show
122170
cargo -Vv
123-
- uses: actions/checkout@v6
124171
- name: Build and publish vectorizer
125172
uses: taiki-e/upload-rust-binary-action@v1
126173
with:
@@ -135,6 +182,7 @@ jobs:
135182
token: ${{ secrets.GITHUB_TOKEN }}
136183

137184
build-mac-metal-binaries:
185+
needs: build-dashboard
138186
name: Build macOS ARM with Metal GPU support
139187
strategy:
140188
matrix:
@@ -143,6 +191,12 @@ jobs:
143191
os: macos-latest
144192
runs-on: ${{ matrix.os }}
145193
steps:
194+
- uses: actions/checkout@v6
195+
- name: Download dashboard artifacts
196+
uses: actions/download-artifact@v4
197+
with:
198+
name: dashboard-dist
199+
path: dashboard/dist
146200
- name: Install dependencies
147201
run: |
148202
brew update-reset
@@ -152,7 +206,6 @@ jobs:
152206
rustup target add ${{ matrix.target }}
153207
rustup show
154208
cargo -Vv
155-
- uses: actions/checkout@v6
156209
- name: Build vectorizer with Metal support
157210
uses: taiki-e/upload-rust-binary-action@v1
158211
with:
@@ -171,6 +224,7 @@ jobs:
171224
token: ${{ secrets.GITHUB_TOKEN }}
172225

173226
build-windows-binaries:
227+
needs: build-dashboard
174228
strategy:
175229
matrix:
176230
include:
@@ -180,6 +234,11 @@ jobs:
180234
- name: Install minimal stable
181235
uses: dtolnay/rust-toolchain@stable
182236
- uses: actions/checkout@v6
237+
- name: Download dashboard artifacts
238+
uses: actions/download-artifact@v4
239+
with:
240+
name: dashboard-dist
241+
path: dashboard/dist
183242
- uses: Swatinem/rust-cache@v2
184243
- name: Install protoc
185244
shell: pwsh
@@ -197,42 +256,3 @@ jobs:
197256
with:
198257
bin: vectorizer-cli
199258
token: ${{ secrets.GITHUB_TOKEN }}
200-
201-
# Temporarily disabled - MSI build has issues
202-
# build-windows-msi:
203-
# strategy:
204-
# matrix:
205-
# include:
206-
# - os: windows-latest
207-
# runs-on: ${{ matrix.os }}
208-
# steps:
209-
# - name: Install minimal stable
210-
# uses: dtolnay/rust-toolchain@stable
211-
# - uses: actions/checkout@v5
212-
# - uses: Swatinem/rust-cache@v2
213-
#
214-
# - name: Build release binaries
215-
# run: cargo build --release
216-
#
217-
# - name: Install WiX Toolset
218-
# run: |
219-
# dotnet tool install --global wix --version 5.0.2
220-
# wix extension add -g WixToolset.UI.wixext
221-
# wix extension list
222-
# wix --version
223-
#
224-
# - name: Build MSI installer
225-
# shell: pwsh
226-
# env:
227-
# CargoTargetBinDir: ${{ github.workspace }}\target\release
228-
# run: |
229-
# wix build -arch x64 -ext WixToolset.UI.wixext wix\main.wxs -o vectorizer.msi
230-
#
231-
# - name: Upload MSI
232-
# uses: svenstaro/upload-release-action@v2
233-
# with:
234-
# repo_token: ${{ secrets.GITHUB_TOKEN }}
235-
# file: vectorizer.msi
236-
# asset_name: vectorizer-x86_64.msi
237-
# tag: ${{ github.ref }}
238-
# overwrite: true

.github/workflows/rust-lint.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,17 @@ jobs:
3030
run: sudo apt-get update
3131
- name: Install dependencies
3232
run: sudo apt-get install -y clang protobuf-compiler
33+
- name: Setup Node.js for dashboard build
34+
uses: actions/setup-node@v4
35+
with:
36+
node-version: '20'
37+
- name: Install pnpm
38+
run: npm install -g pnpm
39+
- name: Build dashboard (required for rust-embed)
40+
run: |
41+
cd dashboard
42+
pnpm install --frozen-lockfile
43+
pnpm build
3344
- name: Check code formatting
3445
run: cargo +nightly fmt --all -- --check
3546
- name: Check cargo clippy warnings

.github/workflows/rust.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,18 @@ jobs:
4848
shell: bash
4949
- name: Install nextest
5050
uses: taiki-e/install-action@nextest
51+
- name: Setup Node.js for dashboard build
52+
uses: actions/setup-node@v4
53+
with:
54+
node-version: '20'
55+
- name: Install pnpm
56+
run: npm install -g pnpm
57+
- name: Build dashboard (required for rust-embed)
58+
run: |
59+
cd dashboard
60+
pnpm install --frozen-lockfile
61+
pnpm build
62+
shell: bash
5163
- name: Build
5264
run: cargo build --tests --workspace
5365
env:

Cargo.lock

Lines changed: 11 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,9 @@ unicode-normalization = { version = "0.1", default-features = false }
100100
# Note: regex is expensive - consider using simpler string matching where possible
101101
regex = { version = "1.10", default-features = false, features = ["std", "unicode-perl"] }
102102

103+
# OpenSSL vendored for musl cross-compilation (hf-hub uses native-tls)
104+
openssl = { version = "0.10", features = ["vendored"], optional = true }
105+
103106
# Authentication and security
104107
jsonwebtoken = { version = "10.1", features = ["rust_crypto"] }
105108
uuid = { version = "1.19", features = ["v4", "serde"] }
@@ -299,6 +302,9 @@ path = "scripts/test_routes.rs"
299302
default = ["hive-gpu", "fastembed"]
300303
fastembed = ["dep:fastembed"]
301304

305+
# OpenSSL vendored for musl cross-compilation
306+
vendored-openssl = ["dep:openssl"]
307+
302308
# GPU acceleration via external hive-gpu crate only (Metal-only currently)
303309
# Future: CUDA, ROCm, WebGPU support when hive-gpu implements them
304310
hive-gpu = ["dep:hive-gpu"]

dashboard/src/hooks/useGraph.ts

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,20 @@ export interface DiscoveryStatusResponse {
7878
discovery_progress?: number;
7979
}
8080

81+
export interface EnableGraphResponse {
82+
success: boolean;
83+
collection: string;
84+
message: string;
85+
node_count: number;
86+
}
87+
88+
export interface GraphStatusResponse {
89+
collection: string;
90+
enabled: boolean;
91+
node_count: number;
92+
edge_count: number;
93+
}
94+
8195
/**
8296
* Hook for graph operations
8397
*/
@@ -349,6 +363,47 @@ export function useGraph() {
349363
[apiClient]
350364
);
351365

366+
/**
367+
* Enable graph for a collection
368+
*/
369+
const enableGraph = useCallback(
370+
async (collection: string): Promise<EnableGraphResponse> => {
371+
try {
372+
const response = await apiClient.post<EnableGraphResponse>(
373+
`/graph/enable/${encodeURIComponent(collection)}`,
374+
{}
375+
);
376+
return response;
377+
} catch (error) {
378+
if (error instanceof ApiClientError) {
379+
throw new Error(`Failed to enable graph: ${error.message}`);
380+
}
381+
throw error;
382+
}
383+
},
384+
[apiClient]
385+
);
386+
387+
/**
388+
* Get graph status for a collection
389+
*/
390+
const getGraphStatus = useCallback(
391+
async (collection: string): Promise<GraphStatusResponse> => {
392+
try {
393+
const response = await apiClient.get<GraphStatusResponse>(
394+
`/graph/status/${encodeURIComponent(collection)}`
395+
);
396+
return response;
397+
} catch (error) {
398+
if (error instanceof ApiClientError) {
399+
throw new Error(`Failed to get graph status: ${error.message}`);
400+
}
401+
throw error;
402+
}
403+
},
404+
[apiClient]
405+
);
406+
352407
return {
353408
listNodes,
354409
listEdges,
@@ -360,6 +415,8 @@ export function useGraph() {
360415
discoverEdges,
361416
discoverEdgesForNode,
362417
getDiscoveryStatus,
418+
enableGraph,
419+
getGraphStatus,
363420
};
364421
}
365422

0 commit comments

Comments
 (0)