Git Workflow¶
Branch Strategy¶
| Branch | Purpose | Auto-deploy? |
|---|---|---|
main |
Production-ready code | Yes (Render) |
dev |
Active development, integration | No |
feature/<name> |
Individual feature work | No |
fix/<name> |
Bug fixes | No |
hotfix/<name> |
Emergency production fix | No |
feature/razorpay-webhook → PR → dev → tested → PR → main → auto-deploy
Never commit directly to main. Never commit directly to dev for significant changes.
Branch Naming¶
```bash
Feature¶
git checkout -b feature/android-upload-resume
Bug fix¶
git checkout -b fix/hmac-registry-cleanup
Hotfix (emergency)¶
git checkout -b hotfix/gunicorn-timeout-crash ```
- Use kebab-case
- Keep names short but descriptive
- Reference the ticket/issue number if applicable:
feature/123-razorpay-webhook
Commit Message Standards¶
```
[optional body] ```
| Type | When to Use |
|---|---|
feat |
New feature |
fix |
Bug fix |
refactor |
Code restructure without behavior change |
docs |
Documentation only |
chore |
Build, config, dependency updates |
security |
Security improvement |
perf |
Performance improvement |
Examples:
feat: add Razorpay webhook handler for subscription activation
fix: handle NoSuchUpload gracefully in encrypted complete route
security: validate part_size >= 5MB before encrypted upload initiation
perf: reduce baseline RAM by lazy-loading cv2 and numpy
Pull Request Process¶
- Create PR from
feature/*intodev - Self-review: check diff carefully before requesting review
- Checklist:
- [ ] No hardcoded secrets
- [ ] No debug
print()statements left in - [ ] Error handling for S3 and DB operations
- [ ] Tested locally end-to-end
- [ ] No changes to
BoundedSemaphore(4)or--workers=1without RAM validation - Founder review: all PRs to
mainrequire founder approval - Merge: squash merge preferred for feature branches, regular merge for hotfixes
Merging to Production¶
```bash
After dev is tested and stable:¶
git checkout main git merge dev git push origin main
Render auto-deploys¶
```
Or via GitHub: PR from dev → main, founder approves, merge button.
Emergency Hotfix¶
```bash
Branch from main directly¶
git checkout main git checkout -b hotfix/gunicorn-oom-crash
Make minimal fix¶
git add . git commit -m "hotfix: reduce BoundedSemaphore to prevent OOM on Starter plan" git push origin hotfix/gunicorn-oom-crash
PR directly to main (skip dev)¶
After merge to main, merge main back into dev¶
```
What NOT to Commit¶
render.envorsendgrid.env(secrets)instance/DSS_local.db(local database)__pycache__/and.pycfiles (should be in.gitignore)- Large test files or binary blobs
- API keys or master keys anywhere in code
TL;DR¶
Branch: feature/* → dev → main. Never push to main directly. Commits: Typed messages (feat:, fix:, etc.). PRs: Self-review checklist, founder approval for main. Hotfix: Branch from main, fix, PR to main, then merge main back to dev.