From cad4003c5749b0e310336c3f62c4eafda682844a Mon Sep 17 00:00:00 2001 From: Joshua Chi <112539+JoshuaChi@users.noreply.github.com> Date: Sat, 25 Jul 2026 11:18:51 +0800 Subject: [PATCH 1/3] ci(coverage) #1: add code coverage reporting and README badges --- .github/workflows/ci.yml | 26 ++++++++++++++++++++------ README.md | 8 +++++++- 2 files changed, 27 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5222048..e0d5ca2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -39,9 +39,11 @@ jobs: run: cargo clippy --all-targets --all-features -- -D warnings test: - name: Test + name: Test and Collect Coverage runs-on: ubuntu-latest needs: lint + permissions: + contents: read env: CI: 1 steps: @@ -53,6 +55,7 @@ jobs: uses: dtolnay/rust-toolchain@master with: toolchain: "1.89.0" + components: llvm-tools-preview - name: Cache using Swatinem/rust-cache uses: Swatinem/rust-cache@v2 @@ -62,14 +65,25 @@ jobs: sudo apt-get update sudo apt-get install -y protobuf-compiler - - name: Install cargo-nextest - # Version pinned to match Makefile's install-tools target — an + - name: Install cargo tools + # Versions pinned to match Makefile's install-tools target — an # unpinned `cargo install` grabs the latest release, which can # require a newer rustc than the toolchain pinned above (1.89.0). - run: cargo install cargo-nextest --locked --version 0.9.114 + run: | + cargo install cargo-nextest --locked --version 0.9.114 + cargo install cargo-llvm-cov --locked --version 0.8.7 - - name: Run tests - run: cargo nextest run --all-features --no-fail-fast + - name: Run tests with nextest and generate coverage + run: cargo llvm-cov nextest --all-features --lcov --output-path lcov.info --no-fail-fast --ignore-filename-regex "src/error.rs" - name: Run doc tests run: cargo test --doc --all-features + + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v5 + with: + token: ${{ secrets.CODECOV_TOKEN }} + file: lcov.info + flags: unittests + name: codecov-d-lmdb + verbose: true diff --git a/README.md b/README.md index 20e058f..f1c674e 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,12 @@ # d-lmdb -> **Status: Experimental — built to demonstrate d-engine's replication capabilities** +![status](https://img.shields.io/badge/status-experimental-orange) +[![CI](https://github.com/deventlab/d-lmdb/actions/workflows/ci.yml/badge.svg)](https://github.com/deventlab/d-lmdb/actions/workflows/ci.yml) +[![codecov](https://codecov.io/gh/deventlab/d-lmdb/graph/badge.svg)](https://codecov.io/gh/deventlab/d-lmdb) +![Static Badge](https://img.shields.io/badge/license-MIT%20%7C%20Apache--2.0-blue) +[![Ask DeepWiki](https://deepwiki.com/badge.svg)](https://deepwiki.com/deventlab/d-lmdb) + +> Built to demonstrate d-engine's replication capabilities. ## What This Is From 01f86c9263b52d326172479ac25251837005692e Mon Sep 17 00:00:00 2001 From: Joshua Chi <112539+JoshuaChi@users.noreply.github.com> Date: Sat, 25 Jul 2026 11:22:06 +0800 Subject: [PATCH 2/3] docs(github) #1: add issue and PR templates --- .github/ISSUE_TEMPLATE/bug_report.md | 32 +++++++++++ .github/ISSUE_TEMPLATE/doc_request.md | 16 ++++++ .github/ISSUE_TEMPLATE/feature_request.md | 37 ++++++++++++ .github/PULL_REQUEST_TEMPLATE.md | 69 +++++++++++++++++++++++ 4 files changed, 154 insertions(+) create mode 100644 .github/ISSUE_TEMPLATE/bug_report.md create mode 100644 .github/ISSUE_TEMPLATE/doc_request.md create mode 100644 .github/ISSUE_TEMPLATE/feature_request.md create mode 100644 .github/PULL_REQUEST_TEMPLATE.md diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 0000000..7f07235 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,32 @@ +--- +name: Bug report +about: Report a correctness issue or violated expectation +title: '' +labels: '' +assignees: '' + +--- + +**Describe the bug** +A clear and concise description of what the bug is. + +**To Reproduce** +Steps to reproduce the behavior: +1. Go to '...' +2. 'cargo ...' + +**Expected behavior** +A clear and concise description of what you expected to happen. + +**Actual behavior** +A clear and concise description of what actually happened. Add logs/screenshots if helpful. + +**Env (please complete the following information):** +- d-lmdb version [e.g., a tag such as `v0.1.0` or a commit hash] +- d-engine version it was built against [e.g., commit hash from `Cargo.lock`] +- Does the bug still exist on `main`? +- Rust toolchain: [output of `cargo version`] +- OS: [e.g. macOS 14, Ubuntu 22.04] + +**Additional context** +Add any other context about the problem here. diff --git a/.github/ISSUE_TEMPLATE/doc_request.md b/.github/ISSUE_TEMPLATE/doc_request.md new file mode 100644 index 0000000..0931efb --- /dev/null +++ b/.github/ISSUE_TEMPLATE/doc_request.md @@ -0,0 +1,16 @@ +--- +name: Request for documentation +about: Suggest more doc to explain something. +title: '' +labels: documentation +assignees: '' + +--- + +**What kind of doc do you ask for?** +- [ ] Design/architecture (why it's built this way) +- [ ] Guide (how to do X) +- [ ] Example + +**Describe the information you want** +A clear and concise description of what you want. diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md new file mode 100644 index 0000000..7dfbe12 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -0,0 +1,37 @@ +--- +name: Feature Request +about: Propose a feature that fits d-lmdb's scope +title: "[Feature] " +labels: "enhancement" +assignees: "" +--- + +## ⚠️ Read First + +d-lmdb targets **fault tolerance, not horizontal scaling** — LMDB stays +single-writer, single-node storage; d-engine only adds replication on top. +Features that turn this into a general-purpose distributed database +(sharding, multi-writer, secondary indexes, etc.) are out of scope — see +[CONTRIBUTING.md](../../CONTRIBUTING.md). + +**Before submitting:** + +- [ ] This fits the fault-tolerance-not-scaling scope above +- [ ] I've described a real use case, not a hypothetical one + +--- + +## What problem does this solve? + +(Be specific: what are you trying to do, and what stops you today?) + +## Proposed solution + +**Your solution:** + +**Why is this the simplest approach?** + +## Additional Context + +- Similar features in other Raft/LMDB projects (if applicable) +- Your willingness to contribute code diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000..1fad460 --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,69 @@ +## What Does This PR Do? + +(1-2 sentence summary) + +**Type:** + +- [ ] Bug Fix (with test) +- [ ] Feature (issue #\_\_\_ discussed first) +- [ ] Documentation +- [ ] Test/Coverage +- [ ] Performance (with benchmark) + +--- + +## Why Is This Needed? + +**For features:** Link to the issue where this was discussed: #\_\_\_ + +**For bugs:** Describe the problem and how this fixes it + +--- + +## Checklist + +**Required:** + +- [ ] `make check` (fmt + clippy + deny) passes +- [ ] `make test` passes +- [ ] Added tests for new code +- [ ] Commits squashed to 1-2 logical units + +**If changing APIs:** + +- [ ] Updated relevant docs +- [ ] Explained why complexity is justified + +--- + +## Testing + +**How tested:** + +- Unit tests: (describe) +- Integration tests: (if applicable) +- Manual testing: (if applicable) + +**For bug fixes:** + +- [ ] Added test that fails without this fix + +--- + +## Does This Fit d-lmdb's Scope? + +- [ ] Stays within fault-tolerance, not scaling (no sharding/multi-writer/etc.) +- [ ] Keeps implementation simple +- [ ] Doesn't bloat the public API surface + +--- + +## Reviewer Notes + +(Optional: anything reviewers should focus on) + +**Estimated review complexity:** + +- [ ] Quick (< 100 lines) +- [ ] Medium (< 300 lines) +- [ ] Deep (> 300 lines) From 11c42a84974bde0d52e35680632718c82ec0f37d Mon Sep 17 00:00:00 2001 From: Joshua Chi <112539+JoshuaChi@users.noreply.github.com> Date: Sat, 25 Jul 2026 11:42:07 +0800 Subject: [PATCH 3/3] fix #1: correct codecov-action input name, redact PII in bug template --- .github/ISSUE_TEMPLATE/bug_report.md | 2 +- .github/workflows/ci.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index 7f07235..1b43da2 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -19,7 +19,7 @@ Steps to reproduce the behavior: A clear and concise description of what you expected to happen. **Actual behavior** -A clear and concise description of what actually happened. Add logs/screenshots if helpful. +A clear and concise description of what actually happened. Add redacted logs/screenshots if helpful; remove secrets and personal data first. **Env (please complete the following information):** - d-lmdb version [e.g., a tag such as `v0.1.0` or a commit hash] diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e0d5ca2..7f4c4aa 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -83,7 +83,7 @@ jobs: uses: codecov/codecov-action@v5 with: token: ${{ secrets.CODECOV_TOKEN }} - file: lcov.info + files: lcov.info flags: unittests name: codecov-d-lmdb verbose: true