Welcome to Campus development! This guide will help you understand our development workflow and get you contributing quickly.
Campus uses a simple three-branch model designed for educational development:
weekly β staging β main
main- Stable, production-ready packages for external projectsstaging- Extended testing, migration validation, pre-production qualityweekly- Active development, all new work, expected breakage welcome!
# Clone the repository
git clone https://github.com/nyjc-computing/campus.git
cd campus
# Switch to active development branch
git checkout weekly
# Install dependencies
poetry installWe use GitHub Pull Requests for all changes to teach proper collaborative development practices.
# Create your feature branch from weekly
git checkout weekly
git pull origin weekly
git checkout -b feature/your-feature-name
# Make your changes
# ... edit files ...
# Test your changes
python run_tests.py
cd campus/vault && poetry build # Test individual packages
# Commit and push
git add .
git commit -m "feat: describe your changes"
git push origin feature/your-feature-nameAll changes must go through Pull Requests - no direct pushes to weekly/staging/main.
- Go to GitHub and create a Pull Request
- Target branch:
weekly(for all development work) - Title: Clear, descriptive title (e.g., "feat: add user authentication", "fix: resolve import circular dependency")
- Description:
- What you changed and why
- Testing you performed
- Any breaking changes or special considerations
- Automated checks: CI/CD will test your changes across all packages
- Code review: Maintainers or peers review your code
- Feedback: Address any requested changes
- Approval: Once approved, maintainers will merge
Educational Goal: This mirrors real-world software development practices!
For all development work:
- Target:
weekly - Use for: New features, bug fixes, experiments, infrastructure improvements
Never target main or staging directly - these are managed through the promotion flow.
Examples:
# New authentication feature
git checkout weekly
git checkout -b feature/oauth-integration
# PR: feature/oauth-integration β weekly
# Fix package build issue
git checkout weekly
git checkout -b fix/poetry-dependencies
# PR: fix/poetry-dependencies β weeklyAll promotions happen through Pull Requests to maintain transparency and teach best practices.
All promotions to higher stability levels require Pull Requests and review.
After weekly sprint review, stable features get promoted:
# Create PR from weekly to staging
git checkout weekly
git pull origin weekly
# Create Pull Request: weekly β staging
# Title: "promote: weekly sprint [YYYY-MM-DD] to staging"
# Review and merge via GitHub UIAfter extended validation (typically end of term):
# Create PR from staging to main
git checkout staging
git pull origin staging
# Create Pull Request: staging β main
# Title: "release: promote staging to production main"
# Review and merge via GitHub UI
# Tag the release: git tag v1.x.x && git push origin v1.x.xChanges flow automatically from higher to lower stability branches since they were already reviewed.
When changes are merged to main, they automatically flow downstream:
- Main β Staging: Automated merge (no PR needed)
- Main β Weekly: Automated merge (no PR needed)
- Staging β Weekly: Automated merge when staging is updated
Rationale: These changes were already reviewed and approved when going upstream, so they should be reflected in all downstream environments without manual overhead.
Only for emergencies:
- Security fixes requiring immediate deployment
- All other changes go through the upstream PR flow
Teaching Goal: Contributors learn that production systems require review processes, but approved changes flow efficiently downstream!
Campus is organized as modular packages:
campus/
βββ common/ # Shared utilities (no dependencies)
βββ vault/ # Secrets management (depends on common)
βββ client/ # External API integrations (depends on common)
βββ models/ # Data models (depends on common)
βββ storage/ # Storage interfaces (depends on common + vault)
βββ apps/ # Web applications (depends on all others)
- Clear dependencies - Follow the dependency flow diagram
- Independent builds - Each package builds on its own
- Lazy loading - External resources loaded only when needed
- Environment isolation - Packages work without production secrets
# Test a specific package builds
cd campus/vault && poetry build
cd campus/common && poetry build
# Run package tests
python run_tests.py# Run all tests
python run_tests.py
# (If you need to test integration across packages, ensure all relevant packages are installed and importable.)
# Example:
# python -c "import campus.client, campus.vault; print('β
Core packages import successfully')"Our GitHub Actions will automatically:
- Build all packages independently
- Run the full test suite
- Validate dependency ordering
- Check for import issues
This workflow teaches:
- Industry-standard branching (weekly/staging/main mirrors dev/staging/production)
- Release management (controlled promotion between environments)
- Quality gates (testing at each stability level)
- Modular architecture (independent, composable packages)
- Follow existing patterns in the codebase
- Use type hints where appropriate
- Add docstrings for public functions
- Keep functions focused and testable
Use conventional commit format:
feat: add new user authentication method
fix: resolve circular import in storage module
docs: update API documentation
test: add coverage for vault access controls
- Add tests for new functionality
- Ensure existing tests still pass
- Test package builds independently
- Update documentation as needed
- Python 3.11+ - Language runtime
- Poetry - Dependency management
- Git - Version control
# Install Poetry if not already installed
curl -sSL https://install.python-poetry.org | python3 -
# Configure Poetry for this project
poetry config virtualenvs.in-project true
poetry install
# Install pre-commit hooks (optional)
poetry run pre-commit install- Check dependency ordering in the package architecture
- Ensure you're importing from the correct package
- Use lazy loading for external resources
- Verify all dependencies are in pyproject.toml
- Check for circular dependencies
- Ensure environment variables are handled gracefully
- Run tests locally before pushing
- Check that mock data is properly set up
- Verify database connections use lazy loading
- Documentation: Check package-specific READMEs in each
campus/subdirectory - Issues: Report bugs via GitHub Issues
- Discussions: Ask questions in GitHub Discussions
- Code Review: Tag maintainers in your pull requests
Campus is developed by the NYJC Computing Department as both:
- Educational tool - Learn modern Python architecture patterns
- Practical platform - Solve real institutional management needs
Your contributions help other developers learn while building something genuinely useful!
Ready to contribute? Create your feature branch from weekly and start building! π