diff --git a/AGENTS.md b/AGENTS.md index 71a3d2d..92c8665 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -197,10 +197,15 @@ When working on this project, follow this workflow: ### 7. Commit Changes - **ALWAYS commit** after successful implementation -- Ensure the code builds (`go build`) -- Ensure all tests pass (`go test`) -- Ensure there are no linter issues (`make lint`) -- Ensure there are no fmt issues (`make fmt-check`) +- Verify that everything is in order before commit: + - there is a Gitea Runner image in ci/pre-commit + - check if we have wirelos/pre-commit locally. if not, build it + - start the gitea-runner locally and mount the project directory. + - Ensure the code builds (`go build`) + - Ensure all tests pass (`go test`) + - Ensure there are no linter issues (`make lint`) + - Ensure there are no fmt issues (`make fmt-check`) + - If there are issues, fix them before comitting - Verify all acceptance criteria are met - Write a clear, descriptive commit message diff --git a/ci/pre-commit/Dockerfile b/ci/pre-commit/Dockerfile new file mode 100644 index 0000000..2c90d43 --- /dev/null +++ b/ci/pre-commit/Dockerfile @@ -0,0 +1,4 @@ +FROM alpine:latest + +# install node (Alpine) +RUN apk add --no-cache nodejs npm gcc build-base musl-dev curl make \ No newline at end of file diff --git a/ci/runner/Dockerfile b/ci/runner/Dockerfile deleted file mode 100644 index e69de29..0000000 diff --git a/scripts/pre-commit-check.sh b/scripts/pre-commit-check.sh index 8c2218a..a808beb 100755 --- a/scripts/pre-commit-check.sh +++ b/scripts/pre-commit-check.sh @@ -30,11 +30,20 @@ docker run --rm \ -w /workspace \ "$IMAGE_NAME:latest" \ sh -c " - echo '📦 Installing Go and required tools...' - apk add --no-cache go protobuf protobuf-dev bash git || exit 1 + echo '📦 Installing Go 1.25.3 and required tools...' + apk add --no-cache protobuf protobuf-dev bash git wget tar || exit 1 + + # Install Go 1.25.3 + cd /tmp && \ + wget -q https://go.dev/dl/go1.25.3.linux-amd64.tar.gz && \ + tar -C /usr/local -xzf go1.25.3.linux-amd64.tar.gz && \ + rm go1.25.3.linux-amd64.tar.gz || exit 1 + + export PATH=/usr/local/go/bin:\$PATH:/root/go/bin + export GOROOT=/usr/local/go + export GOPATH=/root/go echo '📥 Installing Go protobuf plugins...' - export PATH=\$PATH:/root/go/bin go install google.golang.org/protobuf/cmd/protoc-gen-go@latest || exit 1 go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest || exit 1 diff --git a/services/audit/internal/api/server.go b/services/audit/internal/api/server.go index 7fa34a2..798dd0d 100644 --- a/services/audit/internal/api/server.go +++ b/services/audit/internal/api/server.go @@ -2,8 +2,8 @@ package api import ( - "math" "context" + "math" auditv1 "git.dcentral.systems/toolz/goplt/api/proto/generated/audit/v1" "git.dcentral.systems/toolz/goplt/services/audit/internal/service" diff --git a/services/identity/internal/password/password_test.go b/services/identity/internal/password/password_test.go index 8166343..d5190d7 100644 --- a/services/identity/internal/password/password_test.go +++ b/services/identity/internal/password/password_test.go @@ -208,4 +208,3 @@ func TestHash_Uniqueness(t *testing.T) { assert.True(t, valid, "All hashes should verify correctly") } } -