Tutorial: Industry-Standard GitHub PR Workflow
PylotOS follows the standard open-source Protected main + Feature Branch + Squash & Merge PR workflow (the same model used by MicroPython, ESP-IDF, and major open-source OS projects).
Why This Workflow?
mainis always green and deployable: GitHub Branch Protection blocks direct force pushes and requiresLint & Host Unit Tests+Build Firmware (m5stack_core2)to pass before merging.- Clean linear Git history: Even if you make 10 experimental WIP commits on a feature branch, Squash & Merge collapses them into a single, crystal-clear Conventional Commit on
main. - Automatic cleanup: Merged feature branches are automatically deleted on GitHub.
Step-by-Step Daily Workflow
1. Start From an Up-to-Date main
git checkout main
git pull --ff-only origin main
2. Create a Descriptive Branch
Use a short prefix matching the type of change:
feat/<topic>— new driver, board, or feature (e.g.,feat/axp2101-driver)fix/<topic>— bug fix (e.g.,fix/core2-spi-mutex)docs/<topic>— tutorials, Wiki pages, README updates
git checkout -b feat/axp2101-driver
3. Implement, Comment, Document, and Test Locally
Every PR must include:
- Clean, well-commented C (Doxygen) / Python (docstrings) code.
- Updated tutorials / Wiki pages under
docs/wiki/whenever public APIs or user workflows change. - Passing local checks:
ruff check tools kernel tests
pytest -v
4. Commit with Conventional Commits & Push
git add -A
git commit -m "feat(pmic): add AXP2101 driver with Core2 v1.1 auto-detection"
git push -u origin feat/axp2101-driver
5. Open a Pull Request & Wait for Green CI
gh pr create --base main --fill
GitHub Actions will automatically run:
- Lint & Host Unit Tests (~15s)
- Build Firmware (
m5stack_core2) (~2–3 min inespressif/idf:v5.5.2)
6. Squash & Merge, Then Sync Local main
Once all checks are green and the PR is reviewed:
gh pr merge --squash --delete-branch
git checkout main
git pull --ff-only origin main
Your main branch now has one clean commit, the feature branch is gone, and any docs/wiki/ changes automatically sync to the GitHub Wiki!