Files
Jonathan Miller bd5f676e0a
Platform: moko-platform CI / Gate 2: Unit Tests (8.1) (push) Has been cancelled
Platform: moko-platform CI / Gate 2: Unit Tests (8.2) (push) Has been cancelled
Platform: moko-platform CI / Gate 2: Unit Tests (8.3) (push) Has been cancelled
Platform: moko-platform CI / Gate 3: Self-Health Check (push) Has been cancelled
Platform: moko-platform CI / Gate 4: Governance (push) Has been cancelled
Platform: moko-platform CI / Gate 5: Template Integrity (push) Has been cancelled
Platform: moko-platform CI / CI Summary (push) Has been cancelled
Generic: Repo Health / Scripts governance (push) Has been cancelled
Generic: Repo Health / Repository health (push) Has been cancelled
Generic: Repo Health / Report Issues (push) Has been cancelled
Generic: Repo Health / Site Health (push) Has been cancelled
Generic: Repo Health / Access control (push) Has been cancelled
Platform: moko-platform CI / Gate 1: Code Quality (push) Has been cancelled
Merge remote-tracking branch 'origin/dev'
# Conflicts:
#	cli/manifest_licensing.php
2026-06-06 11:49:30 -05:00

88 lines
2.4 KiB
Bash

#!/bin/bash
# Quick validation script to check code quality
# Can be run manually or in CI/CD
echo "🔍 MCP SSH Manager - Code Validation"
echo "====================================="
echo ""
ERRORS=0
# Check JavaScript syntax
echo "📋 Checking JavaScript syntax..."
if node --check src/index.js 2>/dev/null; then
echo " ✅ JavaScript syntax is valid"
else
echo " ❌ JavaScript syntax error!"
ERRORS=$((ERRORS + 1))
fi
# Check SSH Manager syntax
echo "📋 Checking SSH Manager syntax..."
if node --check src/ssh-manager.js 2>/dev/null; then
echo " ✅ SSH Manager syntax is valid"
else
echo " ❌ SSH Manager syntax error!"
ERRORS=$((ERRORS + 1))
fi
# Check for .env in git
echo "📋 Checking for sensitive files..."
if git ls-files | grep -q "^\.env$"; then
echo " ❌ WARNING: .env file is tracked in git!"
ERRORS=$((ERRORS + 1))
else
echo " ✅ No .env file in git"
fi
# Check if dependencies are installed
echo "📋 Checking dependencies..."
if [ -d "node_modules" ]; then
echo " ✅ Node modules installed"
else
echo " ⚠️ Node modules not installed (run: npm install)"
fi
# Test server startup (quick test)
echo "📋 Testing MCP server startup..."
# The server needs stdin, so we provide empty input and check if it starts
# Use a timeout alternative for macOS compatibility
( echo "" | node src/index.js 2>/dev/null 1>/dev/null ) &
PID=$!
sleep 2
if kill -0 $PID 2>/dev/null; then
kill $PID 2>/dev/null
echo " ✅ MCP server starts correctly"
else
wait $PID
EXIT_CODE=$?
if [ $EXIT_CODE -eq 0 ] || [ $EXIT_CODE -eq 143 ]; then
echo " ✅ MCP server syntax is valid"
else
echo " ❌ MCP server failed to start (exit code: $EXIT_CODE)"
ERRORS=$((ERRORS + 1))
fi
fi
# Test password special characters handling
echo "📋 Testing password special character handling..."
if [ -f "debug/test_password_special_chars.sh" ]; then
if bash debug/test_password_special_chars.sh > /dev/null 2>&1; then
echo " ✅ Password special characters handled correctly"
else
echo " ⚠️ Password test requires local dependencies (skipping in CI)"
fi
else
echo " ⚠️ Password test script not found (skipping)"
fi
echo ""
echo "====================================="
if [ $ERRORS -eq 0 ]; then
echo "✅ All checks passed!"
exit 0
else
echo "❌ Found $ERRORS error(s)"
exit 1
fi