Skip to content

fix(build): auto-run api-gen when generated files are missing#18

Open
neptunix wants to merge 1 commit into
triptechtravel:mainfrom
neptunix:fix/build-without-codegen
Open

fix(build): auto-run api-gen when generated files are missing#18
neptunix wants to merge 1 commit into
triptechtravel:mainfrom
neptunix:fix/build-without-codegen

Conversation

@neptunix
Copy link
Copy Markdown
Contributor

@neptunix neptunix commented May 8, 2026

Problem

go build fails after a plain git clone because the generated API files (api/clickupv{2,3}/*.gen.go, internal/apiv{2,3}/operations.gen.go) are gitignored. This produces 14 compile errors for types that only exist in the generated code:

internal/apiv3/chat.go: undefined: GetChatChannelsParams
pkg/cmdutil/status.go: undefined: apiv2.GetSpace
... (14 total)

Any Dockerfile or CI pipeline that does git clone && go build is broken.

Fix

One line added to the build target — if the generated files are absent, run make api-gen first:

build:
	@[ -f api/clickupv3/client.gen.go ] || $(MAKE) api-gen
	go build ...

Verification

git clone https://github.com/triptechtravel/clickup-cli && cd clickup-cli
rm -f api/clickupv2/*.gen.go api/clickupv3/*.gen.go internal/apiv*/operations.gen.go
make build   # triggers api-gen then builds successfully

`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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant