Skip to content

Commit e52fc81

Browse files
gcgoncalvescrivetimihai
authored andcommitted
fix: Add build js command to makefile serve commands (#4035)
* fix: Add build js command to makefile serve commands Signed-off-by: Gabriel Costa <gabrielcg@proton.me> Signed-off-by: Mihai Criveti <crivetimihai@gmail.com> * fix: add js-build dep to dev-echo, update secrets baseline Add js-build as a prerequisite for dev-echo for consistency with all other serve/dev targets. Update .secrets.baseline line numbers. Signed-off-by: Mihai Criveti <crivetimihai@gmail.com> * fix: make js-build graceful when npm is not available Guard the js-build target so it warns instead of failing when npm is not installed. This prevents serve/dev targets from breaking in environments without Node.js — the API server still starts, only the admin UI bundle is skipped. Also adds --no-audit --no-fund to suppress noisy npm output during server startup. Signed-off-by: Mihai Criveti <crivetimihai@gmail.com> --------- Signed-off-by: Gabriel Costa <gabrielcg@proton.me> Signed-off-by: Mihai Criveti <crivetimihai@gmail.com> Co-authored-by: Mihai Criveti <crivetimihai@gmail.com>
1 parent d8cca00 commit e52fc81

2 files changed

Lines changed: 30 additions & 21 deletions

File tree

.secrets.baseline

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"files": "package-lock.json|Cargo.lock|^.secrets.baseline$|scripts/sign_image.sh|scripts/zap|sonar-project.properties|^/Users/brian/dev/github.ibm.com/contextforge-org/sps-pipeline-config/.secrets.baseline$|^./.secrets.baseline$",
44
"lines": null
55
},
6-
"generated_at": "2026-04-05T09:07:27Z",
6+
"generated_at": "2026-04-05T22:25:30Z",
77
"plugins_used": [
88
{
99
"name": "AWSKeyDetector"
@@ -344,79 +344,79 @@
344344
"hashed_secret": "844c398e469ef3fb919da3778944365ab2175fb7",
345345
"is_secret": false,
346346
"is_verified": false,
347-
"line_number": 368,
347+
"line_number": 374,
348348
"type": "Secret Keyword",
349349
"verified_result": null
350350
},
351351
{
352352
"hashed_secret": "319037749ce37e577db0b3628c7f90e333544391",
353353
"is_secret": false,
354354
"is_verified": false,
355-
"line_number": 792,
355+
"line_number": 798,
356356
"type": "Secret Keyword",
357357
"verified_result": null
358358
},
359359
{
360360
"hashed_secret": "6ae2832e494d1098e8901fe156083e39399a24f1",
361361
"is_secret": false,
362362
"is_verified": false,
363-
"line_number": 794,
363+
"line_number": 800,
364364
"type": "Secret Keyword",
365365
"verified_result": null
366366
},
367367
{
368368
"hashed_secret": "43fc45734b96bcb1b6cef373e949eb3524ae199b",
369369
"is_secret": false,
370370
"is_verified": false,
371-
"line_number": 1485,
371+
"line_number": 1491,
372372
"type": "Secret Keyword",
373373
"verified_result": null
374374
},
375375
{
376376
"hashed_secret": "9d989e8d27dc9e0ec3389fc855f142c3d40f0c50",
377377
"is_secret": false,
378378
"is_verified": false,
379-
"line_number": 1695,
379+
"line_number": 1701,
380380
"type": "Secret Keyword",
381381
"verified_result": null
382382
},
383383
{
384384
"hashed_secret": "d3ac7a4ef1a838b4134f2f6e7f3c0d249d74b674",
385385
"is_secret": false,
386386
"is_verified": false,
387-
"line_number": 6075,
387+
"line_number": 6081,
388388
"type": "Secret Keyword",
389389
"verified_result": null
390390
},
391391
{
392392
"hashed_secret": "5932862bcd24dd27d0dc0407ec94fe9d6ea24aeb",
393393
"is_secret": false,
394394
"is_verified": false,
395-
"line_number": 6572,
395+
"line_number": 6578,
396396
"type": "Secret Keyword",
397397
"verified_result": null
398398
},
399399
{
400400
"hashed_secret": "c77c805e32f173e4321ee9187de9c29cb3804513",
401401
"is_secret": false,
402402
"is_verified": false,
403-
"line_number": 6584,
403+
"line_number": 6590,
404404
"type": "Secret Keyword",
405405
"verified_result": null
406406
},
407407
{
408408
"hashed_secret": "8fe3df8a68ddd0d4ab2214186cbb8e38ccd0e06a",
409409
"is_secret": false,
410410
"is_verified": false,
411-
"line_number": 6656,
411+
"line_number": 6662,
412412
"type": "Secret Keyword",
413413
"verified_result": null
414414
},
415415
{
416416
"hashed_secret": "93ac8946882128457cd9e283b30ca851945e6690",
417417
"is_secret": false,
418418
"is_verified": false,
419-
"line_number": 7759,
419+
"line_number": 7765,
420420
"type": "Secret Keyword",
421421
"verified_result": null
422422
}

Makefile

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -255,36 +255,45 @@ check-env-dev:
255255
# help: run - Execute helper script ./run.sh
256256

257257
.PHONY: serve serve-ssl serve-granian serve-granian-ssl serve-granian-http2 dev dev-remote stop stop-dev stop-serve run \
258-
certs certs-jwt certs-jwt-ecdsa certs-all certs-mcp-ca certs-mcp-gateway certs-mcp-plugin certs-mcp-all certs-mcp-check
258+
certs certs-jwt certs-jwt-ecdsa certs-all certs-mcp-ca certs-mcp-gateway certs-mcp-plugin certs-mcp-all certs-mcp-check \
259+
js-build
260+
261+
## --- JS build ----------------------------------------------------------------
262+
js-build: ## Install npm dependencies and build JS bundle with Vite
263+
@if command -v npm >/dev/null 2>&1; then \
264+
npm install --no-audit --no-fund && npm run vite:build; \
265+
else \
266+
echo "WARNING: npm not found — skipping JS bundle build (admin UI may not load)"; \
267+
fi
259268

260269
## --- Primary servers ---------------------------------------------------------
261-
serve: ## Run production server with Gunicorn + Uvicorn (default)
270+
serve: js-build ## Run production server with Gunicorn + Uvicorn (default)
262271
./run-gunicorn.sh
263272

264-
serve-ssl: certs ## Run Gunicorn with TLS enabled
273+
serve-ssl: js-build certs ## Run Gunicorn with TLS enabled
265274
SSL=true CERT_FILE=certs/cert.pem KEY_FILE=certs/key.pem ./run-gunicorn.sh
266275

267-
serve-granian: ## Run production server with Granian (Rust-based, alternative)
276+
serve-granian: js-build ## Run production server with Granian (Rust-based, alternative)
268277
./run-granian.sh
269278

270-
serve-granian-ssl: certs ## Run Granian with TLS enabled
279+
serve-granian-ssl: js-build certs ## Run Granian with TLS enabled
271280
SSL=true CERT_FILE=certs/cert.pem KEY_FILE=certs/key.pem ./run-granian.sh
272281

273-
serve-granian-http2: certs ## Run Granian with HTTP/2 and TLS
282+
serve-granian-http2: js-build certs ## Run Granian with HTTP/2 and TLS
274283
SSL=true GRANIAN_HTTP=2 CERT_FILE=certs/cert.pem KEY_FILE=certs/key.pem ./run-granian.sh
275284

276-
dev:
285+
dev: js-build
277286
@TEMPLATES_AUTO_RELOAD=true $(VENV_DIR)/bin/uvicorn mcpgateway.main:app --host 0.0.0.0 --port 8000 --reload --reload-exclude='public/'
278287

279288
.PHONY: dev-echo
280-
dev-echo: ## Run dev server with SQL query logging enabled
289+
dev-echo: js-build ## Run dev server with SQL query logging enabled
281290
@echo "🔍 Starting dev server with SQL query logging (N+1 detection)"
282291
@echo " Docs: docs/docs/development/db-performance.md"
283292
@SQLALCHEMY_ECHO=true TEMPLATES_AUTO_RELOAD=true $(VENV_DIR)/bin/uvicorn mcpgateway.main:app --host 0.0.0.0 --port 8000 --reload --reload-exclude='public/'
284293

285294
dev-remote: DEBUG_IP = 127.0.0.1
286295
dev-remote: DEBUG_WAIT = --wait-for-client
287-
dev-remote: ## Run dev server with remote debugging (debugpy on port 5678, remote: make dev-remote DEBUG_IP=0.0.0.0 DEBUG_WAIT=)
296+
dev-remote: js-build ## Run dev server with remote debugging (debugpy on port 5678, remote: make dev-remote DEBUG_IP=0.0.0.0 DEBUG_WAIT=)
288297
@TEMPLATES_AUTO_RELOAD=true $(VENV_DIR)/bin/python -m debugpy \
289298
--listen $(DEBUG_IP):5678 \
290299
$(DEBUG_WAIT) \
@@ -306,7 +315,7 @@ stop-serve: ## Stop gunicorn production server (port 4444)
306315
@if [ -f /tmp/mcpgateway-gunicorn.lock ]; then kill -9 $$(cat /tmp/mcpgateway-gunicorn.lock) 2>/dev/null || true; rm -f /tmp/mcpgateway-gunicorn.lock; fi
307316
@lsof -ti:4444 2>/dev/null | xargs -r kill -9 || true
308317

309-
run:
318+
run: js-build
310319
./run.sh
311320

312321
## --- Certificate helper ------------------------------------------------------

0 commit comments

Comments
 (0)