This document provides a comprehensive CI/CD pipeline implementation for the FAF Chrome Extension, designed specifically for production-ready Chrome extensions with TypeScript, Vitest, and Biome.
.github/workflows/ci.yml- Primary CI/CD pipeline with parallel quality gates.github/workflows/dev.yml- Development workflow with fast feedback loops.github/workflows/security.yml- Comprehensive security scanning.github/workflows/quality-gates.yml- Enforced quality standards
scripts/deploy.js- Multi-environment deployment automationscripts/performance-test.js- Extension performance benchmarkingscripts/security-check.js- Security validation and compliancescripts/setup-dev-env.sh- Development environment setup
.github/hooks/pre-commit- Pre-commit quality checksscripts/dev.sh- Development helper commands- Enhanced package.json scripts - Streamlined workflow commands
src/core/telemetry.ts- Production telemetry and error tracking- Security configurations - Automated vulnerability scanning
- Privacy compliance checks - GDPR/privacy validation
- Issue templates - Structured bug reports and feature requests
- PR template - Comprehensive pull request guidelines
DEVELOPMENT.md- Developer workflow documentation
# Make scripts executable and run setup
npm run setup
# Or manually:
chmod +x scripts/*.sh
./scripts/setup-dev-env.sh# Start development mode
npm run dev
# Run quality checks
npm run validate
# Performance testing
npm run perf
# Security scanning
npm run security
# Package for testing
npm run package:dev# Deploy to different environments
npm run deploy:dev # Development build
npm run deploy:staging # Staging environment
npm run deploy:prod # Production (Chrome Web Store)
# Version management
npm run release:patch # 1.0.0 → 1.0.1
npm run release:minor # 1.0.0 → 1.1.0
npm run release:major # 1.0.0 → 2.0.0Pull Request → Quality Gates → Security Scan → Build → Performance Test → Deploy
- ✅ TypeScript: Strict mode compliance
- ✅ Linting: Biome code standards
- ✅ Testing: 80%+ coverage required
- ✅ Security: No high-severity vulnerabilities
- ✅ Performance: <30s build, <500KB bundle
- Development - Local testing with source maps
- Staging - Pre-production validation
- Production - Chrome Web Store deployment
- Manifest validation - Permission auditing
- Code scanning - Pattern detection for vulnerabilities
- Dependency auditing - npm audit integration
- Build verification - Production artifact validation
- Privacy compliance - PII and tracking detection
- Manifest V3 compliance
- CSP validation
- No
eval()orinnerHTMLusage - Input sanitization checks
- Sensitive data pattern detection
import { telemetry } from '@/core/telemetry';
// Track performance
const timer = telemetry.startTimer('operation_name');
// ... do work
timer(); // Automatically records duration
// Track errors
telemetry.reportError(error, { context: 'user_action' });
// Track user events
telemetry.trackUserEvent('feature_used', { feature: 'context_extraction' });- Extension load time
- Memory usage
- Network requests
- User interactions
- Error rates
- Performance benchmarks
- TypeScript: Strict mode with all flags enabled
- Test Coverage: Minimum 80% required
- Bundle Size: Maximum 500KB
- Build Time: Under 30 seconds
- No Debug Code: Automatic detection and blocking
- Service worker startup: <100ms
- Content script injection: <50ms
- Memory usage: <10MB baseline
- Bundle optimization: Tree shaking enabled
- Biome formatter/linter integration
- TypeScript strict mode support
- Debugging configurations
- Task automation
- Extension recommendations
- Pre-commit hooks: Automatic quality checks
- Conventional commits: Standardized commit messages
- Branch protection: Quality gates enforcement
- Auto-formatting: Code style consistency
# Quality checks
npm run validate # Full validation suite
npm run typecheck # TypeScript validation
npm run lint:fix # Auto-fix linting issues
npm run format # Code formatting
# Testing
npm run test # Interactive test mode
npm run test:coverage # Coverage reporting
npm run test:ui # Visual test interface
# Performance
npm run perf # Full performance suite
npm run perf:build # Build time analysis
npm run perf:size # Bundle size analysis- Feature Branch → Development build + validation
- Staging Branch → Pre-production testing
- Main Branch → Production deployment to Chrome Web Store
# Automatic version bump and deployment
git tag v1.2.3
git push origin v1.2.3
# → Triggers production deployment pipeline# Emergency rollback
node scripts/deploy.js rollback 1.2.2 production# Chrome Web Store
CHROME_EXTENSION_ID=your-extension-id
CHROME_CLIENT_ID=oauth-client-id
CHROME_CLIENT_SECRET=oauth-secret
CHROME_REFRESH_TOKEN=refresh-token
# Security scanning
SNYK_TOKEN=snyk-auth-token
# Notifications
SLACK_WEBHOOK_URL=slack-webhook
# Telemetry (optional)
TELEMETRY_ENDPOINT=https://your-analytics.com/api# Copy and customize
cp .env.example .env.local- Weekly: Dependency updates and security scans
- Monthly: Performance baseline reviews
- Quarterly: Security audit and compliance review
- Daily security scans
- Dependency vulnerability alerts
- Performance regression detection
- Chrome extension policy compliance
DEVELOPMENT.md- Detailed development workflowSECURITY.md- Security guidelines and best practices- Chrome Extension documentation
- Manifest V3 migration guide
- GitHub Issues for bug reports
- GitHub Discussions for questions
- Security issues: security@yourproject.com
- GitHub Actions workflows configured
- Quality gates implemented
- Security scanning enabled
- Performance testing automated
- Deployment scripts created
- Development environment setup
- Monitoring and telemetry implemented
- Documentation completed
Your FAF Chrome Extension now has enterprise-grade CI/CD pipeline! 🚀
- Configure GitHub Secrets - Add required API keys and tokens
- Run Initial Setup - Execute
npm run setup - Test Pipeline - Create a test PR to validate workflows
- Customize Monitoring - Configure telemetry endpoint
- Deploy to Staging - Validate deployment process
- Go Live - Deploy to Chrome Web Store
Happy coding! 🎯