Skip to content

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

  1. Create PR from feature/* into dev
  2. Self-review: check diff carefully before requesting review
  3. Checklist:
  4. [ ] No hardcoded secrets
  5. [ ] No debug print() statements left in
  6. [ ] Error handling for S3 and DB operations
  7. [ ] Tested locally end-to-end
  8. [ ] No changes to BoundedSemaphore(4) or --workers=1 without RAM validation
  9. Founder review: all PRs to main require founder approval
  10. 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 devmain, 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.env or sendgrid.env (secrets)
  • instance/DSS_local.db (local database)
  • __pycache__/ and .pyc files (should be in .gitignore)
  • Large test files or binary blobs
  • API keys or master keys anywhere in code

TL;DR

Branch: feature/*devmain. 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.