Skip to content

Git Workflow

The CPR backend follows a branch-based Git workflow.

Branch Strategy

BranchPurposeDeployed To
masterProduction-ready codeProduction
feature/*New featuresPreview
fix/*Bug fixesPreview
refactor/*Code refactoringPreview

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 master

Commit Convention

Follow conventional commit messages:

PrefixUse 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 route

Before Creating a PR

Run the quality check suite:

bash
# Format code
composer pint

# Static analysis
composer stan

# Run all tests
composer test

Pull 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

CPR - Clinical Patient Records