Skip to content

Commit afbe587

Browse files
chore: add DEVELOPMENT.md (#155)
1 parent 3e3ab5a commit afbe587

File tree

1 file changed

+115
-0
lines changed

1 file changed

+115
-0
lines changed

DEVELOPMENT.md

Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
<!--
2+
Licensed to the Apache Software Foundation (ASF) under one
3+
or more contributor license agreements. See the NOTICE file
4+
distributed with this work for additional information
5+
regarding copyright ownership. The ASF licenses this file
6+
to you under the Apache License, Version 2.0 (the
7+
"License"); you may not use this file except in compliance
8+
with the License. You may obtain a copy of the License at
9+
10+
http://www.apache.org/licenses/LICENSE-2.0
11+
12+
Unless required by applicable law or agreed to in writing, software
13+
distributed under the License is distributed on an "AS IS" BASIS,
14+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
See the License for the specific language governing permissions and
16+
limitations under the License.
17+
-->
18+
19+
# Development Guide
20+
21+
Welcome to the development guide of `fluss-rust`! This project builds `fluss-rust` client and language specific bindings.
22+
23+
## Pre-requisites
24+
25+
- protobuf
26+
- rust
27+
28+
You can install these using your favourite package / version manager. Example installation using mise:
29+
30+
```bash
31+
mise install protobuf
32+
mise install rust
33+
```
34+
35+
## IDE Setup
36+
37+
We recommend [RustRover](https://www.jetbrains.com/rust/) IDE to work with fluss-rust code base.
38+
39+
### Importing fluss-rust
40+
41+
1. On your terminal, clone fluss-rust project from GitHub
42+
```bash
43+
git clone https://github.com/apache/fluss-rust.git
44+
```
45+
1. Open RustRover, on `Projects` tab, click `Open` and navigate to the root directory of fluss-rust
46+
1. Click `Open`
47+
48+
### Copyright Profile
49+
50+
Fluss and Fluss-rust are Apache projects and as such every files need to have Apache licence header. This can be automated in RustRover by adding a Copyright profile:
51+
52+
1. Go to `Settings` -> `Editor` -> `Copyright` -> `Copyright Profiles`.
53+
1. Add a new profile and name it `Apache`.
54+
1. Add the following text as the license text:
55+
```
56+
Licensed to the Apache Software Foundation (ASF) under one
57+
or more contributor license agreements. See the NOTICE file
58+
distributed with this work for additional information
59+
regarding copyright ownership. The ASF licenses this file
60+
to you under the Apache License, Version 2.0 (the
61+
"License"); you may not use this file except in compliance
62+
with the License. You may obtain a copy of the License at
63+
64+
http://www.apache.org/licenses/LICENSE-2.0
65+
66+
Unless required by applicable law or agreed to in writing,
67+
software distributed under the License is distributed on an
68+
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
69+
KIND, either express or implied. See the License for the
70+
specific language governing permissions and limitations
71+
under the License.
72+
```
73+
1. Go to `Editor` -> `Copyright` and choose the `Apache` profile as the default profile for this project.
74+
1. Click `Apply`
75+
76+
We also use line comment formatting for licence headers.
77+
1. Go to `Editor` -> `Copyright` -> `Formatting` -> `Rust`
78+
1. Choose `Use custom formatting`
79+
1. Choose `Use line comment`
80+
81+
## Project directories
82+
83+
Source files are organized in the following manner
84+
85+
1. `crates/fluss` - fluss rust client crate source
86+
1. `crates/examples` - fluss rust client examples
87+
1. `bindings` - bindings to other languages e.g. C++ under `bindings/cpp` and Python under `bindings/python`
88+
1. Click `Apply`
89+
2.
90+
## Building & Testing
91+
92+
See [quickstart](README.md#quick-start) for steps to run example code.
93+
94+
Running all unit tests for fluss rust client:
95+
96+
```bash
97+
cargo test --workspace
98+
```
99+
100+
Running all integration test cases:
101+
102+
```bash
103+
cargo test --features integration_tests --workspace
104+
```
105+
106+
107+
### Formatting and Clippy
108+
109+
Our CI runs cargo formatting and clippy to help keep the code base styling tidy and readable. Run the following commands and address any errors or warnings to ensure that your PR can complete CI successfully.
110+
111+
```bash
112+
cargo fmt --all
113+
cargo clippy --all-targets --fix --allow-dirty --allow-staged
114+
```
115+

0 commit comments

Comments
 (0)