Before You Start
Discuss Large Changes
If you are planning a large change or new feature:- Post to the developer mailing list before you begin substantial work
- Check if anyone else is working on it
- Ensure it fits into the overall development plans
- Get feedback on your approach
Start Small
New contributors should start with:- Starter issues
- Bug fixes
- Small improvements
- Documentation updates
General Guidelines
1. Use Feature Branches
Always create a new branch for merge requests instead of using your fork’s master branch.fix/pcbnew-crash-on-exportfeature/add-svg-exportrefactor/simplify-footprint-loading
2. Follow Code Style
Ensure your code follows the KiCad Code Style Guide:- Use clang-format for formatting
- Follow naming conventions
- Match the existing code style in files you modify
- Run format checks before submitting
3. Follow UI Guidelines
If you are making User Interface changes, follow the User Interface Guidelines:- Consistent dialog layouts
- Proper keyboard shortcuts
- Accessibility considerations
- Use wxWidgets sizers appropriately
4. Write Good Commit Messages
Commit messages should: Use a descriptive first line:- Use
Fixes #123to automatically close issues - Use
Related to #123for related issues
5. Descriptive Merge Request Titles
Give merge requests a short and descriptive title that summarizes the major changes:- ✅ “Add support for IPC-2581 file import”
- ✅ “Fix crash when exporting Gerber with missing layers”
- ✅ “Refactor symbol library loading for better performance”
- ❌ “Updates”
- ❌ “Fix bug”
- ❌ “Changes to pcbnew”
6. Detailed Descriptions
The merge request description should contain:- What changed
- Why it changed
- How to test it
- Screenshots for UI changes
- Related issues or discussions
GitLab Configuration
Configure Your Fork
Before submitting merge requests, configure your personal fork:1. Enable CI/CD Visibility
Settings → General → Visibility → CI/CD- Set to “Everyone with access”
- This allows reviewers to see your pipeline results
2. Set Pipeline Timeout
Settings → CI/CD → General pipelines- Set timeout to 3 hours or longer
- KiCad builds can take time, especially on GitLab shared runners
3. Allow Maintainer Commits
When creating your merge request:- ✅ Check “Allow commits from members who can merge to the target branch” (bottom of MR form)
- This allows maintainers to make minor fixes directly
Creating a Merge Request
Step 1: Prepare Your Branch
Step 2: Push to Your Fork
Step 3: Create the Merge Request
- Go to https://gitlab.com/kicad/code/kicad/-/merge_requests/new
- Select your fork and branch as source
- Select
kicad/code/kicadandmasteras target - Fill in the template:
- Title
- Description
- Related issues
- ✅ Check “Allow commits from members who can merge to the target branch”
- Submit
CI Pipeline
When you create or update a merge request, the CI pipeline automatically runs:Build Tests
- Linux build
- Windows build
- macOS build (if applicable)
Code Quality Checks
- Format check (clang-format)
- Compiler warnings
- Build without errors
Unit Tests
- All QA tests must pass
ctestresults are checked
What If CI Fails?
Format Check Failure
Build Failure
- Check the CI logs for error messages
- Fix the issue locally first
- Test locally before pushing
- Ask for help on the merge request if stuck
Test Failure
Code Review Process
What to Expect
- Automated checks run immediately (CI pipeline)
- Maintainer review - A KiCad maintainer will review your code
- Feedback - You may receive comments and change requests
- Iteration - Make requested changes and push updates
- Approval - Once approved, a maintainer will merge your MR
Responding to Feedback
- Be responsive to reviewer comments
- Ask questions if you don’t understand feedback
- Make requested changes promptly
- Push updates to the same branch (don’t close and create new MRs)
Resolving Discussions
- Resolve discussions after addressing comments
- Use the “Resolve discussion” button on GitLab
- Add a comment explaining your changes
Common Issues and Solutions
Merge Conflicts
If your branch has conflicts with master:Format Check Disagreements
If clang-format suggests changes you disagree with:- Check the Code Style Guide for exceptions
- Rule 7: Follow existing file formatting when in doubt
- Comment on the MR explaining why you deviated
- Maintainers will provide guidance
CI Timeout
If your CI pipeline times out:- Check your fork’s pipeline timeout setting (should be 3+ hours)
- Consider splitting large changes into smaller MRs
- Contact maintainers if issues persist
Best Practices
Keep Changes Focused
- One feature or fix per merge request
- Don’t mix refactoring with feature changes
- Don’t include unrelated formatting changes
Write Tests
When adding new features:Update Documentation
If your change affects user-facing features:- Update relevant documentation
- Add comments to complex code
- Update Doxygen comments
Keep Commits Clean
Option 1: Squash Before Merging- Maintainers may squash your commits when merging
Test on Multiple Platforms
If possible, test your changes on:- Linux
- Windows
- macOS
After Your MR is Merged
Update Your Local Repository
Celebrate! 🎉
Your code is now part of KiCad! Your contribution helps thousands of users worldwide.Getting Help
If you need assistance:- Comment on your MR - Maintainers will respond
- Developer mailing list - https://groups.google.com/a/kicad.org/g/devlist
- Forum - https://forum.kicad.info/
- IRC/Matrix - Check the KiCad website for chat options
Additional Resources
- Contributing Guide: https://dev-docs.kicad.org/en/contribute/
- Code Style Guide: https://dev-docs.kicad.org/en/rules-guidelines/code-style/
- UI Guidelines: https://dev-docs.kicad.org/en/rules-guidelines/ui/
- GitLab Docs: https://docs.gitlab.com/ee/user/project/merge_requests/
Contributor Recognition
All contributors are recognized in:AUTHORS.txtfile in the repository- KiCad’s About dialog
- Release notes for major contributions