|
| 1 | +# CLAUDE.md |
| 2 | + |
| 3 | +This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository. |
| 4 | + |
| 5 | +## Project Overview |
| 6 | + |
| 7 | +This is a Django 4.2 application that manages commitfests for the PostgreSQL community. A commitfest is a collection of patches and reviews as part of the PostgreSQL development process. The application tracks patches, their status, reviews, and integrates with cfbot for automated testing. |
| 8 | + |
| 9 | +## Development Setup |
| 10 | + |
| 11 | +### Environment Setup |
| 12 | +```bash |
| 13 | +# Create virtual environment |
| 14 | +python3 -m venv env |
| 15 | +source env/bin/activate |
| 16 | +pip install -e '.[dev]' |
| 17 | + |
| 18 | +# Database setup |
| 19 | +createdb pgcommitfest |
| 20 | +cp pgcommitfest/local_settings_example.py pgcommitfest/local_settings.py |
| 21 | + |
| 22 | +# Run migrations |
| 23 | +./manage.py migrate |
| 24 | + |
| 25 | +# Load test data (optional) |
| 26 | +./manage.py loaddata auth_data.json |
| 27 | +./manage.py loaddata commitfest_data.json |
| 28 | +``` |
| 29 | + |
| 30 | +### Development Commands |
| 31 | + |
| 32 | +Start development server: |
| 33 | +```bash |
| 34 | +./run_dev.py |
| 35 | +``` |
| 36 | + |
| 37 | +Database management: |
| 38 | +```bash |
| 39 | +./manage.py migrate # Run migrations |
| 40 | +./manage.py createsuperuser # Create admin user |
| 41 | +./manage.py loaddata <file> # Load fixtures |
| 42 | +``` |
| 43 | + |
| 44 | +Code formatting and linting: |
| 45 | +```bash |
| 46 | +make format # Format code (ruff, biome, djhtml) |
| 47 | +make lint # Check code quality |
| 48 | +make lint-fix # Fix linting issues |
| 49 | +make lint-fix-unsafe # Fix linting issues (unsafe) |
| 50 | +make fix # Format + lint-fix-unsafe |
| 51 | +``` |
| 52 | + |
| 53 | +## Application Architecture |
| 54 | + |
| 55 | +### Core Django Apps |
| 56 | +- **pgcommitfest.commitfest**: Main application handling patches, commitfests, reviews |
| 57 | +- **pgcommitfest.mailqueue**: Email notification system |
| 58 | +- **pgcommitfest.userprofile**: User profile management and preferences |
| 59 | + |
| 60 | +### Key Models |
| 61 | +- **CommitFest**: Represents a commitfest period with status (Open/In Progress/Closed) |
| 62 | +- **Patch**: Individual patches with status tracking, reviews, and cfbot integration |
| 63 | +- **PatchOnCommitFest**: Links patches to specific commitfests |
| 64 | +- **MailThread**: Integration with PostgreSQL mailing list archives |
| 65 | +- **CfbotTask/CfbotBranch**: cfbot CI integration for automated testing |
| 66 | + |
| 67 | +### Authentication |
| 68 | +Custom authentication backend (`pgcommitfest.auth.AuthBackend`) integrates with PostgreSQL community authentication system. |
| 69 | + |
| 70 | +### Static Files and Media |
| 71 | +- Static files served from `/media/` (CSS, JS, images) |
| 72 | +- JavaScript: jQuery, Bootstrap, custom commitfest.js |
| 73 | +- CSS: Bootstrap with custom commitfest.css |
| 74 | + |
| 75 | +### Key Features |
| 76 | +- Patch status tracking (Waiting for Author, Needs Review, Ready for Committer, etc.) |
| 77 | +- Email notifications for patch updates |
| 78 | +- Integration with PostgreSQL mailing list archives |
| 79 | +- cfbot CI integration for automated testing |
| 80 | +- User subscription system for patches |
| 81 | +- Bulk email functionality for commitfest managers |
| 82 | + |
| 83 | +### Database |
| 84 | +PostgreSQL database with custom fields and constraints. Uses Django migrations for schema management. |
| 85 | + |
| 86 | +## Testing |
| 87 | + |
| 88 | +The application does not appear to have a formal test suite. Manual testing is done through: |
| 89 | +- Development server at http://localhost:8007 |
| 90 | +- Admin interface at http://localhost:8007/admin |
| 91 | +- Test data loaded via fixtures |
| 92 | + |
| 93 | +## Deployment |
| 94 | + |
| 95 | +- Staging: https://commitfest-test.postgresql.org/ (auto-deploys from main branch) |
| 96 | +- Production: Auto-deploys from prod branch |
| 97 | +- Uses uWSGI for serving (configured in uwsgi_dev.ini) |
0 commit comments