|
| 1 | +# Contribution Guidelines |
| 2 | + |
| 3 | +## Development |
| 4 | + |
| 5 | +### Code of Conduct |
| 6 | + |
| 7 | +We are committed to providing a friendly, safe, and welcoming environment for all contributors. Please read and follow our [Code of Conduct](CODE_OF_CONDUCT.md). |
| 8 | + |
| 9 | +### Getting Started |
| 10 | + |
| 11 | +1. **Fork the repository** on GitHub. |
| 12 | +2. **Clone your fork** locally: |
| 13 | + ```bash |
| 14 | + git clone https://github.com/YOUR-USERNAME/kmcp.git |
| 15 | + cd kmcp |
| 16 | + ``` |
| 17 | +3. **Add the upstream repository** as a remote: |
| 18 | + ```bash |
| 19 | + git remote add upstream https://github.com/kagent-dev/kmcp.git |
| 20 | + ``` |
| 21 | +4. **Create a new branch** for your changes: |
| 22 | + ```bash |
| 23 | + git checkout -b feature/your-feature-name |
| 24 | + ``` |
| 25 | + |
| 26 | +### Development Environment Setup |
| 27 | + |
| 28 | +See the [DEVELOPMENT.md](DEVELOPMENT.md) file for more information. |
| 29 | + |
| 30 | +### Making Changes |
| 31 | + |
| 32 | +If you are making significant improvements to the kmcp project, please create a design document using the [design template](design/template.md) and submit it as a pull request on GitHub. |
| 33 | + |
| 34 | +#### Coding Standards |
| 35 | + |
| 36 | +- **Go Code**: |
| 37 | + - Follow the [Go Code Review Comments](https://go.dev/wiki/CodeReviewComments) |
| 38 | + - Run `make lint` before submitting your changes |
| 39 | + - Ensure all tests pass with `make test` |
| 40 | + - Add tests for new functionality |
| 41 | + |
| 42 | +- **Python Code**: |
| 43 | + - check formatting with `uv run ruff check` |
| 44 | + - check linting with `uv run ruff format` |
| 45 | + - Use type hints where appropriate |
| 46 | + - Run tests with `uv run pytest` |
| 47 | + |
| 48 | +#### Commit Guidelines |
| 49 | + |
| 50 | +We follow the [Conventional Commits](https://www.conventionalcommits.org/) specification: |
| 51 | + |
| 52 | +- **feat**: A new feature |
| 53 | +- **fix**: A bug fix |
| 54 | +- **docs**: Documentation only changes |
| 55 | +- **style**: Changes that do not affect the meaning of the code |
| 56 | +- **refactor**: A code change that neither fixes a bug nor adds a feature |
| 57 | +- **perf**: A code change that improves performance |
| 58 | +- **test**: Adding missing tests or correcting existing tests |
| 59 | +- **chore**: Changes to the build process or auxiliary tools |
| 60 | + |
| 61 | +Example commit message: |
| 62 | +``` |
| 63 | +feat(controller): add support for custom resource validation |
| 64 | +
|
| 65 | +This adds validation for the MCPServer custom resource to ensure |
| 66 | +that the configuration is valid before applying it to the cluster. |
| 67 | +
|
| 68 | +Closes #123 |
| 69 | +``` |
| 70 | + |
| 71 | +### Pull Request Process |
| 72 | + |
| 73 | +1. **Update your fork** with the latest changes from upstream: |
| 74 | + ```bash |
| 75 | + git fetch upstream |
| 76 | + git rebase upstream/main |
| 77 | + ``` |
| 78 | + |
| 79 | +2. **Push your changes** to your fork: |
| 80 | + ```bash |
| 81 | + git push origin feature/your-feature-name |
| 82 | + ``` |
| 83 | + |
| 84 | +3. **Create a Pull Request** from your fork to the main repository. |
| 85 | + |
| 86 | +4. **Fill out the PR template** with all required information. |
| 87 | + |
| 88 | +5. **Address review comments** if requested by maintainers. |
| 89 | + |
| 90 | +6. **Update your PR** if needed: |
| 91 | + ```bash |
| 92 | + git add . |
| 93 | + git commit -m "address review comments" |
| 94 | + git push origin feature/your-feature-name |
| 95 | + ``` |
| 96 | + |
| 97 | +7. Once approved, a maintainer will merge your PR. |
| 98 | + |
| 99 | + |
| 100 | +### Documentation |
| 101 | + |
| 102 | +- Update documentation for any changes to APIs, CLIs, or user-facing features |
| 103 | +- Add examples for new features |
| 104 | +- Update the README if necessary |
| 105 | +- Add comments to your code explaining complex logic |
| 106 | + |
| 107 | +### Releasing |
| 108 | + |
| 109 | +Only project maintainers can create releases. The process is: |
| 110 | + |
| 111 | +1. Update version numbers in relevant files |
| 112 | +2. Create a release branch |
| 113 | +3. Create a tag for the release |
| 114 | +4. Build and publish artifacts |
| 115 | +5. Create a GitHub release with release notes |
| 116 | + |
| 117 | +### Community |
| 118 | + |
| 119 | +- Join our [Discord server](https://discord.gg/Fu3k65f2k3) for discussions |
| 120 | +- Participate in community calls (scheduled on our website) |
| 121 | +- Help answer questions in GitHub issues |
| 122 | +- Review pull requests from other contributors |
| 123 | + |
| 124 | +## License |
| 125 | + |
| 126 | +By contributing to this project, you agree that your contributions will be licensed under the project's license. |
| 127 | + |
| 128 | +## Questions? |
| 129 | + |
| 130 | +If you have any questions about contributing, please open an issue or reach out to the maintainers. |
0 commit comments