From 8f0f8b35f59f026c7a4ec874b3cb2ff302974336 Mon Sep 17 00:00:00 2001 From: Ataba Date: Thu, 2 Jul 2026 17:10:58 +0300 Subject: [PATCH 1/3] Add GitHub Actions CI with Docker + CTest --- .github/workflows/ci.yml | 19 +++++++++++++++++++ Dockerfile | 2 +- 2 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..0fc56c2 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,19 @@ +name: KV-DB CI + +on: + push: + pull_request: + +jobs: + test: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Build Docker image + run: docker build -t kv-db . + + - name: Run tests inside container + run: docker run --rm kv-db ctest --output-on-failure diff --git a/Dockerfile b/Dockerfile index fd252d0..d0f4dff 100644 --- a/Dockerfile +++ b/Dockerfile @@ -19,7 +19,7 @@ COPY . . # Run CMake and build the database RUN cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release && \ - cmake --build build --target KV_Database + cmake --build build # ========================================== # Stage 2: Minimal Runtime (Production-grade) From a70bf89f6a616b5688e44c59747c92083bdd920f Mon Sep 17 00:00:00 2001 From: Ataba Date: Thu, 2 Jul 2026 17:14:44 +0300 Subject: [PATCH 2/3] Fix for actions --- .github/workflows/ci.yml | 3 --- Dockerfile | 3 ++- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0fc56c2..feb3fe9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,6 +14,3 @@ jobs: - name: Build Docker image run: docker build -t kv-db . - - - name: Run tests inside container - run: docker run --rm kv-db ctest --output-on-failure diff --git a/Dockerfile b/Dockerfile index d0f4dff..d2df26e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -19,7 +19,8 @@ COPY . . # Run CMake and build the database RUN cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release && \ - cmake --build build + cmake --build build && \ + cd build && ctest --output-on-failure # ========================================== # Stage 2: Minimal Runtime (Production-grade) From ce6de0957e188823c3d40d88fa9b2dcfa5285e0e Mon Sep 17 00:00:00 2001 From: Ataba Date: Sun, 26 Jul 2026 00:44:14 +0300 Subject: [PATCH 3/3] Testing new contribution and CI pipe --- .github/CODEOWNERS | 3 + .github/ISSUE_TEMPLATE/bug_report.yml | 64 +++++++++++++++++++++ .github/ISSUE_TEMPLATE/config.yml | 5 ++ .github/ISSUE_TEMPLATE/feature_request.yml | 34 +++++++++++ .github/PULL_REQUEST_TEMPLATE.md | 27 +++++++++ .github/dependabot.yml | 6 ++ .github/labeler.yml | 23 ++++++++ .github/workflows/ci.yml | 42 +++++++++++--- .github/workflows/labeler.yml | 17 ++++++ .github/workflows/stale.yml | 25 ++++++++ CONTRIBUTING.md | 66 ++++++++++++++++++++++ 11 files changed, 305 insertions(+), 7 deletions(-) create mode 100644 .github/CODEOWNERS create mode 100644 .github/ISSUE_TEMPLATE/bug_report.yml create mode 100644 .github/ISSUE_TEMPLATE/config.yml create mode 100644 .github/ISSUE_TEMPLATE/feature_request.yml create mode 100644 .github/PULL_REQUEST_TEMPLATE.md create mode 100644 .github/dependabot.yml create mode 100644 .github/labeler.yml create mode 100644 .github/workflows/labeler.yml create mode 100644 .github/workflows/stale.yml create mode 100644 CONTRIBUTING.md diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS new file mode 100644 index 0000000..ffbf2be --- /dev/null +++ b/.github/CODEOWNERS @@ -0,0 +1,3 @@ +# Default owners for everything in the repo. +# Replace these usernames with the actual GitHub handles of the maintainers. +* @Ataba @razimograbi diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml new file mode 100644 index 0000000..0a110a3 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -0,0 +1,64 @@ +name: Bug Report +description: Report a bug or unexpected behavior in ByteForge +title: "[Bug]: " +labels: ["bug", "triage"] +body: + - type: markdown + attributes: + value: | + Thanks for taking the time to report a bug. Please fill out the sections below. + + - type: textarea + id: description + attributes: + label: What happened? + description: A clear description of the bug. + validations: + required: true + + - type: textarea + id: repro + attributes: + label: Steps to reproduce + description: Minimal steps to reproduce the behavior. + placeholder: | + 1. Start the server with ... + 2. Send command ... + 3. Observe ... + validations: + required: true + + - type: textarea + id: expected + attributes: + label: Expected behavior + validations: + required: true + + - type: dropdown + id: platform + attributes: + label: Platform + options: + - Linux + - Windows + - Docker + - Other + validations: + required: true + + - type: input + id: version + attributes: + label: Commit / version + description: Commit hash or release tag you're running. + validations: + required: false + + - type: textarea + id: logs + attributes: + label: Relevant logs / stack trace + render: shell + validations: + required: false diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 0000000..156de74 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1,5 @@ +blank_issues_enabled: false +contact_links: + - name: Ask a question + url: https://github.com/OWNER/REPO/discussions + about: Use Discussions for general questions instead of an issue. diff --git a/.github/ISSUE_TEMPLATE/feature_request.yml b/.github/ISSUE_TEMPLATE/feature_request.yml new file mode 100644 index 0000000..ea0e0a3 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.yml @@ -0,0 +1,34 @@ +name: Feature Request +description: Suggest an improvement or new feature for ByteForge +title: "[Feature]: " +labels: ["enhancement", "triage"] +body: + - type: textarea + id: problem + attributes: + label: What problem does this solve? + description: What's missing or painful right now? + validations: + required: true + + - type: textarea + id: proposal + attributes: + label: Proposed solution + description: What would you like to see happen? + validations: + required: true + + - type: textarea + id: alternatives + attributes: + label: Alternatives considered + validations: + required: false + + - type: textarea + id: context + attributes: + label: Additional context + validations: + required: false diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000..d68d597 --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,27 @@ +## Summary + + + +## Related issue + +Closes # + +## Type of change + +- [ ] Bug fix +- [ ] New feature +- [ ] Refactor / internal change +- [ ] Documentation +- [ ] Build / CI + +## How was this tested? + + + +## Checklist + +- [ ] Code builds locally (`cmake --build build`) +- [ ] Tests pass (`ctest --test-dir build`) +- [ ] Added/updated tests for the change +- [ ] Updated documentation if needed +- [ ] Follows the project's header-guard / .h-.cpp split / Doxygen-comment conventions diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..5ace460 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,6 @@ +version: 2 +updates: + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "weekly" diff --git a/.github/labeler.yml b/.github/labeler.yml new file mode 100644 index 0000000..15f56fa --- /dev/null +++ b/.github/labeler.yml @@ -0,0 +1,23 @@ +documentation: + - changed-files: + - any-glob-to-any-file: + - "**/*.md" + - "docs/**" + +ci: + - changed-files: + - any-glob-to-any-file: + - ".github/workflows/**" + +build: + - changed-files: + - any-glob-to-any-file: + - "CMakeLists.txt" + - "**/CMakeLists.txt" + - "Dockerfile" + +tests: + - changed-files: + - any-glob-to-any-file: + - "**/tests/**" + - "**/*test*.cpp" diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index feb3fe9..99bdb8c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,16 +1,44 @@ -name: KV-DB CI +name: CI on: push: + branches: [main] pull_request: + branches: [main] jobs: - test: - runs-on: ubuntu-latest + build-linux: + name: Build & Test (Linux) + runs-on: ubuntu-24.04 + steps: + - uses: actions/checkout@v4 + + - name: Install Ninja + run: sudo apt-get update && sudo apt-get install -y ninja-build + + - name: Configure + run: cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release + + - name: Build + run: cmake --build build + - name: Test + run: ctest --test-dir build --output-on-failure + + build-windows: + name: Build & Test (Windows) + runs-on: windows-latest steps: - - name: Checkout code - uses: actions/checkout@v4 + - uses: actions/checkout@v4 + + - name: Install Ninja + run: choco install ninja -y + + - name: Configure + run: cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release + + - name: Build + run: cmake --build build - - name: Build Docker image - run: docker build -t kv-db . + - name: Test + run: ctest --test-dir build --output-on-failure diff --git a/.github/workflows/labeler.yml b/.github/workflows/labeler.yml new file mode 100644 index 0000000..f5f15c1 --- /dev/null +++ b/.github/workflows/labeler.yml @@ -0,0 +1,17 @@ +name: "Pull Request Labeler" + +on: + pull_request_target: + types: [opened, synchronize, reopened] + +permissions: + contents: read + pull-requests: write + +jobs: + label: + runs-on: ubuntu-24.04 + steps: + - uses: actions/labeler@v5 + with: + repo-token: "${{ secrets.GITHUB_TOKEN }}" diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml new file mode 100644 index 0000000..75dcbbf --- /dev/null +++ b/.github/workflows/stale.yml @@ -0,0 +1,25 @@ +name: "Close stale issues and PRs" + +on: + schedule: + - cron: "30 1 * * *" + workflow_dispatch: + +permissions: + issues: write + pull-requests: write + +jobs: + stale: + runs-on: ubuntu-24.04 + steps: + - uses: actions/stale@v9 + with: + days-before-stale: 60 + days-before-close: 14 + stale-issue-message: "This issue has been inactive for 60 days and will be closed in 14 days if there's no further activity." + stale-pr-message: "This PR has been inactive for 60 days and will be closed in 14 days if there's no further activity." + stale-issue-label: "stale" + stale-pr-label: "stale" + exempt-issue-labels: "pinned,in-progress" + exempt-pr-labels: "pinned,in-progress" diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..61ef821 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,66 @@ +# Contributing to ByteForge + +Thanks for your interest in contributing. This project is maintained by a small team, so contributions go through forks and pull requests — there's no direct push access for non-collaborators. + +## Before you start + +- Check open [Issues](../../issues) and [PRs](../../pulls) to avoid duplicate work. +- For anything non-trivial (new feature, architecture change), open an issue first to discuss the approach before writing code. +- Small fixes (typos, docs, obvious bugs) can go straight to a PR. + +## Workflow + +1. **Fork** the repository (you won't be able to push branches directly unless you're a collaborator). +2. **Branch** off `main` using this naming scheme (Git flow style): + - `feature/` + - `fix/` + - `chore/` + - `docs/` +3. **Build and test locally** before opening a PR (see below). +4. **Commit** with clear, descriptive messages. Keep commits scoped to one logical change. +5. **Open a pull request** against `main` using the PR template. Link the related issue if there is one. +6. Respond to review feedback — PRs need at least one approval and a passing CI run before merge. + +## Building the project + +ByteForge uses CMake + Ninja and targets C++23. + +```bash +cmake -S . -B build -G Ninja +cmake --build build +``` + +Run the test suite (GoogleTest, fetched via CMake FetchContent): + +```bash +ctest --test-dir build --output-on-failure +``` + +The project builds cross-platform (Linux via epoll, Windows via IOCP) behind a shared `IEventLoop` interface — if your change touches the event loop, please test on both platforms if you can, or note in the PR which platform you tested. + +## Code style + +- Header guards: `#ifndef` / `#define` / `#endif` (no `#pragma once`). +- Split declarations and definitions into `.h` / `.cpp` files. +- Document public APIs with short Doxygen-style `/** */` comments — keep them concise, not verbose. +- Match the formatting of surrounding code (brace style, naming conventions) rather than introducing a new style in a file. + +## Pull request expectations + +- One feature/fix per PR — keep diffs reviewable. +- Include or update tests for behavioral changes. +- Update documentation (README, code comments) if the change affects usage or public interfaces. +- CI must pass (build + tests) before merge. +- Don't fabricate benchmark numbers in PR descriptions — if you're citing performance impact, include how you measured it. + +## Reporting bugs / requesting features + +Use the issue templates — they'll prompt for the info needed to reproduce a bug or evaluate a feature request. Issues from non-collaborators are welcome; just keep them scoped and specific. + +## Code of conduct + +Be respectful and constructive in issues, PRs, and reviews. Disagreements about technical approach are fine and expected — keep them focused on the code, not the person. + +## Questions + +Open a [Discussion](../../discussions) or a low-priority issue tagged `question`.