GitHub Workflow
Overview
This document describes how to effectively collaborate on the pyicub project using GitHub. Our team uses a trunk-based development approach. This means that all work is centered around a single primary branch: master. All new code is merged into this branch through short-lived, goal-oriented branches.
This document is written to help developers understand how to contribute safely and effectively.
Branching Strategy
We use a simple and scalable branching strategy:
Branch Name |
Protected? |
Base Branch |
Description |
|---|---|---|---|
|
YES |
N/A |
The main production branch. All stable code lives here. |
|
NO |
|
Short-lived branches for new features. Merged into |
|
NO |
|
Short-lived branches for small fixes. Merged into |
|
YES |
|
Long-term release branches for major or divergent versions of the library. |
Key Points:
``master`` is the trunk: All production-ready code goes here.
``feature/*`` branches are created to develop isolated features. They are merged into
masteronce completed and reviewed.``bugfix/*`` branches are used for fixing specific bugs and are merged into
masterwith the corresponding version bump (usually PATCH).``vX.Y`` branches are created when major changes require a divergence (e.g., a move from
icubSimtogazebo). These branches are independently maintained and versioned.
Typical Development Workflow
Start from master
git checkout master git pull origin master
Create your feature or bugfix branch
git checkout -b feature/my-new-feature
Make your changes locally
Commit regularly with meaningful messages
git commit -m "feat: add new grasp controller"
We encourage using Conventional Commits where possible:
feat:for new featuresfix:for bug fixesdocs:for documentationrefactor:for internal refactoring without behavior change
Push your branch and open a pull request (PR)
git push origin feature/my-new-feature
Open the PR from GitHub.
Clearly describe what the PR does.
Link to any related issues.
Assign reviewers.
Get the code reviewed and approved
Every Pull Request must be reviewed by at least one team member.
Ensure all tests pass (local and CI checks).
Merge into master
Once approved and tested, merge the PR into
master.
Hotfixes
If an urgent bug is discovered in production:
Create a bugfix branch from
master:git checkout master git pull origin master git checkout -b bugfix/fix-title-error
Apply and commit the fix, then merge into
master.Bump the PATCH version and tag the release.
> For how to tag releases and version properly, refer to the Tagging Releases section in Releases.
If the bug also affects an older version (e.g.,
v0.3), cherry-pick the fix into that version branch.
Best Practices
One task per branch: keep changes isolated and easy to review.
Use clear, descriptive branch and commit names.
Never push to
masterdirectly — always use PRs.Keep branches up to date with
masterto avoid conflicts.Delete merged branches to keep the repository clean.