Add GitHub Copilot code review setup and CI workflow (#93)

This commit is contained in:
Chris Scott authored and GitHub committed 2026-01-29 08:44:28 -05:00
1 parent 485fc67aa7
commit 6dab89d6c4
5 files changed
+184 -8

No files matched your search

+51
View File
@@ -0,0 +1,51 @@
# Copilot Code Review Instructions
## Technology Stack
- **Monorepo**: pnpm workspace with backend, frontend, and shared packages
- **Backend**: Bun runtime + Hono framework + Better SQLite3
- **Frontend**: React 19 + Vite 7 + Radix UI + Tailwind CSS 4
- **Validation**: Zod schemas throughout
- **State**: React Query + Zustand
- **Language**: TypeScript (strict mode)
## Code Style Requirements
### Must Flag as Issues
- Any code comments (code must be self-documenting)
- Console.log statements (use structured logging)
- Use of `any` type without justification
- Default exports (named exports only)
- .then() chains (use async/await)
- Unused variables, imports, or dead code
- Direct state mutations in React components
### Import Patterns
- Backend: `import { Hono } from 'hono'`
- Frontend: `import { Button } from '@/components/ui/button'`
- Shared types: `import { ... } from '@opencode-manager/shared'`
### Architecture Patterns
- Backend routes in `backend/src/routes/`
- Backend services in `backend/src/services/`
- Frontend pages in `frontend/src/pages/`
- Shared types/schemas in `shared/src/`
### Quality Standards
- Test coverage: 80% minimum
- DRY: No duplicated logic
- SOLID principles enforced
- YAGNI: No speculative code
- All functions should have single responsibility
### Review Focus Areas
1. TypeScript type safety (no implicit any)
2. Error handling with try/catch
3. React hooks rules compliance
4. Zod validation on API boundaries
5. Consistent async/await usage
+16
View File
@@ -0,0 +1,16 @@
## Summary
## Type of Change
- [ ] Bug fix
- [ ] New feature
- [ ] Refactor
- [ ] Documentation
## Checklist
- [ ] Code follows project style (no comments, named imports)
- [ ] TypeScript types are properly defined
- [ ] Tests added/updated (80% coverage target)
- [ ] `pnpm lint` passes locally
- [ ] `pnpm typecheck` passes locally
+100
View File
@@ -0,0 +1,100 @@
name: CI
on:
pull_request:
branches: [main, dev]
types: [labeled]
pull_request_review:
types: [submitted]
jobs:
check-ready:
name: Check if Ready for CI
runs-on: ubuntu-latest
outputs:
should-run: ${{ steps.check.outputs.run }}
steps:
- name: Check trigger conditions
id: check
run: |
if [[ "${{ github.event_name }}" == "pull_request_review" && "${{ github.event.review.state }}" == "approved" ]]; then
echo "Triggered by PR approval"
echo "run=true" >> $GITHUB_OUTPUT
elif [[ "${{ github.event_name }}" == "pull_request" && "${{ github.event.label.name }}" == "ready-for-ci" ]]; then
echo "Triggered by ready-for-ci label"
echo "run=true" >> $GITHUB_OUTPUT
else
echo "Conditions not met, skipping CI"
echo "run=false" >> $GITHUB_OUTPUT
fi
lint:
name: Lint
needs: check-ready
if: needs.check-ready.outputs.should-run == 'true'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
with:
version: 10.28.1
- uses: actions/setup-node@v4
with:
node-version: "22"
cache: "pnpm"
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Run linter
run: pnpm lint
typecheck:
name: Type Check
needs: check-ready
if: needs.check-ready.outputs.should-run == 'true'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
with:
version: 10.28.1
- uses: actions/setup-node@v4
with:
node-version: "22"
cache: "pnpm"
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Run type check
run: pnpm typecheck
test:
name: Test
needs: check-ready
if: needs.check-ready.outputs.should-run == 'true'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: oven-sh/setup-bun@v2
- uses: pnpm/action-setup@v4
with:
version: 10.28.1
- uses: actions/setup-node@v4
with:
node-version: "22"
cache: "pnpm"
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Run tests
run: pnpm test