From 868ab6305b09454cc2d21ce4253e5adcb4784306 Mon Sep 17 00:00:00 2001 From: Dmitry Brigadirov Date: Fri, 8 May 2026 21:15:12 +0200 Subject: [PATCH 1/2] fix(build): auto-run api-gen when generated files are missing `go build` fails after a plain `git clone` because the generated API files are gitignored. Add a guard to the `build` target that runs `make api-gen` automatically if the files are absent, so `git clone && make build` works out of the box. --- Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/Makefile b/Makefile index 6d182c9..49bcf2d 100644 --- a/Makefile +++ b/Makefile @@ -12,6 +12,7 @@ LDFLAGS := -s -w \ .PHONY: build install test lint clean smoke build: + @[ -f api/clickupv3/client.gen.go ] || $(MAKE) api-gen go build -ldflags "$(LDFLAGS)" -o bin/$(BINARY) ./cmd/clickup install: From 349b11daf41c406c7c3f197cfb332eddf8477bac Mon Sep 17 00:00:00 2001 From: Isaac Rowntree Date: Wed, 27 May 2026 12:20:43 +1000 Subject: [PATCH 2/2] refactor(build): extract ensure-gen target, apply to install and test The original auto-gen guard only covered `make build`. Extract it into a phony `ensure-gen` target so `install` and `test` also work after a fresh clone without manual `make api-gen`. Co-Authored-By: Claude Opus 4.7 (1M context) --- Makefile | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 49bcf2d..0be575e 100644 --- a/Makefile +++ b/Makefile @@ -9,16 +9,18 @@ LDFLAGS := -s -w \ -X $(MODULE)/internal/build.Commit=$(COMMIT) \ -X $(MODULE)/internal/build.Date=$(DATE) -.PHONY: build install test lint clean smoke +.PHONY: build install test lint clean smoke ensure-gen -build: +ensure-gen: @[ -f api/clickupv3/client.gen.go ] || $(MAKE) api-gen + +build: ensure-gen go build -ldflags "$(LDFLAGS)" -o bin/$(BINARY) ./cmd/clickup -install: +install: ensure-gen go install -ldflags "$(LDFLAGS)" ./cmd/clickup -test: +test: ensure-gen go test ./... # Round-trip the typed-wrapper code paths against a real ClickUp workspace.