Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
147 changes: 147 additions & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,147 @@
# CODEOWNERS file for CodeQuest Platform
# This file defines who needs to review changes to different parts of the codebase
#
# For more info about CODEOWNERS file format, see:
# https://docs.github.com/en/github/creating-cloning-and-archiving-repositories/creating-a-repository-on-github/about-code-owners

# ==============================================================================
# Global Ownership
# ==============================================================================

# Default owners for everything in the repo
# These users will be requested for review when someone opens a pull request
* @crisecheverria

# ==============================================================================
# Root Configuration Files
# ==============================================================================

# Package management and workspace configuration
package.json @crisecheverria
package-lock.json @crisecheverria
/.gitignore @crisecheverria
/README.md @crisecheverria
/LICENSE @crisecheverria

# ==============================================================================
# CI/CD and GitHub Configuration
# ==============================================================================

# GitHub workflows and actions
/.github/ @crisecheverria

# CODEOWNERS file itself (requires admin approval)
/.github/CODEOWNERS @crisecheverria

# ==============================================================================
# Backend Package
# ==============================================================================

# Backend package configuration
/packages/backend/package.json @crisecheverria
/packages/backend/tsconfig.json @crisecheverria
/packages/backend/jest.config.js @crisecheverria
/packages/backend/.eslintrc.js @crisecheverria

# Backend source code - main areas
/packages/backend/src/ @crisecheverria

# Backend models (database schema changes require careful review)
/packages/backend/src/models/ @crisecheverria

# Backend API routes (public interface changes)
/packages/backend/src/routes/ @crisecheverria

# Backend services (business logic)
/packages/backend/src/services/ @crisecheverria

# Backend configuration (security sensitive)
/packages/backend/src/config/ @crisecheverria

# Database migrations and scripts
/packages/backend/src/scripts/ @crisecheverria
/packages/backend/src/db/ @crisecheverria

# Backend middleware (auth, error handling)
/packages/backend/src/middleware/ @crisecheverria

# Backend tests
/packages/backend/src/__tests__/ @crisecheverria

# Dockerfiles and containers (deployment critical)
/packages/backend/Dockerfile* @crisecheverria
/packages/backend/*.sh @crisecheverria

# Go executor (performance critical)
/packages/backend/go-executor/ @crisecheverria

# Data files (challenge and concept definitions)
/packages/backend/data/ @crisecheverria

# ==============================================================================
# Frontend Package
# ==============================================================================

# Frontend package configuration
/packages/frontend/package.json @crisecheverria
/packages/frontend/tsconfig.json @crisecheverria
/packages/frontend/vite.config.ts @crisecheverria
/packages/frontend/vitest.config.ts @crisecheverria
/packages/frontend/tailwind.config.js @crisecheverria
/packages/frontend/postcss.config.js @crisecheverria
/packages/frontend/eslint.config.js @crisecheverria

# Frontend source code
/packages/frontend/src/ @crisecheverria

# Frontend components
/packages/frontend/src/components/ @crisecheverria

# Frontend API layer
/packages/frontend/src/api/ @crisecheverria

# Frontend types (interface definitions)
/packages/frontend/src/types/ @crisecheverria

# Frontend tests
/packages/frontend/src/__tests__/ @crisecheverria

# Frontend build configuration
/packages/frontend/index.html @crisecheverria
/packages/frontend/public/ @crisecheverria

# ==============================================================================
# Documentation
# ==============================================================================

# Documentation files
*.md @crisecheverria
/docs/ @crisecheverria

# ==============================================================================
# Security and Configuration
# ==============================================================================

# Environment files and security configs
*.env* @crisecheverria
.audit-ci.json @crisecheverria

# ==============================================================================
# Special Cases - Multiple Reviewers (Examples for future use)
# ==============================================================================

# Uncomment and modify these when you have multiple team members:
#
# Critical security files (require multiple approvals)
# /packages/backend/src/middleware/auth.ts @crisecheverria @security-team
# /packages/backend/src/config/index.ts @crisecheverria @security-team
#
# Database models (require backend team review)
# /packages/backend/src/models/ @crisecheverria @backend-team
#
# Frontend components (require frontend team review)
# /packages/frontend/src/components/ @crisecheverria @frontend-team
#
# API contracts (require both backend and frontend teams)
# /packages/backend/src/routes/ @crisecheverria @backend-team @frontend-team
# /packages/frontend/src/api/ @crisecheverria @backend-team @frontend-team
70 changes: 37 additions & 33 deletions .github/workflows/test-backend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,28 @@ name: Backend Tests
on:
push:
branches: [main, develop]
paths:
- 'packages/backend/**'
- '.github/workflows/test-backend.yml'
paths:
- "packages/backend/**"
- ".github/workflows/test-backend.yml"
pull_request:
branches: [main]
paths:
- 'packages/backend/**'
- '.github/workflows/test-backend.yml'
paths:
- "packages/backend/**"
- ".github/workflows/test-backend.yml"

permissions:
contents: read
pull-requests: write

jobs:
test:
name: Backend Tests
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [18.x, 20.x]

services:
mongodb:
image: mongo:7.0
Expand All @@ -34,51 +38,51 @@ jobs:
--health-interval 10s
--health-timeout 5s
--health-retries 5

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
cache: "npm"

- name: Setup Go
uses: actions/setup-go@v4
with:
go-version: '1.21'
go-version: "1.21"

- name: Verify Go Installation
run: go version

- name: Install dependencies
run: |
npm ci
npm ci -w packages/backend

- name: Run ESLint
run: npm run lint -w packages/backend

- name: Build backend
run: npm run build -w packages/backend

- name: Install MongoDB tools
run: |
wget -qO - https://www.mongodb.org/static/pgp/server-7.0.asc | sudo apt-key add -
echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu jammy/mongodb-org/7.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-7.0.list
sudo apt-get update
sudo apt-get install -y mongodb-mongosh

- name: Wait for MongoDB
run: |
until mongosh --host localhost:27017 --username admin --password password --authenticationDatabase admin --eval "db.adminCommand('ping')" --quiet; do
echo "Waiting for MongoDB..."
sleep 5
done
echo "MongoDB is ready"

- name: Run unit tests
run: npm run test:unit -w packages/backend
env:
Expand All @@ -88,8 +92,8 @@ jobs:
USE_NATIVE_GO_EXECUTOR: false
DOCKER_TIMEOUT: 10000
TEST_VERBOSE: false
- name: Run integration tests

- name: Run integration tests
run: npm run test:integration -w packages/backend
env:
NODE_ENV: test
Expand All @@ -98,7 +102,7 @@ jobs:
USE_NATIVE_GO_EXECUTOR: false
DOCKER_TIMEOUT: 15000
TEST_VERBOSE: false

- name: Run all tests with coverage
run: npm run test:coverage -w packages/backend
env:
Expand All @@ -108,37 +112,37 @@ jobs:
USE_NATIVE_GO_EXECUTOR: false
DOCKER_TIMEOUT: 15000
TEST_VERBOSE: false

- name: Comment coverage on PR
if: github.event_name == 'pull_request'
uses: romeovs/lcov-reporter-action@v0.3.1
with:
lcov-file: ./packages/backend/coverage/lcov.info
github-token: ${{ secrets.GITHUB_TOKEN }}
title: Backend Test Coverage Report

security:
name: Security Audit
runs-on: ubuntu-latest
needs: test

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '18.x'
cache: 'npm'
node-version: "18.x"
cache: "npm"

- name: Install dependencies
run: |
npm ci
npm ci -w packages/backend

- name: Run security audit
run: npm audit --audit-level moderate -w packages/backend

- name: Run dependency check
run: npx audit-ci --config .audit-ci.json -w packages/backend || true
run: npx audit-ci --config .audit-ci.json -w packages/backend || true
Loading
Loading