Files
Charon/.vscode/tasks.json

189 lines
4.6 KiB
JSON

{
"version": "2.0.0",
"tasks": [
{
"label": "Coraza: Run Integration Script",
"type": "shell",
"command": "bash",
"args": ["./scripts/coraza_integration.sh"],
"group": "test",
"problemMatcher": []
},
{
"label": "Coraza: Run Integration Go Test",
"type": "shell",
"command": "sh",
"args": ["-c", "cd backend && go test -tags=integration ./integration -run TestCorazaIntegration -v"],
"group": "test",
"problemMatcher": []
},
{
"label": "Git Remove Cached",
"type": "shell",
"command": "git rm -r --cached .",
"group": "test"
},
{
"label": "Run Pre-commit (Staged Files)",
"type": "shell",
"command": "${workspaceFolder}/.venv/bin/pre-commit run",
"group": "test"
},
// === MANUAL LINT/SCAN TASKS ===
// These are the slow hooks removed from automatic pre-commit
{
"label": "Lint: GolangCI-Lint",
"type": "shell",
"command": "cd backend && docker run --rm -v $(pwd):/app:ro -w /app golangci/golangci-lint:latest golangci-lint run -v",
"group": "test",
"problemMatcher": ["$go"],
"presentation": {
"reveal": "always",
"panel": "new"
}
},
{
"label": "Lint: Go Race Detector",
"type": "shell",
"command": "cd backend && go test -race ./...",
"group": "test",
"problemMatcher": ["$go"],
"presentation": {
"reveal": "always",
"panel": "new"
}
},
{
"label": "Lint: Hadolint (Dockerfile)",
"type": "shell",
"command": "docker run --rm -i hadolint/hadolint < Dockerfile",
"group": "test",
"problemMatcher": [],
"presentation": {
"reveal": "always",
"panel": "new"
}
},
{
"label": "Lint: Run All Manual Checks",
"type": "shell",
"command": "${workspaceFolder}/.venv/bin/pre-commit run --all-files --hook-stage manual",
"group": "test",
"problemMatcher": [],
"presentation": {
"reveal": "always",
"panel": "new"
}
},
// === BUILD & RUN TASKS ===
{
"label": "Build & Run Local Docker",
"type": "shell",
"command": "docker build --build-arg VCS_REF=$(git rev-parse HEAD) -t charon:local . && docker compose -f docker-compose.local.yml up -d",
"group": "test"
},
{
"label": "Run Local Docker (debug)",
"type": "shell",
"command": "docker run --rm -it --name charon-debug --cap-add=SYS_PTRACE --security-opt seccomp=unconfined -p 8080:8080 -p 2345:2345 -e CHARON_ENV=development -e CHARON_DEBUG=1 charon:local",
"group": "test"
},
{
"label": "Run Trivy Scan (Local)",
"type": "shell",
"command": "docker",
"args": [
"run",
"--rm",
"-v",
"/var/run/docker.sock:/var/run/docker.sock",
"-v",
"${userHome}/.cache/trivy:/root/.cache/trivy",
"-v",
"${workspaceFolder}/.trivy_logs:/logs",
"aquasec/trivy:latest",
"image",
"--severity",
"CRITICAL,HIGH",
"--output",
"/logs/trivy-report.txt",
"charon:local"
],
"isBackground": false,
"group": "test"
},
{
"label": "Run CodeQL Scan (Local)",
"type": "shell",
"command": "${workspaceFolder}/tools/codeql_scan.sh",
"group": "test"
},
{
"label": "Run Security Scan (govulncheck)",
"type": "shell",
"command": "${workspaceFolder}/scripts/security-scan.sh",
"group": "test",
"problemMatcher": []
},
{
"label": "Docker: Restart Local (No Rebuild)",
"type": "shell",
"command": "docker compose -f docker-compose.local.yml down && docker compose -f docker-compose.local.yml up -d",
"group": "test",
"isBackground": false,
"problemMatcher": []
},
{
"label": "Docker: Stop Local",
"type": "shell",
"command": "docker compose -f docker-compose.local.yml down",
"group": "test",
"isBackground": false,
"problemMatcher": []
},
{
"label": "Docker: Start Local (Already Built)",
"type": "shell",
"command": "docker compose -f docker-compose.local.yml up -d",
"group": "test",
"isBackground": false,
"problemMatcher": []
}
,
{
"label": "Frontend: Type Check",
"type": "shell",
"command": "cd frontend && npm run type-check",
"group": "test",
"presentation": {
"reveal": "always",
"panel": "shared"
},
"problemMatcher": []
},
{
"label": "Backend: Go Test Coverage",
"type": "shell",
"command": "bash -c 'scripts/go-test-coverage.sh'",
"group": "test",
"presentation": {
"reveal": "always",
"panel": "shared"
},
"problemMatcher": []
},
{
"label": "Frontend: Test Coverage",
"type": "shell",
"command": "bash -c 'scripts/frontend-test-coverage.sh'",
"group": "test",
"presentation": {
"reveal": "always",
"panel": "shared"
},
"problemMatcher": []
}
]
}