-
-
Notifications
You must be signed in to change notification settings - Fork 0
DevelopmentWorkflow.md
This document covers Git workflow, branching strategy, pull requests, and CI/CD processes.
OpenCashFlow uses a modified GitFlow workflow with three main environments:
Feature Branches → main → Staging → Production
| Branch | Purpose | Naming Convention |
|---|---|---|
main |
Primary development branch | main |
feature/* |
New features | feature/add-payment-export |
bugfix/* |
Bug fixes | bugfix/fix-login-redirect |
hotfix/* |
Urgent production fixes | hotfix/security-patch |
chore/* |
Maintenance tasks | chore/update-dependencies |
docs/* |
Documentation updates | docs/update-readme |
- Use lowercase letters
- Use hyphens to separate words
- Be descriptive but concise
- Include ticket number if applicable
Good examples:
feature/payment-calendar-viewbugfix/ocf-123-fix-null-referencechore/upgrade-dotnet-9
Bad examples:
-
Feature/PaymentCalendar(wrong case) -
fix_bug(underscores, not descriptive) -
john-working-on-stuff(not descriptive)
# Ensure main is up to date
git checkout main
git pull origin main
# Create feature branch
git checkout -b feature/your-feature-name# Make your changes
# ...
# Stage changes
git add specific-files.cs
# Commit with descriptive message
git commit -m "Add payment export functionality
- Implement CSV export for payments
- Add date range filtering
- Include unit tests"# Regularly sync with main
git fetch origin
git rebase origin/main
# Resolve any conflicts
# ...
git rebase --continuegit push origin feature/your-feature-name<type>: <short summary>
<optional body>
<optional footer>
| Type | Use Case |
|---|---|
feat |
New feature |
fix |
Bug fix |
docs |
Documentation only |
style |
Code style (formatting, semicolons) |
refactor |
Code change that neither fixes nor adds |
perf |
Performance improvement |
test |
Adding or updating tests |
chore |
Maintenance (deps, build, etc.) |
# Simple commit
git commit -m "feat: add payment export to CSV"
# Detailed commit
git commit -m "fix: resolve null reference in payment service
The PaymentService.GetByIdAsync was throwing a NullReferenceException
when the payment was not found instead of returning null.
Fixes #123"- Atomic commits - Each commit should be a single logical change
- Present tense - "Add feature" not "Added feature"
- No period - Don't end the summary with a period
- 72 characters - Keep summary under 72 characters
- Explain why - The body should explain why, not what
- Push your branch to GitHub
- Navigate to the repository
- Click "New Pull Request"
- Select your branch as the source
- Fill in the PR template
## Summary
Brief description of the changes.
## Changes
- List of specific changes made
- Another change
- And another
## Testing
- [ ] Unit tests pass
- [ ] Integration tests pass
- [ ] Manual testing completed
## Screenshots (if applicable)
Include screenshots for UI changes.
## Related Issues
Closes #123Before requesting review:
- Code compiles without warnings
- All tests pass
- No unnecessary console.log/debug statements
- Code follows project conventions
- Documentation updated if needed
- Self-reviewed the diff
- Author creates PR and requests review
- Reviewers comment on code
- Author addresses feedback
- Reviewers approve
- Author merges (squash)
When reviewing:
- Focus on logic, security, and maintainability
- Ask questions rather than make demands
- Approve with minor comments if changes are optional
- Request changes for critical issues only
All PRs should be squash merged to keep history clean:
feature/add-export (5 commits) → main (1 squashed commit)
- Clean, linear history
- Each commit on main is a complete feature
- Easy to revert entire features
- Clear blame history
Use merge commits only for:
- Merging long-lived branches
- Preserving detailed history when necessary
Triggered on: Push/PR to main
Steps:
1. Checkout code
2. Setup .NET 9.0
3. Restore dependencies
4. Build solution
5. Run testsTriggered on: Tag vX.Y.Z-RC or component tags
Steps:
1. Build selected components
2. Create publish artifacts
3. Create Docker bundles
4. Create GitHub Release (prerelease)Triggered on: Stable tag vX.Y.Z
Steps:
1. Verify RC tag exists
2. Download RC artifacts (no rebuild)
3. Create production release| Tag Format | Environment | Example |
|---|---|---|
vX.Y.Z-RC |
Staging | v1.2.0-RC |
vX.Y.Z |
Production | v1.2.0 |
app-vX.Y.Z |
App only | app-v1.2.0 |
api-vX.Y.Z |
API only | api-v1.2.0 |
admin-vX.Y.Z |
Admin only | admin-v1.2.0 |
# Create RC for staging
git tag v1.2.0-RC
git push origin v1.2.0-RC
# After staging verification, create production release
git tag v1.2.0
git push origin v1.2.0┌─────────────────────────────────────────────────────────────┐
│ Development │
│ - Feature branches merged to main │
│ - Automated tests run on every PR │
│ - Local development with hot reload │
└─────────────────────────────────┬───────────────────────────┘
│
Tag: vX.Y.Z-RC
│
▼
┌─────────────────────────────────────────────────────────────┐
│ Staging │
│ - Pre-release builds deployed │
│ - Integration testing │
│ - QA verification │
│ - Security scanning (OWASP ZAP) │
└─────────────────────────────────┬───────────────────────────┘
│
Tag: vX.Y.Z
│
▼
┌─────────────────────────────────────────────────────────────┐
│ Production │
│ - Same artifacts as staging (no rebuild) │
│ - Monitoring active │
│ - Hotfix process if issues found │
└─────────────────────────────────────────────────────────────┘
For critical production issues:
# Create hotfix branch from production tag
git checkout -b hotfix/critical-fix v1.2.0
# Make fix
git commit -m "fix: resolve critical security issue"
# Create new patch version
git tag v1.2.1-RC
git push origin hotfix/critical-fix v1.2.1-RC
# After staging verification
git tag v1.2.1
git push origin v1.2.1
# Merge back to main
git checkout main
git merge hotfix/critical-fix
git push origin main-
Create migration on feature branch:
./scripts/create-migration.sh AddNewFeature
-
Test migration locally:
./scripts/create-migration.sh AddNewFeature --apply
-
Include migration in PR
-
Migration runs automatically on deployment
- Migrations should be reversible when possible
- Test both up and down migrations
- Never edit an applied migration
- Small, focused migrations over large ones
The project includes .editorconfig for consistent formatting:
[*.cs]
indent_style = space
indent_size = 4
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true# Format all C# files
dotnet format
# Check formatting without changing files
dotnet format --verify-no-changesAll PRs must pass:
- Unit tests - Test individual components
- Integration tests - Test API endpoints
- Build verification - Solution compiles without errors
# Run all tests
dotnet test
# Run with coverage
dotnet test --collect:"XPlat Code Coverage"
# Run specific project
dotnet test tests/OpenCashFlow.Test/OpenCashFlow.Test.csproj- Create
chore/update-dependenciesbranch - Update packages:
dotnet outdated dotnet add package <PackageName> --version <NewVersion>
- Run tests
- Create PR with changelog of updates
Security updates should be:
- Applied promptly
- Tested thoroughly
- Deployed through normal CI/CD pipeline
- For critical vulnerabilities, use hotfix process
When to update documentation:
- Adding new features
- Changing existing behavior
- Updating configuration options
- Modifying API endpoints
Project status
OpenCashFlow is under active development.
APIs, database schema, and UI may change until the first stable release.
Built with
.NET · ASP.NET Core · Entity Framework Core · PostgreSQL · Tabler
© 2026 OpenCashFlow
- Developer Preview
- Not production-ready
- First-run setup included