|
| 1 | +# Contributing |
| 2 | + |
| 3 | +Thank you for your interest in contributing to Jumpstarter! This document outlines the process for contributing to the project and provides guidelines to make the contribution process smooth. |
| 4 | + |
| 5 | +## Code of Conduct |
| 6 | + |
| 7 | +Please be respectful and considerate of others when contributing to the project. |
| 8 | + |
| 9 | +## Getting Started |
| 10 | + |
| 11 | +1. Fork the repository |
| 12 | +2. Clone your fork locally |
| 13 | +3. Set up the development environment |
| 14 | +4. Make your changes on a new branch |
| 15 | +5. Test your changes thoroughly |
| 16 | +6. Submit a pull request |
| 17 | + |
| 18 | +## Development Setup |
| 19 | + |
| 20 | +```bash |
| 21 | +# Install dependencies |
| 22 | +make sync |
| 23 | + |
| 24 | +# Run tests |
| 25 | +make test |
| 26 | +``` |
| 27 | + |
| 28 | +## Contribution Guidelines |
| 29 | + |
| 30 | +### Making Changes |
| 31 | + |
| 32 | +- Keep changes focused and related to a single issue |
| 33 | +- Follow the existing code style and conventions |
| 34 | +- Add tests for new features or bug fixes |
| 35 | +- Update documentation as needed |
| 36 | + |
| 37 | +### Commit Messages |
| 38 | + |
| 39 | +- Use clear and descriptive commit messages |
| 40 | +- Reference issue numbers when applicable |
| 41 | +- Follow conventional commit format when possible |
| 42 | + |
| 43 | +### Pull Requests |
| 44 | + |
| 45 | +- Provide a clear description of the changes |
| 46 | +- Link to any relevant issues |
| 47 | +- Ensure all tests pass before submitting |
| 48 | +- Be responsive to feedback and questions |
| 49 | + |
| 50 | +## Types of Contributions |
| 51 | + |
| 52 | +### Code Contributions |
| 53 | + |
| 54 | +We welcome contributions to the core codebase, including bug fixes, features, and improvements. |
| 55 | + |
| 56 | +### Contributing Drivers |
| 57 | + |
| 58 | +If you are working on a driver or adapter library of general interest, please consider submitting it to this repository, as it will become available to all Jumpstarter users. |
| 59 | + |
| 60 | +To create a new driver scaffold, you can use the `create_driver.sh` script: |
| 61 | + |
| 62 | +```bash |
| 63 | +./__templates__/create_driver.sh vendor_name driver_name "Your Name" "your.email@example.com" |
| 64 | +``` |
| 65 | + |
| 66 | +This will create the necessary files and structure for your driver in the `packages/` directory. For example: |
| 67 | + |
| 68 | +```bash |
| 69 | +./__templates__/create_driver.sh yepkit Ykush "Your Name" "your.email@example.com" |
| 70 | +``` |
| 71 | + |
| 72 | +Creates: |
| 73 | +``` |
| 74 | +packages/jumpstarter_driver_yepkit/jumpstarter_driver_yepkit/__init__.py |
| 75 | +packages/jumpstarter_driver_yepkit/jumpstarter_driver_yepkit/client.py |
| 76 | +packages/jumpstarter_driver_yepkit/jumpstarter_driver_yepkit/driver_test.py |
| 77 | +packages/jumpstarter_driver_yepkit/jumpstarter_driver_yepkit/driver.py |
| 78 | +packages/jumpstarter_driver_yepkit/.gitignore |
| 79 | +packages/jumpstarter_driver_yepkit/pyproject.toml |
| 80 | +packages/jumpstarter_driver_yepkit/README.md |
| 81 | +packages/jumpstarter_driver_yepkit/examples/exporter.yaml |
| 82 | +``` |
| 83 | + |
| 84 | +#### Driver Structure |
| 85 | + |
| 86 | +A Jumpstarter driver typically consists of: |
| 87 | + |
| 88 | +1. **Driver Implementation**: The core functionality that interfaces with the device or service |
| 89 | +2. **Client Implementation**: Client code to interact with the driver |
| 90 | +3. **Tests**: Tests to verify the driver's functionality |
| 91 | +4. **Examples**: Example configurations showing how to use the driver |
| 92 | +5. **Documentation**: Clear documentation on setup and usage |
| 93 | + |
| 94 | +#### Private Drivers |
| 95 | + |
| 96 | +If you are creating a driver or adapter library for a specific need, not of general interest, or that needs to be private, please consider forking our [jumpstarter-driver-template](https://github.com/jumpstarter-dev/jumpstarter-driver-template). |
| 97 | + |
| 98 | +#### Driver Development Workflow |
| 99 | + |
| 100 | +After creating your driver skeleton: |
| 101 | + |
| 102 | +1. Implement the driver functionality according to the Jumpstarter driver interface |
| 103 | +2. Write comprehensive tests for your driver |
| 104 | +3. Create example configurations |
| 105 | +4. Document the setup and usage in the README.md |
| 106 | +5. Submit a pull request to the main Jumpstarter repository |
| 107 | + |
| 108 | +#### Testing Your Driver |
| 109 | + |
| 110 | +To test your driver during development: |
| 111 | + |
| 112 | +```bash |
| 113 | +# From the project root |
| 114 | +make sync # Synchronize dependencies |
| 115 | +cd packages/your_driver_package |
| 116 | +pytest # Run tests for your driver |
| 117 | +``` |
| 118 | + |
| 119 | +#### Driver Best Practices |
| 120 | + |
| 121 | +- Follow the existing code style and conventions |
| 122 | +- Write comprehensive documentation |
| 123 | +- Include thorough test coverage |
| 124 | +- Create example configurations for common use cases |
| 125 | +- Keep dependencies minimal and well-justified |
| 126 | + |
| 127 | +### Documentation Contributions |
| 128 | + |
| 129 | +We welcome improvements to our documentation. |
| 130 | + |
| 131 | +#### Documentation System Overview |
| 132 | + |
| 133 | +Jumpstarter uses [Sphinx](https://www.sphinx-doc.org/en/master/) with Markdown support for its documentation. The documentation is organized into various sections covering different aspects of the project. |
| 134 | + |
| 135 | +#### Setting Up Documentation Environment |
| 136 | + |
| 137 | +To contribute to the documentation, you'll need to set up your development environment: |
| 138 | + |
| 139 | +1. Clone the Jumpstarter repository |
| 140 | +2. Navigate to the docs directory |
| 141 | +3. Install dependencies (if not already installed with the main project) |
| 142 | + |
| 143 | +#### Building the Documentation Locally |
| 144 | + |
| 145 | +To build and preview the documentation locally: |
| 146 | + |
| 147 | +```bash |
| 148 | +cd docs |
| 149 | +make html # Build HTML documentation |
| 150 | +make docs-serve # Serve documentation locally for preview |
| 151 | +``` |
| 152 | + |
| 153 | +The documentation will be available at http://localhost:8000 in your web browser. |
| 154 | + |
| 155 | +#### Documentation Structure |
| 156 | + |
| 157 | +- `docs/source/`: Root directory for documentation source files |
| 158 | + - `index.md`: Main landing page |
| 159 | + - `*.md`: Various markdown files for documentation sections |
| 160 | + - `_static/`: Static assets like images and CSS |
| 161 | + - `_templates/`: Custom templates |
| 162 | + |
| 163 | +#### Writing Documentation |
| 164 | + |
| 165 | +Documentation is written in Markdown with some Sphinx-specific extensions. Common syntax includes: |
| 166 | + |
| 167 | +```markdown |
| 168 | +# Heading 1 |
| 169 | +## Heading 2 |
| 170 | +### Heading 3 |
| 171 | + |
| 172 | +*italic text* |
| 173 | +**bold text** |
| 174 | + |
| 175 | +- Bullet list item |
| 176 | +- Another item |
| 177 | + |
| 178 | +1. Numbered list |
| 179 | +2. Second item |
| 180 | + |
| 181 | +[Link text](URL) |
| 182 | + |
| 183 | + |
| 184 | + |
| 185 | +```{note} |
| 186 | +This is a note admonition |
| 187 | +``` |
| 188 | + |
| 189 | +```{warning} |
| 190 | +This is a warning admonition |
| 191 | +``` |
| 192 | + |
| 193 | +```python |
| 194 | +# This is a code block |
| 195 | +def example(): |
| 196 | + print("Hello, world!") |
| 197 | +``` |
| 198 | +``` |
| 199 | + |
| 200 | +#### Documentation Style Guide |
| 201 | + |
| 202 | +Please follow these guidelines when writing documentation: |
| 203 | + |
| 204 | +1. Use clear, concise language |
| 205 | +2. Write in the present tense |
| 206 | +3. Use active voice when possible |
| 207 | +4. Include practical examples |
| 208 | +5. Break up text with headers, lists, and code blocks |
| 209 | +6. Target both beginners and advanced users with appropriate sections |
| 210 | +7. Provide cross-references to related documentation |
| 211 | + |
| 212 | +#### Adding New Documentation Pages |
| 213 | + |
| 214 | +To add a new documentation page: |
| 215 | + |
| 216 | +1. Create a new Markdown (`.md`) file in the appropriate directory |
| 217 | +2. Add the page to the relevant `index.md` or `toctree` directive |
| 218 | +3. Build the documentation to ensure it appears correctly |
| 219 | + |
| 220 | +#### Documentation Versioning |
| 221 | + |
| 222 | +Documentation is versioned alongside the main Jumpstarter releases. When making changes, consider whether they apply to the current version or future versions. |
| 223 | + |
| 224 | +#### Documentation Tips |
| 225 | + |
| 226 | +- **Screenshots**: Include screenshots for complex UI operations |
| 227 | +- **Command Examples**: Always include example commands with expected output |
| 228 | +- **Troubleshooting**: Add common issues and their solutions |
| 229 | +- **Links**: Link to relevant external resources when appropriate |
| 230 | + |
| 231 | +#### Submitting Documentation Changes |
| 232 | + |
| 233 | +Once your documentation changes are complete: |
| 234 | + |
| 235 | +1. Build the documentation to verify there are no errors |
| 236 | +2. Submit a pull request with your changes |
| 237 | +3. Respond to feedback during the review process |
| 238 | + |
| 239 | +### Example Contributions |
| 240 | + |
| 241 | +To add a new example: |
| 242 | + |
| 243 | +1. Create a new directory in the `examples/` folder with a descriptive name |
| 244 | +2. Include a comprehensive README.md with setup and usage instructions |
| 245 | +3. Follow the structure of existing examples |
| 246 | +4. Ensure the example is well-documented and easy to follow |
| 247 | + |
| 248 | +## Getting Help |
| 249 | + |
| 250 | +If you have questions or need help, please: |
| 251 | + |
| 252 | +1. Check the [documentation](https://docs.jumpstarter.dev/) |
| 253 | +2. Open an issue in the repository |
| 254 | +3. Reach out to the maintainers |
| 255 | + |
| 256 | +Thank you for contributing to Jumpstarter! |
0 commit comments