Skip to content

Commit d7229e2

Browse files
committed
chore: unify qa automation
1 parent 7b244e2 commit d7229e2

File tree

5 files changed

+201
-195
lines changed

5 files changed

+201
-195
lines changed

.cursor/commands/qa/Taskfile.yml

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -110,16 +110,27 @@ tasks:
110110
- cd ../../../frontend && bun run test:e2e:ui
111111
silent: false
112112

113-
# Complete test suite
113+
# Complete QA suite (THE definitive quality check)
114114
all:
115-
desc: "Complete test suite (smoke + lint + typecheck + unit + e2e)"
116-
cmds:
115+
desc: "Complete QA suite (fix + rules + smoke + lint + typecheck + unit + e2e)"
116+
cmds:
117+
- echo "🎯 Running comprehensive QA suite..."
118+
- echo ""
119+
- task: fix
120+
- echo ""
121+
- task: rules:check
122+
- echo ""
117123
- task: smoke
124+
- echo ""
118125
- task: lint
126+
- echo ""
119127
- task: typecheck
128+
- echo ""
120129
- task: unit
130+
- echo ""
121131
- task: e2e
122-
- echo "🎉 All tests passed!"
132+
- echo ""
133+
- echo "🎉 All QA checks passed!"
123134
silent: false
124135

125136
# Appium (mobile testing)

.github/workflows/ci.yml.scaffold

Lines changed: 64 additions & 125 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
# GitHub Actions CI Workflow - SCAFFOLD
22
#
33
# Status: NOT YET ACTIVE (rename to ci.yml to activate)
4-
# Purpose: Run automated tests and quality checks on every push/PR
4+
# Purpose: Run comprehensive QA suite on every push/PR
55
#
6-
# This workflow will use the unified Task automation system.
7-
# All checks mirror local development (Husky hooks + Cursor commands)
6+
# This workflow uses the unified `task qa:all` command.
7+
# Mirrors Husky pre-push hook exactly (same commands, same checks).
88
#
99
# To activate:
1010
# 1. Rename this file from ci.yml.scaffold to ci.yml
@@ -22,155 +22,94 @@ on:
2222

2323
jobs:
2424
# ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
25-
# Job 1: Founder Rules Validation
25+
# Comprehensive QA Suite (mirrors pre-push hook)
2626
# ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
27-
# Mirrors: .husky/pre-commit hook
28-
# Command: bun run task founder:rules:check
27+
# Command: cd .cursor && task qa:all
28+
# Includes: fix, rules, smoke, lint, typecheck, unit, e2e
2929

30-
founder-rules:
31-
name: Validate Founder Rules
30+
qa-all:
31+
name: QA Suite (fix + rules + smoke + lint + typecheck + unit + e2e)
3232
runs-on: ubuntu-latest
3333

3434
steps:
3535
- name: Checkout code
3636
uses: actions/checkout@v4
3737

38-
# TODO: Install Task
39-
# - name: Install go-task
40-
# run: |
41-
# sh -c "$(curl --location https://taskfile.dev/install.sh)" -- -d -b /usr/local/bin
42-
# task --version
38+
- name: Install go-task
39+
run: |
40+
sh -c "$(curl --location https://taskfile.dev/install.sh)" -- -d -b /usr/local/bin
41+
task --version
4342

44-
# TODO: Install bun
45-
# - name: Setup bun
46-
# uses: oven-sh/setup-bun@v1
47-
# with:
48-
# bun-version: latest
43+
- name: Setup bun
44+
uses: oven-sh/setup-bun@v1
45+
with:
46+
bun-version: latest
4947

50-
# TODO: Install Node.js (for automation scripts)
51-
# - name: Setup Node.js
52-
# uses: actions/setup-node@v4
53-
# with:
54-
# node-version: '20'
48+
- name: Setup Node.js
49+
uses: actions/setup-node@v4
50+
with:
51+
node-version: '20'
5552

56-
# TODO: Run founder rules check
57-
# - name: Check Founder Rules
58-
# run: bun run task founder:rules:check
59-
60-
# ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
61-
# Job 2: Backend Smoke Tests
62-
# ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
63-
# Mirrors: .husky/pre-push hook (backend part)
64-
# Command: bun run qa:smoke:backend
65-
66-
backend-smoke:
67-
name: Backend Smoke Tests
68-
runs-on: ubuntu-latest
69-
needs: founder-rules
70-
71-
steps:
72-
- name: Checkout code
73-
uses: actions/checkout@v4
74-
75-
# TODO: Setup dependencies
76-
# - Install Task, bun, Node.js (same as above)
77-
78-
# TODO: Install backend dependencies
79-
# - name: Install Backend Dependencies
80-
# run: cd backend && bun install
81-
82-
# TODO: Start backend
83-
# - name: Start Backend
84-
# run: cd .cursor && task backend:dev &
85-
# # Give it time to start
86-
# sleep 5
87-
88-
# TODO: Run smoke tests
89-
# - name: Run Backend Smoke Tests
90-
# run: bun run qa:smoke:backend
91-
92-
# ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
93-
# Job 3: Frontend Smoke Tests
94-
# ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
95-
# Mirrors: .husky/pre-push hook (frontend part)
96-
# Command: bun run qa:smoke:frontend
97-
98-
frontend-smoke:
99-
name: Frontend Smoke Tests
100-
runs-on: ubuntu-latest
101-
needs: founder-rules
102-
103-
steps:
104-
- name: Checkout code
105-
uses: actions/checkout@v4
53+
- name: Install Encore CLI
54+
run: |
55+
curl -L https://encore.dev/install.sh | bash
56+
echo "$HOME/.encore/bin" >> $GITHUB_PATH
10657

107-
# TODO: Setup dependencies
108-
# - Install Task, bun, Node.js (same as above)
58+
- name: Install Backend Dependencies
59+
run: cd backend && bun install
10960

110-
# TODO: Install frontend dependencies
111-
# - name: Install Frontend Dependencies
112-
# run: cd frontend && bun install
61+
- name: Install Frontend Dependencies
62+
run: cd frontend && bun install
11363

114-
# TODO: Build frontend
115-
# - name: Build Frontend
116-
# run: cd .cursor && task frontend:build
64+
- name: Start Backend
65+
run: |
66+
cd backend
67+
encore run &
68+
echo "Waiting for backend to be ready..."
69+
timeout 60 bash -c 'until curl -sf http://localhost:4000/health > /dev/null; do sleep 2; done'
11770

118-
# TODO: Start frontend
119-
# - name: Start Frontend
120-
# run: cd .cursor && task frontend:dev &
121-
# sleep 5
122-
123-
# TODO: Run smoke tests
124-
# - name: Run Frontend Smoke Tests
125-
# run: bun run qa:smoke:frontend
126-
127-
# ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
128-
# Job 4: Type Checking
129-
# ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
130-
# Additional quality check
131-
# Command: bun run typecheck
132-
133-
typecheck:
134-
name: TypeScript Type Checking
135-
runs-on: ubuntu-latest
136-
needs: founder-rules
137-
138-
steps:
139-
- name: Checkout code
140-
uses: actions/checkout@v4
71+
- name: Start Frontend
72+
run: |
73+
cd frontend
74+
bun run dev &
75+
echo "Waiting for frontend to be ready..."
76+
timeout 60 bash -c 'until curl -sf http://localhost:5173 > /dev/null; do sleep 2; done'
14177

142-
# TODO: Setup and run typecheck
143-
# - name: Run TypeScript Type Checking
144-
# run: bun run typecheck
78+
- name: Run Complete QA Suite
79+
run: cd .cursor && task qa:all
14580

14681
# ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
14782
# Implementation Notes:
14883
# ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
14984
#
150-
# 1. All Task commands are the SAME as local development
151-
# 2. CI enforces the same rules as Husky hooks (redundant safety)
152-
# 3. Jobs run in parallel where possible (founder-rules first, others parallel)
153-
# 4. Uses ubuntu-latest for consistency
154-
# 5. Each job installs its own dependencies (GitHub Actions best practice)
85+
# SIMPLICITY: Single job runs `task qa:all` - same as pre-push hook
86+
# MIRRORS LOCAL: Exact same command developers run locally
87+
# DRY: No duplication - all logic in .cursor/commands/qa/Taskfile.yml
15588
#
156-
# Dependencies needed:
157-
# - go-task (Taskfile runner)
158-
# - bun (package manager)
159-
# - Node.js (for automation scripts)
160-
# - Encore CLI (for backend)
89+
# What `task qa:all` runs:
90+
# 1. qa:fix - Auto-fix linting/formatting
91+
# 2. qa:rules - Validate founder rules (no console.log, no any, American spelling)
92+
# 3. qa:smoke - Health checks (backend + frontend)
93+
# 4. qa:lint - Linting (backend + frontend)
94+
# 5. qa:typecheck - TypeScript validation (frontend)
95+
# 6. qa:unit - Unit tests (backend only - encore test)
96+
# 7. qa:e2e - E2E tests (frontend Playwright)
16197
#
162-
# Environment variables:
163-
# - BACKEND_PORT, FRONTEND_PORT (auto-resolved from automation/scripts/env.mjs)
98+
# Dependencies:
99+
# - go-task - Taskfile runner
100+
# - bun - Package manager
101+
# - Node.js - Automation scripts
102+
# - Encore CLI - Backend runtime
164103
#
165-
# Security:
166-
# - No secrets needed for CI checks
167-
# - Database: Use in-memory or test DB
168-
# - No external API calls in smoke tests
104+
# Environment:
105+
# - Uses standard ports from .env (4000 backend, 5173 frontend)
106+
# - In-memory database for tests
107+
# - No secrets required
169108
#
170-
# To test before activating:
109+
# Testing before activation:
171110
# 1. Create feature branch
172111
# 2. Rename to ci.yml
173112
# 3. Push to trigger workflow
174-
# 4. Verify all jobs pass
113+
# 4. Verify qa:all passes
175114
# 5. Merge to main
176115

.husky/pre-commit

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,16 @@
11
#!/bin/sh
22
# Husky pre-commit hook
3-
# Auto-fixes and validates code before allowing commit
3+
# Comprehensive QA suite BEFORE commit (coding agent safety)
4+
#
5+
# WHY REDUNDANT: Coding agents can bypass guards and commit directly.
6+
# Running qa:all here ensures quality checks at EVERY commit.
47

5-
# Auto-fix linting and formatting
6-
echo "🔧 Auto-fixing code quality issues..."
7-
(cd .cursor && task qa:fix) || exit 1
8-
9-
# Run the full QA suite (linting, testing, etc.)
10-
echo "🛠️ Running comprehensive QA checks..."
8+
echo "🛠️ Running comprehensive QA suite before commit..."
9+
echo " (Redundant with pre-push for coding agent safety)"
10+
echo ""
1111
(cd .cursor && task qa:all) || exit 1
1212

13-
# Validate founder rules
14-
echo "📋 Validating founder rules..."
15-
(cd .cursor && task qa:rules:check) || exit 1
13+
echo ""
14+
echo "✅ Pre-commit checks passed!"
1615

1716

.husky/pre-push

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,12 @@
11
#!/bin/sh
22
# Husky pre-push hook
3-
# 1. Cleanup root documentation (vibe_manager_vibe responsibility)
4-
# 2. Run auto-fix and comprehensive QA suite
5-
# 3. Check for merge commits in new changes
3+
# Comprehensive QA suite + merge commit check
4+
#
5+
# WHY REDUNDANT: Coding agents can bypass pre-commit and push directly.
6+
# Running qa:all here ensures quality checks at EVERY push.
67

7-
echo "🧹 Vibe Manager: Cleaning up root documentation..."
8-
echo ""
9-
10-
echo ""
11-
echo "🔧 Auto-fixing code quality issues before push..."
12-
echo ""
13-
(cd .cursor && task qa:fix) || exit 1
14-
15-
echo ""
16-
echo "🛠️ Running comprehensive QA checks before push..."
8+
echo "🛠️ Running comprehensive QA suite before push..."
9+
echo " (Redundant with pre-commit for coding agent safety)"
1710
echo ""
1811
(cd .cursor && task qa:all) || exit 1
1912

0 commit comments

Comments
 (0)