From 488c2699400b93e112489bad13362e8221f0d0a0 Mon Sep 17 00:00:00 2001 From: ez-plugins Date: Wed, 15 Apr 2026 15:00:33 +0200 Subject: [PATCH 1/6] fix: ci badge in README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 3c3d523..4561b36 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # JavaQueryBuilder -![CI](https://github.com/${{github.repository}}/actions/workflows/ci.yml/badge.svg) +![CI](https://github.com/EzFramework/JavaQueryBuilder/actions/workflows/ci.yml/badge.svg) This project uses GitHub Actions for continuous integration. See `.github/workflows/ci.yml` for details. From b738880872ec75a9a2bfc19484201dbd4ac4211d Mon Sep 17 00:00:00 2001 From: ez-plugins Date: Wed, 15 Apr 2026 15:24:15 +0200 Subject: [PATCH 2/6] docs: update documentation --- CONTRIBUTING.md | 5 +++++ README.md | 40 ++-------------------------------------- 2 files changed, 7 insertions(+), 38 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index ed59a62..1aa316d 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -49,6 +49,11 @@ Run `mvn checkstyle:check` locally before pushing. 3. Handle it in `AbstractSqlDialect` (and dialect subclasses if behaviour differs) 4. Add tests for all three layers +## Adding Tests + +- Add JUnit tests under `src/test/java/com/github/ezframework/javaquerybuilder/query/` and its subpackages. +- Focus on covering all core features, edge cases, and error handling. + ## Releasing Releases are published to **GitHub Packages** and available via **JitPack** automatically: diff --git a/README.md b/README.md index 4561b36..be68b27 100644 --- a/README.md +++ b/README.md @@ -2,9 +2,7 @@ ![CI](https://github.com/EzFramework/JavaQueryBuilder/actions/workflows/ci.yml/badge.svg) -This project uses GitHub Actions for continuous integration. See `.github/workflows/ci.yml` for details. - -A lightweight, fluent Java library for building SQL queries and filtering in-memory data — no runtime dependencies required. +A lightweight, fluent Java library for building SQL queries and filtering in-memory data, no runtime dependencies required. ## Features @@ -154,40 +152,6 @@ SQLite wraps every table and column name in double quotes, which safely handles `LIKE` values are automatically wrapped with `%` on both sides so `whereLike("name", "alice")` becomes `name LIKE ?` with parameter `%alice%`. - -## Project Layout - -``` -src/main/java/com/skyblockexp/ezframework/query/ -├── QueryBuilder.java Fluent builder — start here -├── Query.java Query data model; delegates rendering to SqlDialect -├── SqlResult.java Holds the generated SQL string and parameter list -├── SqlDialect.java Strategy interface (STANDARD / SQLITE constants) -├── AbstractSqlDialect.java Shared rendering logic — extend to add new dialects -├── StandardSqlDialect.java Standard SQL (no quoting) -├── SqliteDialect.java SQLite (double-quote identifiers, boolean → 0/1) -├── Condition.java Single field condition (operator + value) -├── Operator.java Enum of supported operators -└── QueryableStorage.java Interface for in-memory query execution -``` - ## License -MIT - -## Test Coverage - -This project uses [JaCoCo](https://www.jacoco.org/jacoco/) for test coverage analysis. - -### How to Generate Coverage Report - -1. Run all tests and generate the coverage report: - ```sh - mvn test jacoco:report - ``` -2. Open the HTML report: - - Open `target/site/jacoco/index.html` in your browser to view detailed coverage metrics. - -## Adding Tests -- Add JUnit tests under `src/test/java/com/github/ezframework/javaquerybuilder/query/` and its subpackages. -- Focus on covering all core features, edge cases, and error handling. +MIT \ No newline at end of file From 422d9ab18fe728d8d68ad12d293c9cf01cf9c62a Mon Sep 17 00:00:00 2001 From: ez-plugins Date: Wed, 15 Apr 2026 15:29:17 +0200 Subject: [PATCH 3/6] ci: replace Github action package --- .github/workflows/code-quality.yml | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/.github/workflows/code-quality.yml b/.github/workflows/code-quality.yml index 74ca93c..338ca2b 100644 --- a/.github/workflows/code-quality.yml +++ b/.github/workflows/code-quality.yml @@ -19,14 +19,16 @@ jobs: java-version: '25' - name: Run Checkstyle run: mvn --batch-mode checkstyle:check + - name: Install reviewdog + uses: reviewdog/action-setup@v1 + with: + reviewdog_version: latest - name: Annotate Checkstyle results in PR if: github.event_name == 'pull_request' - uses: reviewdog/action-checkstyle@v1 - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - reporter: github-pr-review - level: error - checkstyle_input: target/checkstyle-result.xml + run: | + reviewdog -f=checkstyle -name="checkstyle" -reporter=github-pr-review -level=error -fail-on-error < target/checkstyle-result.xml + env: + REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }} coverage: runs-on: ubuntu-latest From 259e5a0a8b0dada8553cb7a873ab1722533ebf99 Mon Sep 17 00:00:00 2001 From: ez-plugins Date: Wed, 15 Apr 2026 15:35:16 +0200 Subject: [PATCH 4/6] ci: fix publish unit tests package --- .github/workflows/unit-tests.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml index ee426f5..17bb2e7 100644 --- a/.github/workflows/unit-tests.yml +++ b/.github/workflows/unit-tests.yml @@ -28,7 +28,8 @@ jobs: name: java-query-builder-jar path: target/*.jar - name: Publish JUnit test results - uses: actions/upload-test-results@v2 + uses: EnricoMi/publish-unit-test-result-action@v2 + if: (!cancelled()) with: files: target/surefire-reports/*.xml @@ -48,6 +49,7 @@ jobs: - name: Run feature tests run: mvn --batch-mode -Dtest='feature.**.*Test' test - name: Publish Feature Test Results - uses: actions/upload-test-results@v2 + uses: EnricoMi/publish-unit-test-result-action@v2 + if: (!cancelled()) with: files: target/surefire-reports/*.xml From e1a6ffa11990a89967bbcd884b251d9656eacba3 Mon Sep 17 00:00:00 2001 From: ez-plugins Date: Wed, 15 Apr 2026 15:50:10 +0200 Subject: [PATCH 5/6] ci: fix failing tests --- .github/workflows/code-quality.yml | 4 +-- .github/workflows/unit-tests.yml | 4 +-- pom.xml | 8 ++--- .../query/QueryBuilderFeatureTest.java | 33 ++++++++++--------- 4 files changed, 25 insertions(+), 24 deletions(-) diff --git a/.github/workflows/code-quality.yml b/.github/workflows/code-quality.yml index 338ca2b..b3be526 100644 --- a/.github/workflows/code-quality.yml +++ b/.github/workflows/code-quality.yml @@ -16,7 +16,7 @@ jobs: uses: actions/setup-java@v4 with: distribution: 'temurin' - java-version: '25' + java-version: '21' - name: Run Checkstyle run: mvn --batch-mode checkstyle:check - name: Install reviewdog @@ -39,7 +39,7 @@ jobs: uses: actions/setup-java@v4 with: distribution: 'temurin' - java-version: '25' + java-version: '21' - name: Build with coverage run: mvn --batch-mode clean verify - name: Upload JaCoCo coverage report diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml index 17bb2e7..58fe9b8 100644 --- a/.github/workflows/unit-tests.yml +++ b/.github/workflows/unit-tests.yml @@ -11,7 +11,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - java-version: [ '25' ] + java-version: [ '21' ] steps: - name: Checkout code uses: actions/checkout@v4 @@ -37,7 +37,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - java-version: [ '25' ] + java-version: [ '21' ] steps: - name: Checkout code uses: actions/checkout@v4 diff --git a/pom.xml b/pom.xml index d26b62c..24baa2d 100644 --- a/pom.xml +++ b/pom.xml @@ -13,8 +13,8 @@ https://github.com/EzFramework/JavaQueryBuilder - 25 - 25 + 21 + 21 UTF-8 @@ -40,8 +40,8 @@ maven-compiler-plugin 3.10.1 - 25 - 25 + 21 + 21 diff --git a/src/test/java/feature/query/QueryBuilderFeatureTest.java b/src/test/java/feature/query/QueryBuilderFeatureTest.java index 4de9745..fd4e41a 100644 --- a/src/test/java/feature/query/QueryBuilderFeatureTest.java +++ b/src/test/java/feature/query/QueryBuilderFeatureTest.java @@ -19,22 +19,23 @@ public class QueryBuilderFeatureTest { @DisplayName("Builds a complex SELECT with multiple conditions and dialect") void buildsComplexSelectWithDialect() { SqlResult result = new QueryBuilder() - .select("id", "name", "email") - .from("users") - .whereEquals("status", "active") - .whereLike("email", "@example.com") - .whereGreaterThan("score", 100) - .orderBy("created_at", false) - .limit(5) - .offset(10) - .buildSql("users", SqlDialect.MYSQL); - assertTrue(result.getSql().contains("SELECT id, name, email FROM `users`")); - assertTrue(result.getSql().contains("status = ?")); - assertTrue(result.getSql().contains("email LIKE ?")); - assertTrue(result.getSql().contains("score > ?")); - assertTrue(result.getSql().contains("ORDER BY created_at DESC")); - assertTrue(result.getSql().contains("LIMIT 5")); - assertTrue(result.getSql().contains("OFFSET 10")); + .select("id", "name", "email") + .from("users") + .whereEquals("status", "active") + .whereLike("email", "@example.com") + .whereGreaterThan("score", 100) + .orderBy("created_at", false) + .limit(5) + .offset(10) + .buildSql("users", SqlDialect.MYSQL); + String sql = result.getSql(); + assertTrue(sql.contains("SELECT `id`, `name`, `email` FROM `users`"), sql); + assertTrue(sql.contains("`status` = ?"), sql); + assertTrue(sql.contains("`email` LIKE ?"), sql); + assertTrue(sql.contains("`score` > ?"), sql); + assertTrue(sql.contains("ORDER BY `created_at` DESC"), sql); + assertTrue(sql.contains("LIMIT 5"), sql); + assertTrue(sql.contains("OFFSET 10"), sql); assertEquals(List.of("active", "%@example.com%", 100), result.getParameters()); } From 5046f159bf873c20ca71c5ca4e6960d69962fe14 Mon Sep 17 00:00:00 2001 From: ez-plugins Date: Wed, 15 Apr 2026 15:53:40 +0200 Subject: [PATCH 6/6] ci: fix CI permissions --- .github/workflows/code-quality.yml | 5 +++++ .github/workflows/unit-tests.yml | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/.github/workflows/code-quality.yml b/.github/workflows/code-quality.yml index b3be526..5d45593 100644 --- a/.github/workflows/code-quality.yml +++ b/.github/workflows/code-quality.yml @@ -1,4 +1,9 @@ + name: Code Quality +permissions: + checks: write + pull-requests: write + contents: read on: push: diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml index 58fe9b8..6c8bf41 100644 --- a/.github/workflows/unit-tests.yml +++ b/.github/workflows/unit-tests.yml @@ -1,5 +1,10 @@ name: Unit Tests +permissions: + checks: write + pull-requests: write + contents: read + on: push: branches: [ "main", "master" ]