|
| 1 | +# Contributing to OptiSQL |
| 2 | + |
| 3 | +Thank you for your interest in contributing to OptiSQL! This guide will help you get started. |
| 4 | + |
| 5 | +## How to Write and Run Tests |
| 6 | + |
| 7 | +We use a Makefile to simplify common development tasks. All commands should be run from the project root. |
| 8 | + |
| 9 | +### Go Tests |
| 10 | +- Run all tests |
| 11 | + ```bash |
| 12 | + make go-test |
| 13 | + ``` |
| 14 | +- Run tests with race detector |
| 15 | + ```bash |
| 16 | + make go-test-race |
| 17 | + ``` |
| 18 | +- Run tests with coverage |
| 19 | + ```bash |
| 20 | + make go-test-coverage |
| 21 | + ``` |
| 22 | + |
| 23 | +### Rust Tests |
| 24 | +- Run all tests |
| 25 | + ```bash |
| 26 | + make rust-test |
| 27 | + ``` |
| 28 | + |
| 29 | +### Run All Tests (Go + Rust) |
| 30 | +- Run tests for both backends |
| 31 | + ```bash |
| 32 | + make test-all |
| 33 | + ``` |
| 34 | + |
| 35 | +## Pull Request (PR) Format |
| 36 | + |
| 37 | +- Create a descriptive PR title that summarizes the change |
| 38 | +- Include the following sections in your PR description: |
| 39 | + - **What**: Brief description of what this PR does |
| 40 | + - **Why**: Explanation of why this change is needed |
| 41 | + - **How**: Technical details of how the change was implemented |
| 42 | + - **Testing**: How you tested the changes |
| 43 | +- Reference any related issues using `Fixes #<issue-number>` or `Closes #<issue-number>` |
| 44 | +- Ensure all CI checks pass |
| 45 | + |
| 46 | +## Git Commit Message Format |
| 47 | + |
| 48 | +- Use conventional commit format: |
| 49 | + ```bash |
| 50 | + <type>(<scope>): <subject> |
| 51 | + |
| 52 | + <body> |
| 53 | + |
| 54 | + <footer> |
| 55 | + ``` |
| 56 | +- **Types**: `feat`, `fix`, `docs`, `style`, `refactor`, `test`, `chore` |
| 57 | +- **Examples**: |
| 58 | + ```bash |
| 59 | + feat(operators): add hash join implementation |
| 60 | + |
| 61 | + fix(parser): handle edge case in substrait parsing |
| 62 | + |
| 63 | + docs(readme): update installation instructions |
| 64 | + |
| 65 | + test(filter): add unit tests for wildcard filter |
| 66 | + ``` |
| 67 | +- Keep subject line under 50 characters |
| 68 | +- Capitalize the subject line |
| 69 | +- Use imperative mood ("add" not "added") |
| 70 | +- Separate subject from body with a blank line |
| 71 | +- Wrap body at 72 characters |
| 72 | +
|
| 73 | +## Areas Where We Currently Need Help / Open Contributions |
| 74 | +
|
| 75 | +- **Operator Implementations**: Help implement missing SQL operators (join, filter, aggregation) |
| 76 | +- **Substrait Integration**: Improve substrait plan parsing and optimization |
| 77 | +- **Test Coverage**: Add unit tests and integration tests for existing functionality |
| 78 | +- **Documentation**: Improve code comments, API documentation, and user guides |
| 79 | +- **Performance Optimization**: Profile and optimize query execution performance |
| 80 | +- **Bug Fixes**: Check the issues tab for open bugs that need fixing |
| 81 | +
|
| 82 | +## How to Build, Test, and Run the Application |
| 83 | +
|
| 84 | +### Prerequisites |
| 85 | +- Go 1.24 or higher |
| 86 | +- Rust 1.70 or higher |
| 87 | +- Git |
| 88 | +- Make |
| 89 | +
|
| 90 | +### Clone the Repository |
| 91 | +```bash |
| 92 | +git clone https://github.com/Rich-T-kid/OptiSQL.git |
| 93 | +cd OptiSQL |
| 94 | +``` |
| 95 | +
|
| 96 | +### Quick Start with Makefile |
| 97 | +
|
| 98 | +See all available commands: |
| 99 | +```bash |
| 100 | +make help |
| 101 | +``` |
| 102 | +
|
| 103 | +### Build and Run Go Backend |
| 104 | +```bash |
| 105 | +make go-run |
| 106 | +``` |
| 107 | +
|
| 108 | +### Build and Run Rust Backend |
| 109 | +```bash |
| 110 | +make rust-run |
| 111 | +``` |
| 112 | +
|
| 113 | +### Run All Tests |
| 114 | +```bash |
| 115 | +make test-all |
| 116 | +``` |
| 117 | +
|
| 118 | +Or run individually: |
| 119 | +```bash |
| 120 | +make go-test |
| 121 | +make rust-test |
| 122 | +``` |
| 123 | +
|
| 124 | +### Run Linters |
| 125 | +```bash |
| 126 | +make lint-all |
| 127 | +``` |
| 128 | +
|
| 129 | +Or run individually: |
| 130 | +```bash |
| 131 | +make go-lint |
| 132 | +make rust-lint |
| 133 | +``` |
| 134 | +
|
| 135 | +### Format Code |
| 136 | +```bash |
| 137 | +make fmt-all |
| 138 | +``` |
| 139 | +
|
| 140 | +### Clean Build Artifacts |
| 141 | +```bash |
| 142 | +make clean-all |
| 143 | +``` |
| 144 | +
|
| 145 | +### Verify CI Pipeline Locally |
| 146 | +Before pushing, run the pre-push check: |
| 147 | +```bash |
| 148 | +make pre-push |
| 149 | +``` |
| 150 | +
|
| 151 | +This runs formatting, linting, and all tests to ensure your changes will pass CI. |
| 152 | +
|
| 153 | +--- |
| 154 | +
|
| 155 | +For questions or help, please open an issue. |
0 commit comments