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?


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:

git checkout -b feat/axp2101-driver

3. Implement, Comment, Document, and Test Locally

Every PR must include:

  1. Clean, well-commented C (Doxygen) / Python (docstrings) code.
  2. Updated tutorials / Wiki pages under docs/wiki/ whenever public APIs or user workflows change.
  3. 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:

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!