Git Workflow
The CPR backend follows a branch-based Git workflow.
Branch Strategy
| Branch | Purpose | Deployed To |
|---|---|---|
master | Production-ready code | Production |
feature/* | New features | Preview |
fix/* | Bug fixes | Preview |
refactor/* | Code refactoring | Preview |
Development Flow
1. Create feature branch from master
git checkout -b feature/your-feature master
2. Develop and commit changes
git add <files>
git commit -m "feat: description of changes"
3. Push and create Pull Request
git push -u origin feature/your-feature
4. Code review and approval
5. Merge to masterCommit Convention
Follow conventional commit messages:
| Prefix | Use Case |
|---|---|
feat: | New feature |
fix: | Bug fix |
refactor: | Code refactoring |
test: | Adding or updating tests |
chore: | Tooling, dependencies, config |
docs: | Documentation changes |
Examples:
feat: add indirect ophthalmoscopy module
fix: transaction amount column type
refactor: IndirectOphthalmoscopy validation
test: indirect-ophthalmoscopy db setup test
chore: indirect_ophthalmoscopies routeBefore Creating a PR
Run the quality check suite:
bash
# Format code
composer pint
# Static analysis
composer stan
# Run all tests
composer testPull Request Guidelines
- Keep PRs focused on a single feature or fix
- Include tests for new functionality
- Update API documentation if endpoints change
- Ensure all tests pass before requesting review
- Reference any related issues in the PR description