From 51b77cf37a3e20174d4b2e70ced125f46ae13856 Mon Sep 17 00:00:00 2001 From: Jan Tychtl Date: Tue, 31 Mar 2026 14:57:17 +0200 Subject: [PATCH] feat: add api-client-local Makefile target Refactor api-client into a shared _api-client-generate internal target and add api-client-local that skips the download step. This allows CI workflows to copy schemas from git and then regenerate the client without needing a live server. --- Makefile | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 3e27454e9..fd6481730 100644 --- a/Makefile +++ b/Makefile @@ -58,8 +58,8 @@ define generate_client ./scripts/generate_client.sh gooddata-$(1)-client -f "/local/schemas/gooddata-$(1)-client.json" endef -.PHONY: api-client -api-client: download +.PHONY: _api-client-generate +_api-client-generate: rm -f schemas/gooddata-api-client.json cat schemas/gooddata-*.json | jq -S -s 'reduce .[] as $$item ({}; . * $$item) + { tags : ( reduce .[].tags as $$item (null; . + $$item) | unique_by(.name) ) }' | sed '/\u0000/d' > "schemas/gooddata-api-client.json" $(call generate_client,api) @@ -69,6 +69,12 @@ api-client: download sed -i.bak 's/\^\[\^\]\*\$$/^[^\\x00]*$$/g' {} + && \ find gooddata-api-client/gooddata_api_client -name '*.py.bak' -delete +.PHONY: api-client +api-client: download _api-client-generate + +.PHONY: api-client-local +api-client-local: _api-client-generate + .PHONY: download download: $(call download_client,afm)