Skip to content

Commit bc26536

Browse files
Richard BaahRichard Baah
authored andcommitted
Added lots of configuration and documentation to start the project
1 parent 1e86945 commit bc26536

File tree

14 files changed

+685
-18
lines changed

14 files changed

+685
-18
lines changed

.github/workflows/go-test.yml

Lines changed: 30 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,23 @@ on:
77
branches: [ main ]
88

99
jobs:
10+
lint:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- uses: actions/checkout@v4
15+
16+
- name: Set up Go
17+
uses: actions/setup-go@v5
18+
with:
19+
go-version: '1.24'
20+
21+
- name: Run golangci-lint
22+
uses: golangci/golangci-lint-action@v6
23+
with:
24+
version: latest
25+
working-directory: ./src/Backend/opti-sql-go
26+
1027
test:
1128
runs-on: ubuntu-latest
1229

@@ -16,16 +33,23 @@ jobs:
1633
- name: Set up Go
1734
uses: actions/setup-go@v5
1835
with:
19-
go-version: '1.21'
36+
go-version: '1.24'
2037

2138
- name: Run tests
2239
working-directory: ./src/Backend/opti-sql-go
2340
run: go test -v ./...
2441

25-
- name: Run tests with coverage
26-
working-directory: ./src/Backend/opti-sql-go
27-
run: go test -v -coverprofile=coverage.out ./...
42+
race:
43+
runs-on: ubuntu-latest
44+
45+
steps:
46+
- uses: actions/checkout@v4
47+
48+
- name: Set up Go
49+
uses: actions/setup-go@v5
50+
with:
51+
go-version: '1.24'
2852

29-
- name: Display coverage
53+
- name: Run tests with race detector
3054
working-directory: ./src/Backend/opti-sql-go
31-
run: go tool cover -func=coverage.out
55+
run: go test -race -v ./...

.github/workflows/rust-test.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Rust Tests
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
jobs:
10+
lint:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- uses: actions/checkout@v4
15+
16+
- name: Set up Rust
17+
uses: actions-rust-lang/setup-rust-toolchain@v1
18+
with:
19+
toolchain: stable
20+
components: clippy, rustfmt
21+
22+
- name: Run clippy
23+
working-directory: ./src/Backend/opti-sql-rs
24+
run: cargo clippy --all-targets --all-features -- -D warnings
25+
26+
- name: Check formatting
27+
working-directory: ./src/Backend/opti-sql-rs
28+
run: cargo fmt -- --check
29+
30+
test:
31+
runs-on: ubuntu-latest
32+
33+
steps:
34+
- uses: actions/checkout@v4
35+
36+
- name: Set up Rust
37+
uses: actions-rust-lang/setup-rust-toolchain@v1
38+
with:
39+
toolchain: stable
40+
41+
- name: Run tests
42+
working-directory: ./src/Backend/opti-sql-rs
43+
run: cargo test --verbose
44+

CONTRIBUTING.md

Lines changed: 155 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,155 @@
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

Comments
 (0)