From b795117f0ae363d821e07dd5d639ab4b61af50d2 Mon Sep 17 00:00:00 2001 From: amithkoujalgi Date: Tue, 11 Mar 2025 00:20:01 +0530 Subject: [PATCH 1/5] Add integration test step to CI workflow Previously, only unit tests were run during the PR workflow. This update introduces a separate step to run integration tests, ensuring broader test coverage. It enhances build verification by validating both unit and integration aspects. --- .github/workflows/build-on-pr-create.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-on-pr-create.yml b/.github/workflows/build-on-pr-create.yml index 62dca67..f935dda 100644 --- a/.github/workflows/build-on-pr-create.yml +++ b/.github/workflows/build-on-pr-create.yml @@ -30,5 +30,8 @@ jobs: - name: Build with Maven run: mvn --file pom.xml -U clean package - - name: Run Tests - run: mvn --file pom.xml -U clean test -Punit-tests \ No newline at end of file + - name: Run unit tests + run: mvn --file pom.xml -U clean test -Punit-tests + + - name: Run integration tests + run: mvn --file pom.xml -U clean verify -Pintegration-tests \ No newline at end of file From 7756eed9a07061c0c406949927b0c68b7f4eb284 Mon Sep 17 00:00:00 2001 From: amithkoujalgi Date: Tue, 11 Mar 2025 09:29:57 +0530 Subject: [PATCH 2/5] Add pre-commit configuration file Introduce a pre-commit-config.yaml to automate code quality checks and enforce best practices. Includes hooks for file validation, formatting, and commit message standardization, as well as Java-specific quality tools. This ensures consistent coding standards and reduces manual errors. --- pre-commit-config.yaml | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 pre-commit-config.yaml diff --git a/pre-commit-config.yaml b/pre-commit-config.yaml new file mode 100644 index 0000000..839c949 --- /dev/null +++ b/pre-commit-config.yaml @@ -0,0 +1,36 @@ +repos: + + # pre-commit hooks + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: "v5.0.0" + hooks: + - id: check-added-large-files + - id: no-commit-to-branch + - id: check-toml + - id: check-yaml + - id: check-json + - id: check-xml + - id: end-of-file-fixer + exclude: \.json$ + files: \.py$ + - id: trailing-whitespace + - id: mixed-line-ending + + # for commit message formatting + - repo: https://github.com/commitizen-tools/commitizen + rev: v4.1.1 + hooks: + - id: commitizen + stages: [commit-msg] + + # for java code quality + - repo: https://github.com/gherynos/pre-commit-java + rev: v0.2.1 + hooks: + - id: pmd + exclude: /test/ + - id: cpd + exclude: /test/ + - id: checkstyle + exclude: /test/ + # ... \ No newline at end of file From 99beb3e6d0109a023415df6d6410800933cc0bfe Mon Sep 17 00:00:00 2001 From: amithkoujalgi Date: Tue, 11 Mar 2025 09:31:12 +0530 Subject: [PATCH 3/5] Add pre-commit configuration file test --- src/main/java/io/github/ollama4j/OllamaAPI.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main/java/io/github/ollama4j/OllamaAPI.java b/src/main/java/io/github/ollama4j/OllamaAPI.java index 5d64044..519eec7 100644 --- a/src/main/java/io/github/ollama4j/OllamaAPI.java +++ b/src/main/java/io/github/ollama4j/OllamaAPI.java @@ -1156,3 +1156,7 @@ public class OllamaAPI { } } } + + + + From 57ecbc257288d5a920b91ad892915f7a2684d3ae Mon Sep 17 00:00:00 2001 From: amithkoujalgi Date: Tue, 11 Mar 2025 10:00:11 +0530 Subject: [PATCH 4/5] Add pre-commit configuration file test --- ...mit-config.yaml => .pre-commit-config.yaml | 28 ++++++++++--------- .../java/io/github/ollama4j/OllamaAPI.java | 1 - 2 files changed, 15 insertions(+), 14 deletions(-) rename pre-commit-config.yaml => .pre-commit-config.yaml (54%) diff --git a/pre-commit-config.yaml b/.pre-commit-config.yaml similarity index 54% rename from pre-commit-config.yaml rename to .pre-commit-config.yaml index 839c949..013455b 100644 --- a/pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -5,8 +5,8 @@ repos: rev: "v5.0.0" hooks: - id: check-added-large-files - - id: no-commit-to-branch - - id: check-toml +# - id: no-commit-to-branch +# args: ['--branch', 'main'] - id: check-yaml - id: check-json - id: check-xml @@ -15,6 +15,9 @@ repos: files: \.py$ - id: trailing-whitespace - id: mixed-line-ending + - id: check-merge-conflict + - id: pretty-format-json + args: ['--no-sort-keys', '--autofix', '--indent=4'] # for commit message formatting - repo: https://github.com/commitizen-tools/commitizen @@ -23,14 +26,13 @@ repos: - id: commitizen stages: [commit-msg] - # for java code quality - - repo: https://github.com/gherynos/pre-commit-java - rev: v0.2.1 - hooks: - - id: pmd - exclude: /test/ - - id: cpd - exclude: /test/ - - id: checkstyle - exclude: /test/ - # ... \ No newline at end of file +# # for java code quality +# - repo: https://github.com/gherynos/pre-commit-java +# rev: v0.6.10 +# hooks: +# - id: pmd +# exclude: /test/ +# - id: cpd +# exclude: /test/ +# - id: checkstyle +# exclude: /test/ \ No newline at end of file diff --git a/src/main/java/io/github/ollama4j/OllamaAPI.java b/src/main/java/io/github/ollama4j/OllamaAPI.java index 519eec7..efab9a9 100644 --- a/src/main/java/io/github/ollama4j/OllamaAPI.java +++ b/src/main/java/io/github/ollama4j/OllamaAPI.java @@ -1159,4 +1159,3 @@ public class OllamaAPI { - From a0bcc47b2e6e8830fc23b4e6aec4cc315f6f7b66 Mon Sep 17 00:00:00 2001 From: amithkoujalgi Date: Tue, 11 Mar 2025 10:08:57 +0530 Subject: [PATCH 5/5] Add pre-commit configuration file test --- .pre-commit-config.yaml | 18 +++++++++--------- .../java/io/github/ollama4j/OllamaAPI.java | 3 --- 2 files changed, 9 insertions(+), 12 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 013455b..cf1cbba 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -4,20 +4,20 @@ repos: - repo: https://github.com/pre-commit/pre-commit-hooks rev: "v5.0.0" hooks: - - id: check-added-large-files # - id: no-commit-to-branch # args: ['--branch', 'main'] - - id: check-yaml - - id: check-json - - id: check-xml - - id: end-of-file-fixer - exclude: \.json$ - files: \.py$ - - id: trailing-whitespace - - id: mixed-line-ending - id: check-merge-conflict + - id: check-added-large-files + - id: check-yaml + - id: check-xml + - id: check-json - id: pretty-format-json args: ['--no-sort-keys', '--autofix', '--indent=4'] + - id: end-of-file-fixer + exclude: \.json$ + files: \.java$|\.xml$ + - id: trailing-whitespace + - id: mixed-line-ending # for commit message formatting - repo: https://github.com/commitizen-tools/commitizen diff --git a/src/main/java/io/github/ollama4j/OllamaAPI.java b/src/main/java/io/github/ollama4j/OllamaAPI.java index efab9a9..5d64044 100644 --- a/src/main/java/io/github/ollama4j/OllamaAPI.java +++ b/src/main/java/io/github/ollama4j/OllamaAPI.java @@ -1156,6 +1156,3 @@ public class OllamaAPI { } } } - - -