From bb4e2dc678e82bae05ea2a21dac59d0d2c64af68 Mon Sep 17 00:00:00 2001 From: Todd Baert Date: Mon, 27 May 2024 16:31:27 -0400 Subject: [PATCH 1/2] chore: Makefile full schema versioning Signed-off-by: Todd Baert --- Makefile | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 8b4064819..56d89a3ac 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,7 @@ PHONY: .docker-build .build .run .mockgen PREFIX=/usr/local -PUBLIC_JSON_SCHEMA_DIR=docs/schema/v0/ +JSON_SCHEMA_VERSION=v0.2.3 +PUBLIC_JSON_SCHEMA_DIR=docs/schema/$(JSON_SCHEMA_VERSION)/ ALL_GO_MOD_DIRS := $(shell find . -type f -name 'go.mod' -exec dirname {} \; | sort) FLAGD_DEV_NAMESPACE ?= flagd-dev @@ -116,7 +117,7 @@ markdownlint-fix: .PHONY: pull-schemas-submodule pull-schemas-submodule: - git submodule update schemas + cd schemas/ && git checkout json/json-schema-$(JSON_SCHEMA_VERSION) .PHONY: generate-proto-docs generate-proto-docs: pull-schemas-submodule @@ -125,11 +126,12 @@ generate-proto-docs: pull-schemas-submodule && sed '/^## Table of Contents/,/#top/d' ${PWD}/$(DOCS_DIR)/reference/specifications/protos-with-toc.md >> ${PWD}/$(DOCS_DIR)/reference/specifications/protos.md \ && rm -f ${PWD}/$(DOCS_DIR)/reference/specifications/protos-with-toc.md -# Update the schema at flagd.dev -# PUBLIC_JSON_SCHEMA_DIR above controls the dir (and therefore major version) +# update or add the publicly served schema at https://flagd.dev/schema/${JSON_SCHEMA_VERSION}/flags.json +# update JSON_SCHEMA_VERSION var at the top of this file with a the version to be updated or addeds .PHONY: update-public-schema update-public-schema: pull-schemas-submodule - rm -f $(PUBLIC_JSON_SCHEMA_DIR)*.json + rm -rf ./$(PUBLIC_JSON_SCHEMA_DIR) || true + mkdir ./$(PUBLIC_JSON_SCHEMA_DIR) cp schemas/json/*.json $(PUBLIC_JSON_SCHEMA_DIR) .PHONY: run-web-docs From 89723362a6dc583c1fda7a5f809a1fa3389fd81d Mon Sep 17 00:00:00 2001 From: Todd Baert Date: Mon, 27 May 2024 16:33:03 -0400 Subject: [PATCH 2/2] Update Makefile Signed-off-by: Todd Baert --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 56d89a3ac..f1686a6d3 100644 --- a/Makefile +++ b/Makefile @@ -127,7 +127,7 @@ generate-proto-docs: pull-schemas-submodule && rm -f ${PWD}/$(DOCS_DIR)/reference/specifications/protos-with-toc.md # update or add the publicly served schema at https://flagd.dev/schema/${JSON_SCHEMA_VERSION}/flags.json -# update JSON_SCHEMA_VERSION var at the top of this file with a the version to be updated or addeds +# update JSON_SCHEMA_VERSION var at the top of this file with the version to be updated or added and served publicly .PHONY: update-public-schema update-public-schema: pull-schemas-submodule rm -rf ./$(PUBLIC_JSON_SCHEMA_DIR) || true