|
| 1 | +## Overview |
| 2 | +Essential rules for reviewing code changes in the Cypress monorepo. |
| 3 | + |
| 4 | +## Critical PR Review Rules |
| 5 | + |
| 6 | +### Security Checklist |
| 7 | +- [ ] **Input validation**: All user inputs are validated |
| 8 | +- [ ] **Path traversal**: File paths are safely resolved |
| 9 | +- [ ] **Sensitive data**: No secrets or sensitive info in logs |
| 10 | +- [ ] **Network requests**: URLs are validated before requests |
| 11 | +- [ ] **File permissions**: Proper permission handling for file operations |
| 12 | + |
| 13 | +### Performance Checklist |
| 14 | +- [ ] **Startup time**: No blocking operations during startup |
| 15 | +- [ ] **Memory usage**: Resources are properly disposed |
| 16 | +- [ ] **Bundle size**: No unnecessary dependencies added |
| 17 | +- [ ] **Async operations**: Non-blocking where possible |
| 18 | +- [ ] **Caching**: Appropriate caching strategies used |
| 19 | + |
| 20 | +### Cypress-Specific Rules |
| 21 | +- [ ] **Browser compatibility**: Test on Chrome, Firefox, Edge, Safari |
| 22 | +- [ ] **Network stubbing**: Proper request/response mocking |
| 23 | +- [ ] **DOM manipulation**: Safe element selection and manipulation |
| 24 | +- [ ] **Test isolation**: Tests don't interfere with each other |
| 25 | +- [ ] **Command chaining**: Proper use of Cypress command chaining |
| 26 | +- [ ] **Assertions**: Meaningful assertions with clear failure messages |
| 27 | +- [ ] **Timeouts**: Appropriate timeout values for different operations |
| 28 | +- [ ] **Retry logic**: Proper retry strategies for flaky operations |
| 29 | + |
| 30 | +### Code Quality Rules |
| 31 | +- [ ] **Naming**: Variables and functions have descriptive names |
| 32 | +- [ ] **Comments**: Complex logic is explained with comments |
| 33 | +- [ ] **Imports**: Imports are organized and minimal |
| 34 | +- [ ] **Exports**: Only necessary functions/classes are exported |
| 35 | +- [ ] **Side effects**: Functions are pure when possible |
| 36 | +- [ ] **Error boundaries**: Proper error boundaries in React components |
| 37 | +- [ ] **Magic numbers and Regex**: Extract to named constants |
| 38 | + |
| 39 | +### Testing Rules |
| 40 | +- [ ] **Test naming**: Tests describe the behavior being tested |
| 41 | +- [ ] **Test isolation**: Each test is independent |
| 42 | +- [ ] **Mocking**: External dependencies are properly mocked |
| 43 | +- [ ] **Coverage**: Critical paths have test coverage |
| 44 | +- [ ] **Edge cases**: Error conditions and edge cases are tested |
| 45 | +- [ ] **Performance**: Tests don't take too long to run |
| 46 | +- [ ] **Flakiness**: Tests are deterministic and not flaky |
| 47 | +- [ ] **Setup/teardown**: Proper test setup and cleanup |
| 48 | + |
| 49 | +## Package-Specific Priorities |
| 50 | + |
| 51 | +### Critical Packages (Highest Priority) |
| 52 | +- **@packages/server**: The heart of Cypress - changes affect everything |
| 53 | + - Focus: Async operations, file system security, proxy logic, performance, cross-platform compatibility |
| 54 | +- **@packages/driver**: Runs in browser context - security and compatibility crucial |
| 55 | + - Focus: Browser compatibility, DOM safety, network stubbing, test commands, memory management |
| 56 | +- **cli**: Main command-line interface - user-facing entry point |
| 57 | + - Focus: Command-line argument parsing, user experience, error handling, cross-platform compatibility |
| 58 | + |
| 59 | +### User-Facing Packages (High Priority) |
| 60 | +- **@packages/app**: Main desktop application |
| 61 | + - Focus: UI/UX, Vue component logic, accessibility, state management, performance |
| 62 | +- **@packages/launchpad**: Project setup UI |
| 63 | + - Focus: User experience, GraphQL integration, onboarding flow, project scaffolding |
| 64 | +- **@packages/runner**: Test runner interface |
| 65 | + - Focus: React component logic, UI state management, test execution display |
| 66 | + |
| 67 | +### Published Packages (High Priority) |
| 68 | +- **@cypress/* packages**: Published to npm - breaking changes critical |
| 69 | + - Focus: Backward compatibility, documentation, comprehensive testing, API stability |
| 70 | +- **@cypress/vue**: Vue component testing support |
| 71 | + - Focus: Vue integration, component testing logic, Vue 3 compatibility |
| 72 | +- **@cypress/react**: React component testing support |
| 73 | + - Focus: React integration, component testing logic, React version compatibility |
| 74 | +- **@cypress/angular**: Angular component testing support |
| 75 | + - Focus: Angular integration, component testing logic, Angular CLI integration |
| 76 | +- **@cypress/vite-dev-server**: Vite development server integration |
| 77 | + - Focus: Vite integration, dev server configuration, ESM compatibility |
| 78 | + |
| 79 | +### Core Infrastructure (High Priority) |
| 80 | +- **@packages/config**: Configuration management |
| 81 | + - Focus: Configuration schema changes, validation logic, backward compatibility |
| 82 | +- **@packages/errors**: Error handling |
| 83 | + - Focus: Error message clarity, error handling patterns, user-friendly messages |
| 84 | +- **@packages/types**: TypeScript definitions |
| 85 | + - Focus: Type safety, API compatibility, public interface definitions |
| 86 | +- **@packages/network**: Network utilities |
| 87 | + - Focus: Network security, request/response handling, HTTP client utilities |
| 88 | +- **@packages/proxy**: Proxy management |
| 89 | + - Focus: Proxy security, traffic handling, request interception |
| 90 | +- **@packages/net-stubbing**: Network stubbing |
| 91 | + - Focus: Stubbing logic, network simulation accuracy, request mocking |
| 92 | +- **@packages/https-proxy**: HTTPS proxy functionality |
| 93 | + - Focus: HTTPS security, certificate management, SSL/TLS handling |
| 94 | + |
| 95 | +### Browser & Platform (High Priority) |
| 96 | +- **@packages/launcher**: Browser management |
| 97 | + - Focus: Cross-platform compatibility, browser binary handling, process management |
| 98 | +- **@packages/electron**: Electron integration |
| 99 | + - Focus: Electron API usage, binary packaging, cross-platform builds, app distribution |
| 100 | +- **@packages/extension**: Browser extension |
| 101 | + - Focus: Extension API usage, browser compatibility, communication protocols |
| 102 | + |
| 103 | +### Data & State Management (Medium Priority) |
| 104 | +- **@packages/data-context**: Data management |
| 105 | + - Focus: State management patterns, data consistency, application state |
| 106 | +- **@packages/graphql**: GraphQL layer |
| 107 | + - Focus: GraphQL schema changes, resolver logic, API schema definition |
| 108 | +- **@packages/socket**: WebSocket communication |
| 109 | + - Focus: Socket security, message handling, real-time communication |
| 110 | + |
| 111 | +### Code Processing (Medium Priority) |
| 112 | +- **@packages/rewriter**: Code rewriting |
| 113 | + - Focus: Code transformation logic, source map accuracy, JavaScript instrumentation |
| 114 | +- **@packages/v8-snapshot-require**: V8 snapshot support |
| 115 | + - Focus: Snapshot compatibility, performance impact, Electron integration |
| 116 | +- **@packages/packherd-require**: Dependency packing |
| 117 | + - Focus: Bundle optimization, dependency management, module resolution |
| 118 | + |
| 119 | +### UI & Frontend (Medium Priority) |
| 120 | +- **@packages/frontend-shared**: Shared frontend utilities |
| 121 | + - Focus: Component reusability, utility functions, shared UI components |
| 122 | +- **@packages/icons**: Icon assets |
| 123 | + - Focus: Asset organization, icon consistency, visual design |
| 124 | +- **@packages/reporter**: Test reporting |
| 125 | + - Focus: Report accuracy, formatting logic, test result display |
| 126 | + |
| 127 | +### Development & Build (Medium Priority) |
| 128 | +- **@packages/ts**: TypeScript configuration |
| 129 | + - Focus: TypeScript configuration, compilation setup, type checking |
| 130 | +- **@packages/web-config**: Web configuration |
| 131 | + - Focus: Configuration logic, build setup, web app configuration |
| 132 | +- **@packages/scaffold-config**: Project scaffolding |
| 133 | + - Focus: Scaffolding logic, template accuracy, project initialization |
| 134 | + |
| 135 | +### Utility Packages (Lower Priority) |
| 136 | +- **@packages/root**: Root package (dummy package) |
| 137 | + - Focus: Monorepo setup, package coordination |
| 138 | +- **@packages/example**: Example project |
| 139 | + - Focus: Example accuracy, documentation quality, test examples |
| 140 | +- **@packages/resolve-dist**: Path resolution |
| 141 | + - Focus: Asset resolution, path handling, build artifact management |
| 142 | + |
| 143 | +### Tooling Packages (Lower Priority) |
| 144 | +- **@tooling/electron-mksnapshot**: Electron snapshot tool |
| 145 | + - Focus: Snapshot generation logic, Electron integration, performance optimization |
| 146 | +- **@tooling/packherd**: Dependency packing tool |
| 147 | + - Focus: Bundle optimization, dependency resolution, module bundling |
| 148 | +- **@tooling/v8-snapshot**: V8 snapshot tooling |
| 149 | + - Focus: Snapshot management, performance optimization, V8 integration |
| 150 | + |
0 commit comments