# Contributing to ThemisDB Thank you for your interest in contributing to ThemisDB! This document provides guidelines and instructions for contributing. ## Table of Contents
# 🀝 Contributing to ThemisDB **Thank you for your interest in making ThemisDB better!** [![Contributors](https://img.shields.io/github/contributors/makr-code/ThemisDB)](https://github.com/makr-code/ThemisDB/graphs/contributors) [![Pull Requests](https://img.shields.io/github/issues-pr/makr-code/ThemisDB)](https://github.com/makr-code/ThemisDB/pulls) [![Good First Issues](https://img.shields.io/github/issues/makr-code/ThemisDB/good%20first%20issue)](https://github.com/makr-code/ThemisDB/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22)
--- ## πŸ“‹ Table of Contents | Section | Description | |---------|-------------| | [🀝 Code of Conduct](#-code-of-conduct) | Community guidelines | | [πŸš€ Getting Started](#-getting-started) | Set up development environment | | [πŸ’» Development Workflow](#-development-workflow) | Branching and committing | | [βœ… Code Quality Standards](#-code-quality-standards) | Enforced quality checks | | [πŸ“‹ License Compliance](#-license-compliance) | License policy and compliance | | [πŸ”„ Pull Request Process](#-pull-request-process) | Submitting changes | | [🏷️ Issue Labels](#️-issue-labels) | GitHub label system | | [πŸ› Reporting Bugs](#-reporting-bugs) | Bug report guidelines | | [πŸ’‘ Feature Requests](#-feature-requests) | Suggesting enhancements | | [πŸ“ Documentation](#documentation) | Living documentation and continuous review process | | [πŸ“¦ Package Maintenance](#-package-maintenance) | Platform packaging | --- ## 🀝 Code of Conduct > [!IMPORTANT] > This project adheres to the [Contributor Covenant Code of Conduct](CODE_OF_CONDUCT.md). By participating, you are expected to: > - **Be respectful** and constructive in all interactions > - **Welcome newcomers** and help them get started > - **Assume good intentions** in discussions > - **Focus on what is best** for the community and project > > Please read the full [Code of Conduct](CODE_OF_CONDUCT.md) for details. --- ## Getting Started ### Prerequisites ### Development Environment Setup **1. Clone the repository:** ```bash git clone https://github.com/makr-code/ThemisDB.git cd ThemisDB ``` **2. Install dependencies:** **Linux/macOS:** ```bash ./setup.sh ``` **Windows:** ```powershell .\setup.ps1 ``` **3. Build the project:** **Linux/macOS:** ```bash ./build.sh ``` **Windows:** ```powershell .\build.ps1 ``` **4. Run tests:** ```bash cd build ctest --output-on-failure ``` **5. Optional Features (v1.3.0+):** ThemisDB has optional features that require specific build flags: ```bash # Build with LLM support (requires llama.cpp) cmake -B build -DTHEMIS_ENABLE_LLM=ON git clone https://github.com/ggerganov/llama.cpp.git # Build with HTTP/2 support cmake -B build -DTHEMIS_ENABLE_HTTP2=ON # Build with WebSocket support cmake -B build -DTHEMIS_ENABLE_WEBSOCKET=ON # Build with MQTT support cmake -B build -DTHEMIS_ENABLE_MQTT=ON # Build with PostgreSQL Wire Protocol cmake -B build -DTHEMIS_ENABLE_POSTGRES_WIRE=ON # Build with MCP Server support cmake -B build -DTHEMIS_ENABLE_MCP=ON # Build with Image Analysis plugins cmake -B build -DTHEMIS_ENABLE_IMAGE_ANALYSIS=ON # Build with all optional features cmake -B build -DTHEMIS_ENABLE_ALL_PROTOCOLS=ON ``` --- ## πŸš€ Getting Started ### Prerequisites | Tool | Minimum Version | Purpose | |------|:---------------:|---------| | **C++ Compiler** | GCC 10+ / Clang 12+ / MSVC 2019+ | Core compilation | | **CMake** | 3.20+ | Build system | | **vcpkg** | Latest | Dependency management | | **Git** | 2.x | Version control | ### Development Environment Setup
1️⃣ Clone the Repository ```bash git clone https://github.com/makr-code/ThemisDB.git cd ThemisDB ```
2️⃣ Install Dependencies **Linux/macOS:** ```bash ./setup.sh ``` **Windows:** ```powershell .\setup.ps1 ``` > [!TIP] > The setup script automatically installs vcpkg and all required dependencies.
3️⃣ Build the Project **Linux/macOS:** ```bash ./build.sh ``` **Windows:** ```powershell .\build.ps1 ``` > [!NOTE] > First build may take 10-15 minutes as vcpkg compiles dependencies from source.
4️⃣ Run Tests ```bash cd build ctest --output-on-failure ``` **Expected result:** All tests should pass βœ…
5️⃣ Optional Features (v1.3.0+) ThemisDB supports optional protocol and AI integrations: | Feature | CMake Flag | Dependencies | |---------|------------|--------------| | πŸ€– **LLM Support** | `-DTHEMIS_ENABLE_LLM=ON` | llama.cpp | | 🌐 **HTTP/2** | `-DTHEMIS_ENABLE_HTTP2=ON` | nghttp2 | | πŸ“‘ **WebSocket** | `-DTHEMIS_ENABLE_WEBSOCKET=ON` | uWebSockets | | πŸ“¬ **MQTT** | `-DTHEMIS_ENABLE_MQTT=ON` | mosquitto | | 🐘 **PostgreSQL Wire** | `-DTHEMIS_ENABLE_POSTGRES_WIRE=ON` | libpq | | πŸ”Œ **MCP Server** | `-DTHEMIS_ENABLE_MCP=ON` | - | | πŸ–ΌοΈ **Image Analysis** | `-DTHEMIS_ENABLE_IMAGE_ANALYSIS=ON` | OpenCV | **Build with LLM support:** ```bash cmake -B build -DTHEMIS_ENABLE_LLM=ON git clone https://github.com/ggerganov/llama.cpp.git cmake --build build ``` **Build with all protocols:** ```bash cmake -B build -DTHEMIS_ENABLE_ALL_PROTOCOLS=ON cmake --build build ```
See [ATTRIBUTIONS.md](ATTRIBUTIONS.md) for third-party dependency information. **Running tests under Windows / WSL (developer tips)** - If you build under WSL the default build output used by repository helper scripts is `build-wsl/` (e.g. `build-wsl/themis_tests` and `build-wsl/themis_server`). Helper scripts (such as `.tools/vault_dev_run.ps1`) rely on this layout. - To run the GoogleTest binary directly in WSL and export JUnit XML to the Windows host: ```powershell # from PowerShell (host): wsl bash -lc "cd /mnt/c/VCC/themis; ./build-wsl/themis_tests --gtest_output=xml:/mnt/c/Temp/themis_tests.xml" ``` - Vault integration tests expect a reachable Vault at `VAULT_ADDR` and a valid token in `VAULT_TOKEN`. The repository includes a small helper `.tools/vault_dev_run.ps1` which: - starts a local Vault dev container, enables KV v2 at mount `themis/`, writes a 32‑byte base64 key to `themis/keys/test_key`, and runs the Vault tests from WSL (writing XML output to `C:\Temp`). - Preconditions: Docker available locally and a WSL installation with repo mounted under `/mnt/c/VCC/themis`. ### Install Code Quality Tools **Linux (Ubuntu/Debian):** ```bash sudo apt-get install -y clang-tidy cppcheck lcov gcovr # Install gitleaks wget https://github.com/gitleaks/gitleaks/releases/download/v8.18.4/gitleaks_8.18.4_linux_x64.tar.gz tar -xzf gitleaks_8.18.4_linux_x64.tar.gz sudo mv gitleaks /usr/local/bin/ ``` **macOS:** ```bash brew install llvm cppcheck lcov gitleaks ``` **Windows:** ```powershell choco install llvm cppcheck gitleaks ``` ## Development Workflow > [!IMPORTANT] > **ThemisDB uses a Git Flow branching strategy:** > - `main` = Production-ready release branch (protected) > - `develop` = Active development branch (integration) > - All features branch from `develop` and merge back to `develop` > - See [BRANCHING_STRATEGY.md](BRANCHING_STRATEGY.md) for complete details ### 1. Create a Feature Branch ```bash # IMPORTANT: Always branch from develop (not main) git checkout develop git pull origin develop git checkout -b feature/your-feature-name # OR for bug fixes git checkout -b bugfix/bug-description ``` **Branch naming conventions:** ### 2. Make Your Changes ### 3. Run Code Quality Checks **Before committing, run local quality checks:** ```bash # Linux/macOS ./scripts/check-quality.sh # Windows .\scripts\check-quality.ps1 ``` **Auto-fix issues where possible:** ```bash # Linux/macOS ./scripts/check-quality.sh --fix # Windows .\scripts\check-quality.ps1 -Fix ``` ### 4. Commit Your Changes **Write clear, descriptive commit messages:** ``` ():