Rename the `rails/` directory to `tools/` for agent discoverability — agents frequently failed to locate helper scripts due to the non-intuitive directory name. Add backward-compat symlink `rails/ → tools/`. New tool suites: - Authentik: auth-token, user-list, user-create, group-list, app-list, flow-list, admin-status (8 scripts) - Coolify: team-list, project-list, service-list, service-status, deploy, env-set (7 scripts) - Woodpecker: pipeline-list, pipeline-status, pipeline-trigger (3 stubs) - GLPI: session-init, computer-list, ticket-list, ticket-create, user-list (6 scripts) - Health: stack-health.sh — stack-wide connectivity check Infrastructure: - Shared credential loader at tools/_lib/credentials.sh - install.sh creates symlink + chmod on tool scripts - All ~253 rails/ path references updated across 68+ files Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
93 lines
2.8 KiB
Bash
Executable File
93 lines
2.8 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
# Quality Rails Verification Script
|
|
# Tests that enforcement actually works
|
|
|
|
echo "═══════════════════════════════════════════"
|
|
echo "Quality Rails Enforcement Verification"
|
|
echo "═══════════════════════════════════════════"
|
|
echo ""
|
|
|
|
PASSED=0
|
|
FAILED=0
|
|
|
|
# Test 1: Type error blocked
|
|
echo "Test 1: Type errors should be blocked..."
|
|
echo "const x: string = 123;" > test-file.ts
|
|
git add test-file.ts 2>/dev/null
|
|
if git commit -m "Test commit" 2>&1 | grep -q "error"; then
|
|
echo "✅ PASS: Type errors blocked"
|
|
((PASSED++))
|
|
else
|
|
echo "❌ FAIL: Type errors NOT blocked"
|
|
((FAILED++))
|
|
fi
|
|
git reset HEAD test-file.ts 2>/dev/null
|
|
rm test-file.ts 2>/dev/null
|
|
|
|
# Test 2: any type blocked
|
|
echo ""
|
|
echo "Test 2: 'any' types should be blocked..."
|
|
echo "const x: any = 123;" > test-file.ts
|
|
git add test-file.ts 2>/dev/null
|
|
if git commit -m "Test commit" 2>&1 | grep -q "no-explicit-any"; then
|
|
echo "✅ PASS: 'any' types blocked"
|
|
((PASSED++))
|
|
else
|
|
echo "❌ FAIL: 'any' types NOT blocked"
|
|
((FAILED++))
|
|
fi
|
|
git reset HEAD test-file.ts 2>/dev/null
|
|
rm test-file.ts 2>/dev/null
|
|
|
|
# Test 3: Hardcoded secret blocked (if git-secrets installed)
|
|
echo ""
|
|
echo "Test 3: Hardcoded secrets should be blocked..."
|
|
if command -v git-secrets &> /dev/null; then
|
|
echo "const password = 'SuperSecret123!';" > test-file.ts
|
|
git add test-file.ts 2>/dev/null
|
|
if git commit -m "Test commit" 2>&1 | grep -q -i "secret\|password"; then
|
|
echo "✅ PASS: Secrets blocked"
|
|
((PASSED++))
|
|
else
|
|
echo "⚠ WARN: Secrets NOT blocked (git-secrets may need configuration)"
|
|
((FAILED++))
|
|
fi
|
|
git reset HEAD test-file.ts 2>/dev/null
|
|
rm test-file.ts 2>/dev/null
|
|
else
|
|
echo "⚠ SKIP: git-secrets not installed"
|
|
fi
|
|
|
|
# Test 4: Lint error blocked
|
|
echo ""
|
|
echo "Test 4: Lint errors should be blocked..."
|
|
echo "const x=123" > test-file.ts # Missing semicolon
|
|
git add test-file.ts 2>/dev/null
|
|
if git commit -m "Test commit" 2>&1 | grep -q "prettier"; then
|
|
echo "✅ PASS: Lint errors blocked"
|
|
((PASSED++))
|
|
else
|
|
echo "❌ FAIL: Lint errors NOT blocked"
|
|
((FAILED++))
|
|
fi
|
|
git reset HEAD test-file.ts 2>/dev/null
|
|
rm test-file.ts 2>/dev/null
|
|
|
|
# Summary
|
|
echo ""
|
|
echo "═══════════════════════════════════════════"
|
|
echo "Verification Summary"
|
|
echo "═══════════════════════════════════════════"
|
|
echo "✅ Passed: $PASSED"
|
|
echo "❌ Failed: $FAILED"
|
|
echo ""
|
|
|
|
if [ $FAILED -eq 0 ]; then
|
|
echo "🎉 All tests passed! Quality enforcement is working."
|
|
exit 0
|
|
else
|
|
echo "⚠ Some tests failed. Review configuration."
|
|
exit 1
|
|
fi
|