From 0e82c4433fbac502b24899cabe8ee24d984c971e Mon Sep 17 00:00:00 2001 From: Bruk Ori Date: Fri, 25 Oct 2024 16:43:50 +0300 Subject: [PATCH 01/10] test --- .forgejo/workflows/pre-commit.yaml | 16 ++++++++++++++++ .pre-commit-config.yaml | 16 ++++++++++++++++ Makefile | 22 ++++++++++++++++++++++ help.mk | 11 +++++++++++ pom.xml | 10 ++++++++++ 5 files changed, 75 insertions(+) create mode 100644 .forgejo/workflows/pre-commit.yaml create mode 100644 .pre-commit-config.yaml create mode 100755 Makefile create mode 100644 help.mk diff --git a/.forgejo/workflows/pre-commit.yaml b/.forgejo/workflows/pre-commit.yaml new file mode 100644 index 0000000..96983e6 --- /dev/null +++ b/.forgejo/workflows/pre-commit.yaml @@ -0,0 +1,16 @@ +name: Pre-commit checks +on: [pull_request] + +jobs: + pre-commit: + name: Pre-commit + runs-on: docker + container: git.frostfs.info/truecloudlab/env:python-${{ matrix.py }} + steps: + - uses: actions/checkout@v3 + - name: Install deps + run: | + apt update + apt install -y pre-commit + - name: Run pre-commit + run: pre-commit run --all-files --hook-stage manual --color=always diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..85f292f --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,16 @@ +repos: + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v4.6.0 + hooks: + - id: check-merge-conflict + - id: check-json + - id: check-xml + - id: check-yaml + + - repo: local + hooks: + - id: make-verify + name: Run make verify + entry: make verify + language: system + pass_filenames: false diff --git a/Makefile b/Makefile new file mode 100755 index 0000000..1ce2dd9 --- /dev/null +++ b/Makefile @@ -0,0 +1,22 @@ +#!/usr/bin/make -f +SHELL=bash + +include help.mk + +.PHONY: verify + +# Regenerate documentation for proto files: +verify: + mvn clean verify + +# Activate pre-commit hooks +pre-commit: + pre-commit install --hook-type pre-commit + +# Deactivate pre-commit hooks +unpre-commit: + pre-commit uninstall --hook-type pre-commit + +# Run pre-commit hooks +pre-commit-run: + @pre-commit run --all-files --hook-stage manual \ No newline at end of file diff --git a/help.mk b/help.mk new file mode 100644 index 0000000..a2ac989 --- /dev/null +++ b/help.mk @@ -0,0 +1,11 @@ +.PHONY: help + +# Show this help prompt +help: + @echo ' Usage:' + @echo '' + @echo ' make ' + @echo '' + @echo ' Targets:' + @echo '' + @awk '/^#/{ comment = substr($$0,3) } /^[a-zA-Z][a-zA-Z0-9_-]+:/{ print " ", $$1, comment; comment = "" }' $(MAKEFILE_LIST) | column -t -s ':' | grep -v 'IGNORE' | sort | uniq diff --git a/pom.xml b/pom.xml index ed517d6..1aaf030 100644 --- a/pom.xml +++ b/pom.xml @@ -85,6 +85,16 @@ 3.4.0 + + org.apache.maven.plugins + maven-surefire-plugin + 2.22.0 + + + org.apache.maven.plugins + maven-failsafe-plugin + 2.22.0 + \ No newline at end of file -- 2.45.2 From da32b5c45d81ff20f5d817605eabbd5d6b31397c Mon Sep 17 00:00:00 2001 From: Bruk Ori Date: Fri, 25 Oct 2024 16:47:17 +0300 Subject: [PATCH 02/10] test --- .forgejo/workflows/pre-commit.yaml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.forgejo/workflows/pre-commit.yaml b/.forgejo/workflows/pre-commit.yaml index 96983e6..bdb64e4 100644 --- a/.forgejo/workflows/pre-commit.yaml +++ b/.forgejo/workflows/pre-commit.yaml @@ -6,6 +6,13 @@ jobs: name: Pre-commit runs-on: docker container: git.frostfs.info/truecloudlab/env:python-${{ matrix.py }} + strategy: + matrix: + py: + - '3.11' + - '3.13' + env: + PIP_CACHE_DIR: /cache/pip steps: - uses: actions/checkout@v3 - name: Install deps -- 2.45.2 From af743b898c669bb347f9a5944ad7168d001f2b62 Mon Sep 17 00:00:00 2001 From: Bruk Ori Date: Fri, 25 Oct 2024 16:53:03 +0300 Subject: [PATCH 03/10] test --- .forgejo/workflows/pre-commit.yaml | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/.forgejo/workflows/pre-commit.yaml b/.forgejo/workflows/pre-commit.yaml index bdb64e4..8c412d6 100644 --- a/.forgejo/workflows/pre-commit.yaml +++ b/.forgejo/workflows/pre-commit.yaml @@ -5,14 +5,7 @@ jobs: pre-commit: name: Pre-commit runs-on: docker - container: git.frostfs.info/truecloudlab/env:python-${{ matrix.py }} - strategy: - matrix: - py: - - '3.11' - - '3.13' - env: - PIP_CACHE_DIR: /cache/pip + container: git.frostfs.info/truecloudlab/env:openjdk-11-maven-3.8.6 steps: - uses: actions/checkout@v3 - name: Install deps -- 2.45.2 From a9578de1b08f7907fbee92a9a7d308157c2e6848 Mon Sep 17 00:00:00 2001 From: Bruk Ori Date: Mon, 28 Oct 2024 17:53:15 +0300 Subject: [PATCH 04/10] test --- models/src/test/java/info/frostfs/sdk/UuidExtensionTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/models/src/test/java/info/frostfs/sdk/UuidExtensionTest.java b/models/src/test/java/info/frostfs/sdk/UuidExtensionTest.java index 9353b73..d4da874 100644 --- a/models/src/test/java/info/frostfs/sdk/UuidExtensionTest.java +++ b/models/src/test/java/info/frostfs/sdk/UuidExtensionTest.java @@ -20,7 +20,7 @@ public class UuidExtensionTest { var result = UuidExtension.asBytes(TEST_UUID); //Then - assertThat(result).hasSize(16).containsExactly(TEST_UUID_BYTES); + assertThat(result).hasSize(15).containsExactly(TEST_UUID_BYTES); } @Test -- 2.45.2 From 1e61359a045c07fe6fdddc6a493ca849825bc671 Mon Sep 17 00:00:00 2001 From: Bruk Ori Date: Mon, 28 Oct 2024 21:48:12 +0300 Subject: [PATCH 05/10] test --- .../{pre-commit.yaml => verify-code.yaml} | 8 ++----- .pre-commit-config.yaml | 16 -------------- Makefile | 22 ------------------- help.mk | 11 ---------- 4 files changed, 2 insertions(+), 55 deletions(-) rename .forgejo/workflows/{pre-commit.yaml => verify-code.yaml} (52%) delete mode 100644 .pre-commit-config.yaml delete mode 100755 Makefile delete mode 100644 help.mk diff --git a/.forgejo/workflows/pre-commit.yaml b/.forgejo/workflows/verify-code.yaml similarity index 52% rename from .forgejo/workflows/pre-commit.yaml rename to .forgejo/workflows/verify-code.yaml index 8c412d6..b925acf 100644 --- a/.forgejo/workflows/pre-commit.yaml +++ b/.forgejo/workflows/verify-code.yaml @@ -8,9 +8,5 @@ jobs: container: git.frostfs.info/truecloudlab/env:openjdk-11-maven-3.8.6 steps: - uses: actions/checkout@v3 - - name: Install deps - run: | - apt update - apt install -y pre-commit - - name: Run pre-commit - run: pre-commit run --all-files --hook-stage manual --color=always + - name: Run the Maven verify phase + run: mvn --batch-mode --update-snapshots verify diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml deleted file mode 100644 index 85f292f..0000000 --- a/.pre-commit-config.yaml +++ /dev/null @@ -1,16 +0,0 @@ -repos: - - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.6.0 - hooks: - - id: check-merge-conflict - - id: check-json - - id: check-xml - - id: check-yaml - - - repo: local - hooks: - - id: make-verify - name: Run make verify - entry: make verify - language: system - pass_filenames: false diff --git a/Makefile b/Makefile deleted file mode 100755 index 1ce2dd9..0000000 --- a/Makefile +++ /dev/null @@ -1,22 +0,0 @@ -#!/usr/bin/make -f -SHELL=bash - -include help.mk - -.PHONY: verify - -# Regenerate documentation for proto files: -verify: - mvn clean verify - -# Activate pre-commit hooks -pre-commit: - pre-commit install --hook-type pre-commit - -# Deactivate pre-commit hooks -unpre-commit: - pre-commit uninstall --hook-type pre-commit - -# Run pre-commit hooks -pre-commit-run: - @pre-commit run --all-files --hook-stage manual \ No newline at end of file diff --git a/help.mk b/help.mk deleted file mode 100644 index a2ac989..0000000 --- a/help.mk +++ /dev/null @@ -1,11 +0,0 @@ -.PHONY: help - -# Show this help prompt -help: - @echo ' Usage:' - @echo '' - @echo ' make ' - @echo '' - @echo ' Targets:' - @echo '' - @awk '/^#/{ comment = substr($$0,3) } /^[a-zA-Z][a-zA-Z0-9_-]+:/{ print " ", $$1, comment; comment = "" }' $(MAKEFILE_LIST) | column -t -s ':' | grep -v 'IGNORE' | sort | uniq -- 2.45.2 From 1ece264668b68eac337b383f456f046dac21b219 Mon Sep 17 00:00:00 2001 From: Bruk Ori Date: Mon, 28 Oct 2024 21:51:33 +0300 Subject: [PATCH 06/10] test --- models/src/test/java/info/frostfs/sdk/UuidExtensionTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/models/src/test/java/info/frostfs/sdk/UuidExtensionTest.java b/models/src/test/java/info/frostfs/sdk/UuidExtensionTest.java index d4da874..9353b73 100644 --- a/models/src/test/java/info/frostfs/sdk/UuidExtensionTest.java +++ b/models/src/test/java/info/frostfs/sdk/UuidExtensionTest.java @@ -20,7 +20,7 @@ public class UuidExtensionTest { var result = UuidExtension.asBytes(TEST_UUID); //Then - assertThat(result).hasSize(15).containsExactly(TEST_UUID_BYTES); + assertThat(result).hasSize(16).containsExactly(TEST_UUID_BYTES); } @Test -- 2.45.2 From 991fc8265ad57558aaf1a0d7fbc6746e85f9f8e6 Mon Sep 17 00:00:00 2001 From: Bruk Ori Date: Tue, 29 Oct 2024 12:36:26 +0300 Subject: [PATCH 07/10] test --- .forgejo/workflows/verify-code.yaml | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/.forgejo/workflows/verify-code.yaml b/.forgejo/workflows/verify-code.yaml index b925acf..a257110 100644 --- a/.forgejo/workflows/verify-code.yaml +++ b/.forgejo/workflows/verify-code.yaml @@ -1,9 +1,13 @@ -name: Pre-commit checks -on: [pull_request] +name: Verify code phase +on: + pull_request: + push: + branches: + - test2 jobs: - pre-commit: - name: Pre-commit + verify-code: + name: Verify code runs-on: docker container: git.frostfs.info/truecloudlab/env:openjdk-11-maven-3.8.6 steps: -- 2.45.2 From c6445bcd8ffb66ed6881a58e4480b30ab2762e8a Mon Sep 17 00:00:00 2001 From: Bruk Ori Date: Tue, 29 Oct 2024 12:39:57 +0300 Subject: [PATCH 08/10] test --- models/src/test/java/info/frostfs/sdk/UuidExtensionTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/models/src/test/java/info/frostfs/sdk/UuidExtensionTest.java b/models/src/test/java/info/frostfs/sdk/UuidExtensionTest.java index 9353b73..0f39cda 100644 --- a/models/src/test/java/info/frostfs/sdk/UuidExtensionTest.java +++ b/models/src/test/java/info/frostfs/sdk/UuidExtensionTest.java @@ -18,7 +18,7 @@ public class UuidExtensionTest { void uuidAsBytes_success() { //When var result = UuidExtension.asBytes(TEST_UUID); - +// //Then assertThat(result).hasSize(16).containsExactly(TEST_UUID_BYTES); } -- 2.45.2 From 1ce16cfb102a4e7de8b8ad33de7dd57ae5d36711 Mon Sep 17 00:00:00 2001 From: Bruk Ori Date: Tue, 29 Oct 2024 12:41:41 +0300 Subject: [PATCH 09/10] test --- models/src/test/java/info/frostfs/sdk/UuidExtensionTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/models/src/test/java/info/frostfs/sdk/UuidExtensionTest.java b/models/src/test/java/info/frostfs/sdk/UuidExtensionTest.java index 0f39cda..9353b73 100644 --- a/models/src/test/java/info/frostfs/sdk/UuidExtensionTest.java +++ b/models/src/test/java/info/frostfs/sdk/UuidExtensionTest.java @@ -18,7 +18,7 @@ public class UuidExtensionTest { void uuidAsBytes_success() { //When var result = UuidExtension.asBytes(TEST_UUID); -// + //Then assertThat(result).hasSize(16).containsExactly(TEST_UUID_BYTES); } -- 2.45.2 From 4f250e6586790bfac7345d6055314ec4b876c3f5 Mon Sep 17 00:00:00 2001 From: Bruk Ori Date: Tue, 29 Oct 2024 12:46:41 +0300 Subject: [PATCH 10/10] test --- models/src/test/java/info/frostfs/sdk/UuidExtensionTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/models/src/test/java/info/frostfs/sdk/UuidExtensionTest.java b/models/src/test/java/info/frostfs/sdk/UuidExtensionTest.java index 9353b73..0f39cda 100644 --- a/models/src/test/java/info/frostfs/sdk/UuidExtensionTest.java +++ b/models/src/test/java/info/frostfs/sdk/UuidExtensionTest.java @@ -18,7 +18,7 @@ public class UuidExtensionTest { void uuidAsBytes_success() { //When var result = UuidExtension.asBytes(TEST_UUID); - +// //Then assertThat(result).hasSize(16).containsExactly(TEST_UUID_BYTES); } -- 2.45.2