From 76880d901aaaffc9d2937690aa84ad354845fcc3 Mon Sep 17 00:00:00 2001 From: Pasha Sviderski Date: Thu, 19 Mar 2026 17:32:48 +1000 Subject: [PATCH] chore: move proto generation to mise tasks --- .github/workflows/go-tests.yml | 6 +++--- Makefile | 14 +++++--------- mise.toml | 7 +++++++ 3 files changed, 15 insertions(+), 12 deletions(-) diff --git a/.github/workflows/go-tests.yml b/.github/workflows/go-tests.yml index ecffadc2..d71b7c1c 100644 --- a/.github/workflows/go-tests.yml +++ b/.github/workflows/go-tests.yml @@ -69,7 +69,7 @@ jobs: - name: Generate Protobuf files run: | - make proto - # check if the generated files are up to date + mise run proto + # Check if the generated files are up to date. git diff --exit-code || - (echo "Generated protobuf files are not up to date. Please run 'make proto' and commit the changes." && exit 1) + (echo "Generated protobuf files are not up to date. Please run 'mise run proto' and commit the changes." && exit 1) diff --git a/Makefile b/Makefile index bdc7b3f5..106b3e6e 100644 --- a/Makefile +++ b/Makefile @@ -1,3 +1,5 @@ +# TODO: Makefile is deprecated, add new targets as mise tasks in mise.toml instead. + CORROSION_IMAGE ?= ghcr.io/psviderski/corrosion:latest UCIND_IMAGE ?= ghcr.io/psviderski/ucind:latest @@ -42,13 +44,7 @@ ucind-cluster: .PHONY: proto proto: - protoc --go_out=. --go_opt=paths=source_relative --go-grpc_out=. --go-grpc_opt=paths=source_relative \ - --proto_path=. --proto_path=internal/machine/api/vendor internal/machine/api/pb/*.proto - -.PHONY: proto-mise -proto-mise: - mise exec -- protoc --go_out=. --go_opt=paths=source_relative --go-grpc_out=. --go-grpc_opt=paths=source_relative \ - --proto_path=. --proto_path=internal/machine/api/vendor internal/machine/api/pb/*.proto + mise run proto .PHONY: corrosion-image corrosion-image: @@ -84,12 +80,12 @@ test-e2e: .PHONY: test-clean test-clean: - @CONTAINERS=$$(docker ps --filter "name=ucind-test" -q); \ + @CONTAINERS=$$(docker ps --filter "label=ucind.managed" -q); \ if [ -n "$$CONTAINERS" ]; then \ echo "Killing containers..."; \ docker kill $$CONTAINERS; \ fi; \ - CONTAINERS_STOPPED=$$(docker ps -a --filter "name=ucind-test" -q); \ + CONTAINERS_STOPPED=$$(docker ps -a --filter "label=ucind.managed" -q); \ if [ -n "$$CONTAINERS_STOPPED" ]; then \ echo "Removing stopped containers..."; \ docker rm $$CONTAINERS_STOPPED; \ diff --git a/mise.toml b/mise.toml index 9e6329c2..57f74ed9 100644 --- a/mise.toml +++ b/mise.toml @@ -13,6 +13,13 @@ protoc-gen-go-grpc = "1.5.1" [env] _.file = ".env" +[tasks.proto] +description = "Regenerate gRPC API code from .proto files" +run = """ +protoc --go_out=. --go_opt=paths=source_relative --go-grpc_out=. --go-grpc_opt=paths=source_relative \ + --proto_path=. --proto_path=internal/machine/api/vendor internal/machine/api/pb/*.proto +""" + [tasks.mise-lock] description = "Update mise.lock with hashes for all platforms" run = "mise lock --platform linux-x64,macos-arm64"