Skip to content

Commit 626d622

Browse files
committed
feat: complete OSS infrastructure setup
- Add MIT LICENSE file - Add CodeQL security analysis workflow - Add dependency review workflow for PRs - Add comprehensive TESTING.md documentation - Update Cargo.toml with license and metadata - Add badges to README (CodeQL, Codecov, License, etc.) - Document all CI/CD workflows and testing procedures - Document known issues (unmaintained deps, Release Please) This completes the open source readiness setup with: - Security scanning (CodeQL, dependency review) - Quality gates (CI, tests, coverage) - Documentation (TESTING.md, README badges) - Proper licensing (MIT) Signed-off-by: aviralgarg05 <gargaviral99@gmail.com>
1 parent ecb67d7 commit 626d622

7 files changed

Lines changed: 246 additions & 0 deletions

File tree

.github/workflows/codeql.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: "CodeQL Security Analysis"
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
schedule:
9+
- cron: "0 0 * * 1" # Weekly on Monday
10+
11+
permissions:
12+
actions: read
13+
contents: read
14+
security-events: write
15+
16+
jobs:
17+
analyze:
18+
name: Analyze
19+
runs-on: ubuntu-latest
20+
21+
strategy:
22+
fail-fast: false
23+
matrix:
24+
language: ["python"]
25+
26+
steps:
27+
- name: Checkout repository
28+
uses: actions/checkout@v4
29+
30+
- name: Initialize CodeQL
31+
uses: github/codeql-action/init@v3
32+
with:
33+
languages: ${{ matrix.language }}
34+
35+
- name: Perform CodeQL Analysis
36+
uses: github/codeql-action/analyze@v3
37+
with:
38+
category: "/language:${{matrix.language}}"
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: "Dependency Review"
2+
3+
on:
4+
pull_request:
5+
branches: [main]
6+
7+
permissions:
8+
contents: read
9+
pull-requests: write
10+
11+
jobs:
12+
dependency-review:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Checkout Repository
16+
uses: actions/checkout@v4
17+
18+
- name: Dependency Review
19+
uses: actions/dependency-review-action@v4
20+
with:
21+
fail-on-severity: moderate
22+
comment-summary-in-pr: always

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2024-2025 Aviral Garg
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11
[![CI](https://github.com/aviralgarg05/NexumDB/actions/workflows/ci.yml/badge.svg)](https://github.com/aviralgarg05/NexumDB/actions/workflows/ci.yml)
2+
[![CodeQL](https://github.com/aviralgarg05/NexumDB/actions/workflows/codeql.yml/badge.svg)](https://github.com/aviralgarg05/NexumDB/actions/workflows/codeql.yml)
3+
[![codecov](https://codecov.io/gh/aviralgarg05/NexumDB/branch/main/graph/badge.svg)](https://codecov.io/gh/aviralgarg05/NexumDB)
4+
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
5+
[![Rust](https://img.shields.io/badge/rust-1.70%2B-orange.svg)](https://www.rust-lang.org/)
6+
[![Python](https://img.shields.io/badge/python-3.9%2B-blue.svg)](https://www.python.org/)
27

38
# NexumDB - AI-Native Database
49

TESTING.md

Lines changed: 149 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,149 @@
1+
# Testing Guide for NexumDB
2+
3+
This document describes all testing and quality assurance processes for NexumDB.
4+
5+
## Local Testing
6+
7+
### Rust Tests
8+
```bash
9+
# Set PyO3 compatibility for Python 3.14
10+
export PYO3_USE_ABI3_FORWARD_COMPATIBILITY=1
11+
12+
# Format check
13+
cargo fmt --all -- --check
14+
15+
# Linting
16+
cargo clippy --workspace --all-targets -- -D warnings
17+
18+
# Run tests (single-threaded for consistent results)
19+
cargo test --workspace -- --test-threads=1
20+
21+
# Security audit
22+
cargo audit
23+
24+
# Generate documentation
25+
cargo doc --no-deps --workspace
26+
```
27+
28+
### Python Tests
29+
```bash
30+
cd nexum_ai
31+
32+
# Lint with ruff
33+
ruff check .
34+
35+
# Syntax check
36+
python3 -m compileall *.py
37+
38+
# Run tests with coverage
39+
pytest --cov=. --cov-report=xml --cov-report=html
40+
```
41+
42+
## CI/CD Workflows
43+
44+
### Continuous Integration (.github/workflows/ci.yml)
45+
Runs on: Every push and PR
46+
- **Rust checks**:
47+
- Format check with `cargo fmt`
48+
- Linting with `cargo clippy`
49+
- Unit and integration tests
50+
- Security audit with `cargo audit`
51+
- Documentation build
52+
- Code coverage with `cargo-llvm-cov` → Codecov
53+
54+
- **Python checks**:
55+
- Linting with `ruff`
56+
- Syntax check with `compileall`
57+
- Tests with `pytest`
58+
- Coverage with `pytest-cov` → Codecov
59+
60+
- **Benchmarks** (PR only):
61+
- Criterion-based performance tests
62+
- Comparison with main branch
63+
64+
### Security Workflows
65+
66+
#### CodeQL Analysis (.github/workflows/codeql.yml)
67+
Runs on: Push to main, PRs, weekly schedule
68+
- Static security analysis for Python code
69+
- Identifies potential vulnerabilities
70+
71+
#### Dependency Review (.github/workflows/dependency-review.yml)
72+
Runs on: Pull requests
73+
- Reviews dependency changes
74+
- Fails on moderate+ severity vulnerabilities
75+
- Comments summary in PR
76+
77+
#### SBOM Generation (.github/workflows/sbom.yml)
78+
Runs on: Release tags
79+
- Generates Software Bill of Materials
80+
- Tracks all dependencies
81+
82+
### Code Quality
83+
84+
#### DCO Check (.github/workflows/dco.yml)
85+
Runs on: Pull requests
86+
- Verifies Developer Certificate of Origin
87+
- Ensures proper commit sign-off
88+
89+
#### Stale Issues (.github/workflows/stale.yml)
90+
Runs on: Schedule (daily)
91+
- Marks inactive issues/PRs as stale
92+
- Auto-closes after inactivity period
93+
94+
### Release & Distribution
95+
96+
#### Release Please (.github/workflows/release-please.yml)
97+
Runs on: Push to main
98+
- Automated release PR generation
99+
- Version bumping based on conventional commits
100+
- Changelog generation
101+
- **Current Status**: Requires repository settings update (see RELEASE_PLEASE_FIX.md)
102+
103+
#### Docker Release (.github/workflows/docker-release.yml)
104+
Runs on: Release tags
105+
- Builds and publishes Docker images
106+
- Multi-platform support
107+
108+
## Known Issues
109+
110+
### Unmaintained Dependencies
111+
The following dependencies are flagged as unmaintained by `cargo audit`:
112+
- `fxhash 0.2.1` - Used by sled (indirect)
113+
- `instant 0.1.13` - Used by sled (indirect)
114+
115+
These are **warnings only**, not security vulnerabilities. They come from the `sled` database dependency. Monitor for:
116+
- Updates to `sled` that might replace these
117+
- Alternative database backends if needed
118+
- Security advisories (none currently)
119+
120+
### Release Please Permissions
121+
The Release Please workflow requires repository settings update. See `/tmp/release-please-fix.md` for instructions.
122+
123+
## Coverage Requirements
124+
125+
- **Target**: Maintain >80% code coverage
126+
- **Tracking**: Codecov integration for both Rust and Python
127+
- **Reports**:
128+
- Rust: `lcov.info` generated by `cargo-llvm-cov`
129+
- Python: `coverage.xml` generated by `pytest-cov`
130+
131+
## Pre-commit Checklist
132+
133+
Before pushing changes:
134+
1. ✅ Run `cargo fmt --all`
135+
2. ✅ Run `cargo clippy --workspace --all-targets`
136+
3. ✅ Run `cargo test --workspace`
137+
4. ✅ Run `ruff check nexum_ai/` (if Python changes)
138+
5. ✅ Run `pytest` in nexum_ai/ (if Python changes)
139+
6. ✅ Ensure all tests pass locally
140+
7. ✅ Sign commits with DCO (`git commit -s`)
141+
142+
## Continuous Improvement
143+
144+
Consider adding:
145+
- [ ] Mutation testing for test quality assessment
146+
- [ ] Performance regression detection
147+
- [ ] Fuzzing for SQL parser
148+
- [ ] Integration tests with real workloads
149+
- [ ] Load testing scenarios

nexum_cli/Cargo.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22
name = "nexum_cli"
33
version = "0.4.0"
44
edition = "2021"
5+
license = "MIT"
6+
authors = ["Aviral Garg"]
7+
repository = "https://github.com/aviralgarg05/NexumDB"
8+
description = "Command-line interface for NexumDB"
9+
keywords = ["database", "cli", "sql"]
510

611
[[bin]]
712
name = "nexum"

nexum_core/Cargo.toml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22
name = "nexum_core"
33
version = "0.4.0"
44
edition = "2021"
5+
license = "MIT"
6+
authors = ["Aviral Garg"]
7+
repository = "https://github.com/aviralgarg05/NexumDB"
8+
description = "AI-native database core engine with SQL and semantic caching"
9+
keywords = ["database", "ai", "sql", "semantic-cache"]
10+
categories = ["database-implementations"]
511

612
[dependencies]
713
sled = { workspace = true }

0 commit comments

Comments
 (0)