|
1 |
| -# How to contribute to Delta Kernel Rust |
| 1 | +# Contributing to Delta Kernel (Rust) |
2 | 2 |
|
3 |
| -Welcome! We'd love to have you contribute to Delta Kernel Rust! |
| 3 | +> [!NOTE] |
| 4 | +> **Found a bug?** Please first search [existing issues] to avoid duplicates. If you find a related |
| 5 | +> issue, add your details there. Otherwise, open a new issue with a reproducible example including |
| 6 | +> Rust version, delta-kernel-rs version, code executed, and error message. |
4 | 7 |
|
5 |
| -## Did you find a bug? |
| 8 | +[existing issues]: (https://github.com/delta-io/delta-kernel-rs/issues) |
6 | 9 |
|
7 |
| -Create an issue with a reproducible example. Please specify the Rust version, delta-kernel-rs version, the code executed, and the error message. |
| 10 | +## How to Contribute |
8 | 11 |
|
9 |
| -## Did you create a PR to fix a bug? |
| 12 | +For trivial fixes, etc. please feel free to open a PR directly. For larger changes, we follow a |
| 13 | +structured contribution process to ensure high-quality code: |
10 | 14 |
|
11 |
| -Open a pull request and add "Fixes #issue_number" in the PR description. |
| 15 | +1. **Start with an issue and/or design sketch**: Open an issue describing what you want to |
| 16 | + contribute and why. Continue to step 2 after reaching some consensus. This helps us avoid wasted |
| 17 | + effort (perhaps you were building something that someone else was already pursuing or already |
| 18 | + explored and rejected). Including a design sketch will help drive consensus (often a simple |
| 19 | + diagram or bullet points outlining high-level changes is sufficient). |
| 20 | +2. **Prototype/POC**: Create a PR marked as prototype/draft (not intended to merge) and gather |
| 21 | + feedback to further derisk the design. This PR is not intended to be merged but will guide the |
| 22 | + implementation and serve as a proving ground for the design. Then, pieces are torn out into |
| 23 | + smaller PRs that can be merged. |
| 24 | +3. **Implementation**: Finally, create PR(s) to implement the feature (production code, tests, |
| 25 | + thorough docs, etc.). Often the initial POC will be split into multiple smaller PRs (e.g., |
| 26 | + refactors, then feature additions, then public APIs specifically). Care should be taken to ensure |
| 27 | + each PR is easily reviewable and thoroughly tested. |
12 | 28 |
|
13 |
| -We appreciate bug fixes - thank you in advance! |
| 29 | +## Forking and Setup |
14 | 30 |
|
15 |
| -## Would you like to add a new feature or change existing code? |
| 31 | +1. Fork the repository into your account |
| 32 | +2. Clone your fork locally: |
| 33 | + ```bash |
| 34 | + git clone [email protected]:YOUR_USERNAME/delta-kernel-rs.git |
| 35 | + cd delta-kernel-rs |
| 36 | + ``` |
| 37 | +3. Add the upstream remote: |
| 38 | + ```bash |
| 39 | + git remote add upstream [email protected]:delta-io/delta-kernel-rs.git |
| 40 | + ``` |
16 | 41 |
|
17 |
| -If you would like to add a feature or change existing behavior, please make sure to create an issue and get the planned work approved by the core team first! |
| 42 | +Now you have: |
| 43 | +- `origin` pointing to your fork |
| 44 | +- `upstream` pointing to the original repository |
18 | 45 |
|
19 |
| -Always better to get aligned with the core devs before writing any code. |
| 46 | +## Development Workflow |
20 | 47 |
|
21 |
| -## Do you have questions about the source code? |
| 48 | +Our trunk branch is named `main`. Here's the typical workflow: |
22 | 49 |
|
23 |
| -Feel free to create an issue or join the [Delta Lake Slack](https://go.delta.io/slack) with questions! We chat in the `#delta-kernel` channel. |
| 50 | +1. Pull the latest main to get a fresh checkout: |
| 51 | + ```bash |
| 52 | + git checkout main |
| 53 | + git pull upstream main |
| 54 | + ``` |
| 55 | +2. Create a new feature branch: |
| 56 | + ```bash |
| 57 | + git checkout -b my-feature |
| 58 | + ``` |
| 59 | + (NB: Consider using `git worktrees` for managing multiple branches!) |
| 60 | +3. Make your changes and test them locally. See our CI runs for a full set of tests. |
| 61 | + ```bash |
| 62 | + # run most of our tests, typically sufficient for quick iteration |
| 63 | + cargo test |
| 64 | + # run clippy |
| 65 | + cargo clippy --all-features --tests --benches -- -D warnings |
| 66 | + # build docs |
| 67 | + cargo doc --workspace --all-features |
| 68 | + # highly recommend editor that automatically formats, but in case you need to: |
| 69 | + cargo fmt |
24 | 70 |
|
25 |
| -Thanks for reading! :heart: :crab: |
| 71 | + # run more tests |
| 72 | + cargo test --workspace --all-features -- --skip read_table_version_hdfs |
| 73 | + |
| 74 | + # see ffi/ dir for more about testing FFI specifically |
| 75 | + ``` |
| 76 | +4. Push to your fork: |
| 77 | + ```bash |
| 78 | + git push origin my-feature |
| 79 | + ``` |
| 80 | +5. Open a PR from `origin/my-feature` to `upstream/main` |
| 81 | +6. Celebrate! 🎉 |
| 82 | + |
| 83 | +**Note**: Our CI runs all tests and clippy checks. Warnings will cause CI to fail. |
| 84 | + |
| 85 | +**Note**: We require two approvals from code owners for any PR to be merged. |
| 86 | + |
| 87 | +## Resources |
| 88 | + |
| 89 | +- [Delta Protocol](https://github.com/delta-io/delta/blob/master/PROTOCOL.md) |
| 90 | +- [Delta Lake Slack](https://go.delta.io/slack) - Join us in the `#delta-kernel` channel |
0 commit comments