Contributing to OpenCoopControl
Thank you for your interest in contributing to OpenCoopControl! This document outlines the process for contributing to the project and explains our branch structure and development workflow.
Branch Structure
We use the following branch structure:
main
- The production branch containing stable codedevelop
- Integration branch for features before they go to mainfeature/*
- Feature branches for new functionalitybugfix/*
- Branches for bug fixesrelease/*
- Release candidate brancheshotfix/*
- Emergency fixes for production issues
Development Workflow
Starting a New Feature
-
Create a new branch from
develop
:Terminal window git checkout developgit pullgit checkout -b feature/your-feature-name -
Make your changes, commit them with descriptive messages:
Terminal window git add .git commit -m "Add feature X that does Y" -
Push your branch:
Terminal window git push -u origin feature/your-feature-name -
Create a Pull Request to merge your changes into
develop
Creating a Bug Fix
-
Create a new branch from
develop
(ormain
for critical fixes):Terminal window git checkout developgit pullgit checkout -b bugfix/issue-description -
Fix the bug, commit your changes:
Terminal window git add .git commit -m "Fix issue with Z" -
Push your branch and create a Pull Request
Creating a Release
-
When
develop
is ready for release, create a release branch:Terminal window git checkout developgit pullgit checkout -b release/v1.0.0 -
Make any final adjustments, version number updates, etc.
-
Create a Pull Request to merge into
main
-
After merging to
main
, tag the release:Terminal window git checkout maingit pullgit tag -a v1.0.0 -m "Release v1.0.0"git push origin v1.0.0
Coding Standards
- Use consistent indentation (spaces, not tabs)
- Include comments for complex logic
- Follow the existing code style
- Keep functions focused on a single responsibility
- Add descriptive comments for pin configurations and hardware connections
Testing
Before submitting a pull request:
- Test your changes on actual ESP32 hardware if possible
- Ensure the build succeeds with PlatformIO
- Verify that your changes don’t break existing functionality
Commit Messages
Write clear, descriptive commit messages that explain what changes were made and why:
- Start with a short summary (50 chars or less)
- Use the imperative mood (“Add feature” not “Added feature”)
- Reference issue numbers when applicable (“Fix #123: Resolve door timing issue”)
Pull Requests
When submitting a pull request:
- Describe the changes you’ve made
- Explain why these changes are necessary
- Mention any breaking changes
- Include screenshots for UI changes
- Reference related issues
Documentation
Update the relevant documentation when adding or changing features:
- Update the README.md if necessary
- Document new settings or configuration options
- Add comments to explain complex code sections
Development Environment
We provide Docker configuration for a consistent development environment:
# Build and start the development containerdocker-compose up -d
# Enter the containerdocker-compose exec dev bash
# Build the project within the containerplatformio run
Alternatively, you can set up your local environment using our setup scripts:
- Windows:
setup-dev-env.bat
- Linux/Mac:
setup-dev-env.sh
Getting Help
If you have questions or need help with anything, please:
- Check existing issues to see if your question has been answered
- Open a new issue with the “question” label
- Provide as much detail as possible about your problem or question
Thank you for contributing to OpenCoopControl!