This is an automated email from the ASF dual-hosted git repository.
yzheng pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/polaris.git
The following commit(s) were added to refs/heads/main by this push:
new 11836aba7 Sort Makefile targets (#3829)
11836aba7 is described below
commit 11836aba77f591269a30f6f4d3b4604733e2cd35
Author: Yong Zheng <[email protected]>
AuthorDate: Thu Feb 19 12:40:16 2026 -0600
Sort Makefile targets (#3829)
---
Makefile | 233 ++++++++++++++++++++++++++++++++-------------------------------
1 file changed, 117 insertions(+), 116 deletions(-)
diff --git a/Makefile b/Makefile
index 50532bff3..f6f7afbb5 100644
--- a/Makefile
+++ b/Makefile
@@ -53,17 +53,6 @@ version: ## Display version information
.PHONY: build
build: build-server build-admin ## Build Polaris server, admin, and container
images
-build-server: DEPENDENCIES := java21 $(DOCKER)
-.PHONY: build-server
-build-server: check-dependencies ## Build Polaris server and container image
- @echo "--- Building Polaris server ---"
- @./gradlew \
- :polaris-server:assemble \
- :polaris-server:quarkusAppPartsBuild --rerun \
- -Dquarkus.container-image.build=$(BUILD_IMAGE) \
- -Dquarkus.docker.executable-name=$(DOCKER)
- @echo "--- Polaris server build complete ---"
-
build-admin: DEPENDENCIES := java21 $(DOCKER)
.PHONY: build-admin
build-admin: check-dependencies ## Build Polaris admin and container image
@@ -75,6 +64,24 @@ build-admin: check-dependencies ## Build Polaris admin and
container image
-Dquarkus.docker.executable-name=$(DOCKER)
@echo "--- Polaris admin build complete ---"
+build-cleanup: DEPENDENCIES := java21
+.PHONY: build-cleanup
+build-cleanup: check-dependencies ## Clean build artifacts
+ @echo "--- Cleaning up build artifacts ---"
+ @./gradlew clean
+ @echo "--- Build artifacts cleaned ---"
+
+build-server: DEPENDENCIES := java21 $(DOCKER)
+.PHONY: build-server
+build-server: check-dependencies ## Build Polaris server and container image
+ @echo "--- Building Polaris server ---"
+ @./gradlew \
+ :polaris-server:assemble \
+ :polaris-server:quarkusAppPartsBuild --rerun \
+ -Dquarkus.container-image.build=$(BUILD_IMAGE) \
+ -Dquarkus.docker.executable-name=$(DOCKER)
+ @echo "--- Polaris server build complete ---"
+
build-spark-plugin-3.5-2.12: DEPENDENCIES := java21
.PHONY: build-spark-plugin-3.5-2.12
build-spark-plugin-3.5-2.12: check-dependencies ## Build Spark plugin v3.5
with Scala v2.12
@@ -91,13 +98,6 @@ build-spark-plugin-3.5-2.13: check-dependencies ## Build
Spark plugin v3.5 with
:polaris-spark-3.5_2.13:assemble
@echo "--- Spark plugin v3.5 with Scala v2.13 build complete ---"
-build-cleanup: DEPENDENCIES := java21
-.PHONY: build-cleanup
-build-cleanup: check-dependencies ## Clean build artifacts
- @echo "--- Cleaning up build artifacts ---"
- @./gradlew clean
- @echo "--- Build artifacts cleaned ---"
-
spotless-apply: DEPENDENCIES := java21
.PHONY: spotless-apply
spotless-apply: check-dependencies ## Apply code formatting using Spotless
Gradle plugin.
@@ -126,23 +126,36 @@ client-install-dependencies: $(VENV_DIR)
.PHONY: client-setup-env
client-setup-env: $(VENV_DIR) client-install-dependencies
-.PHONY: client-lint
-client-lint: client-setup-env ## Run linting checks for Polaris client
- @echo "--- Running client linting checks ---"
- @$(ACTIVATE_AND_CD) && uv run --active pre-commit run --files
integration_tests/* generate_clients.py apache_polaris/cli/*
apache_polaris/cli/command/* apache_polaris/cli/options/* test/*
- @echo "--- Client linting checks complete ---"
-
-.PHONY: client-regenerate
-client-regenerate: client-setup-env ## Regenerate the client code
- @echo "--- Regenerating client code ---"
- @$(ACTIVATE_AND_CD) && $(PYTHON) -B generate_clients.py
- @echo "--- Client code regeneration complete ---"
+.PHONY: client-build
+client-build: client-setup-env ## Build client distribution. Pass FORMAT=sdist
or FORMAT=wheel to build a specific format.
+ @echo "--- Building client distribution ---"
+ @if [ -n "$(FORMAT)" ]; then \
+ if [ "$(FORMAT)" != "sdist" ] && [ "$(FORMAT)" != "wheel" ];
then \
+ echo "Error: Invalid format '$(FORMAT)'. Supported
formats are 'sdist' and 'wheel'." >&2; \
+ exit 1; \
+ fi; \
+ echo "Building with format: $(FORMAT)"; \
+ $(ACTIVATE_AND_CD) && uv build --format $(FORMAT); \
+ else \
+ echo "Building default distribution (sdist and wheel)"; \
+ $(ACTIVATE_AND_CD) && uv build; \
+ fi
+ @echo "--- Client distribution build complete ---"
-.PHONY: client-unit-test
-client-unit-test: client-setup-env ## Run client unit tests
- @echo "--- Running client unit tests ---"
- @$(ACTIVATE_AND_CD) && uv run --active pytest test/
- @echo "--- Client unit tests complete ---"
+.PHONY: client-cleanup
+client-cleanup: ## Cleanup virtual environment and Python cache files
+ @echo "--- Cleaning up virtual environment and Python cache files ---"
+ @echo "Attempting to remove virtual environment directory:
$(VENV_DIR)..."
+ @if [ -n "$(VENV_DIR)" ] && [ -d "$(VENV_DIR)" ]; then \
+ rm -rf "$(VENV_DIR)"; \
+ echo "Virtual environment removed."; \
+ else \
+ echo "Virtual environment directory '$(VENV_DIR)' not found or
VENV_DIR is empty. No action taken."; \
+ fi
+ @echo "Cleaning up Python cache files..."
+ @find $(PYTHON_CLIENT_DIR) -type f -name "*.pyc" -delete
+ @find $(PYTHON_CLIENT_DIR) -type d -name "__pycache__" -delete
+ @echo "--- Virtual environment and Python cache cleanup complete ---"
.PHONY: client-integration-test
client-integration-test: build-server client-setup-env ## Run client
integration tests
@@ -169,21 +182,11 @@ client-license-check: client-setup-env ## Run license
compliance check
@$(ACTIVATE_AND_CD) && pip-licenses
@echo "--- License compliance check complete ---"
-.PHONY: client-build
-client-build: client-setup-env ## Build client distribution. Pass FORMAT=sdist
or FORMAT=wheel to build a specific format.
- @echo "--- Building client distribution ---"
- @if [ -n "$(FORMAT)" ]; then \
- if [ "$(FORMAT)" != "sdist" ] && [ "$(FORMAT)" != "wheel" ];
then \
- echo "Error: Invalid format '$(FORMAT)'. Supported
formats are 'sdist' and 'wheel'." >&2; \
- exit 1; \
- fi; \
- echo "Building with format: $(FORMAT)"; \
- $(ACTIVATE_AND_CD) && uv build --format $(FORMAT); \
- else \
- echo "Building default distribution (sdist and wheel)"; \
- $(ACTIVATE_AND_CD) && uv build; \
- fi
- @echo "--- Client distribution build complete ---"
+.PHONY: client-lint
+client-lint: client-setup-env ## Run linting checks for Polaris client
+ @echo "--- Running client linting checks ---"
+ @$(ACTIVATE_AND_CD) && uv run --active pre-commit run --files
integration_tests/* generate_clients.py apache_polaris/cli/*
apache_polaris/cli/command/* apache_polaris/cli/options/* test/*
+ @echo "--- Client linting checks complete ---"
.PHONY: client-nightly-publish
client-nightly-publish: client-setup-env ## Build and publish nightly version
to Test PyPI
@@ -198,23 +201,40 @@ client-nightly-publish: client-setup-env ## Build and
publish nightly version to
uv publish --index testpypi
@echo "--- Nightly publish complete ---"
-.PHONY: client-cleanup
-client-cleanup: ## Cleanup virtual environment and Python cache files
- @echo "--- Cleaning up virtual environment and Python cache files ---"
- @echo "Attempting to remove virtual environment directory:
$(VENV_DIR)..."
- @if [ -n "$(VENV_DIR)" ] && [ -d "$(VENV_DIR)" ]; then \
- rm -rf "$(VENV_DIR)"; \
- echo "Virtual environment removed."; \
- else \
- echo "Virtual environment directory '$(VENV_DIR)' not found or
VENV_DIR is empty. No action taken."; \
- fi
- @echo "Cleaning up Python cache files..."
- @find $(PYTHON_CLIENT_DIR) -type f -name "*.pyc" -delete
- @find $(PYTHON_CLIENT_DIR) -type d -name "__pycache__" -delete
- @echo "--- Virtual environment and Python cache cleanup complete ---"
+.PHONY: client-regenerate
+client-regenerate: client-setup-env ## Regenerate the client code
+ @echo "--- Regenerating client code ---"
+ @$(ACTIVATE_AND_CD) && $(PYTHON) -B generate_clients.py
+ @echo "--- Client code regeneration complete ---"
+
+.PHONY: client-unit-test
+client-unit-test: client-setup-env ## Run client unit tests
+ @echo "--- Running client unit tests ---"
+ @$(ACTIVATE_AND_CD) && uv run --active pytest test/
+ @echo "--- Client unit tests complete ---"
##@ Helm
+.PHONY: helm
+helm: helm-schema-generate helm-doc-generate helm-lint helm-unittest ## Run
all Helm targets (schema, docs, unittest, lint)
+
+helm-doc-generate: DEPENDENCIES := helm-docs
+.PHONY: helm-doc-generate
+helm-doc-generate: check-dependencies ## Generate Helm chart documentation
+ @echo "--- Generating Helm documentation ---"
+ @helm-docs --chart-search-root=helm --template-files helm.md.gotmpl
--output-file ../../site/content/in-dev/unreleased/helm.md
+ @echo "--- Helm documentation generated and copied ---"
+
+helm-doc-verify: DEPENDENCIES := helm-docs git
+.PHONY: helm-doc-verify
+helm-doc-verify: helm-doc-generate ## Verify Helm chart documentation is up to
date
+ @echo "--- Verifying Helm documentation is up to date ---"
+ @if ! git diff --exit-code site/content/in-dev/unreleased/helm.md; then
\
+ echo "ERROR: Helm documentation is out of date. Please run
'make helm-doc-generate' and commit the changes."; \
+ exit 1; \
+ fi
+ @echo "--- Helm documentation is up to date ---"
+
helm-install-plugins: DEPENDENCIES := helm
.PHONY: helm-install-plugins
helm-install-plugins: check-dependencies ## Install required Helm plugins
(unittest, schema)
@@ -239,15 +259,12 @@ helm-install-plugins: check-dependencies ## Install
required Helm plugins (unitt
fi
@echo "--- Helm plugins installed ---"
-helm-schema-verify: DEPENDENCIES := helm git
-.PHONY: helm-schema-verify
-helm-schema-verify: helm-schema-generate ## Verify Helm chart JSON schema is
up to date
- @echo "--- Verifying Helm values schema is up to date ---"
- @if ! git diff --exit-code helm/polaris/values.schema.json; then \
- echo "ERROR: Helm schema is out of date. Please run 'make
helm-schema-generate' and commit the changes."; \
- exit 1; \
- fi
- @echo "--- Helm values schema is up to date ---"
+helm-lint: DEPENDENCIES := ct yamllint
+.PHONY: helm-lint
+helm-lint: check-dependencies ## Run Helm chart lint check
+ @echo "--- Running Helm chart linting ---"
+ @ct lint --charts helm/polaris
+ @echo "--- Helm chart linting complete ---"
helm-schema-generate: DEPENDENCIES := helm
.PHONY: helm-schema-generate
@@ -256,22 +273,15 @@ helm-schema-generate: helm-install-plugins ## Generate
Helm chart JSON schema fr
@helm schema -f helm/polaris/values.yaml -o
helm/polaris/values.schema.json --use-helm-docs --draft 7
@echo "--- Helm values schema generated ---"
-helm-doc-generate: DEPENDENCIES := helm-docs
-.PHONY: helm-doc-generate
-helm-doc-generate: check-dependencies ## Generate Helm chart documentation
- @echo "--- Generating Helm documentation ---"
- @helm-docs --chart-search-root=helm --template-files helm.md.gotmpl
--output-file ../../site/content/in-dev/unreleased/helm.md
- @echo "--- Helm documentation generated and copied ---"
-
-helm-doc-verify: DEPENDENCIES := helm-docs git
-.PHONY: helm-doc-verify
-helm-doc-verify: helm-doc-generate ## Verify Helm chart documentation is up to
date
- @echo "--- Verifying Helm documentation is up to date ---"
- @if ! git diff --exit-code site/content/in-dev/unreleased/helm.md; then
\
- echo "ERROR: Helm documentation is out of date. Please run
'make helm-doc-generate' and commit the changes."; \
+helm-schema-verify: DEPENDENCIES := helm git
+.PHONY: helm-schema-verify
+helm-schema-verify: helm-schema-generate ## Verify Helm chart JSON schema is
up to date
+ @echo "--- Verifying Helm values schema is up to date ---"
+ @if ! git diff --exit-code helm/polaris/values.schema.json; then \
+ echo "ERROR: Helm schema is out of date. Please run 'make
helm-schema-generate' and commit the changes."; \
exit 1; \
fi
- @echo "--- Helm documentation is up to date ---"
+ @echo "--- Helm values schema is up to date ---"
helm-unittest: DEPENDENCIES := helm
.PHONY: helm-unittest
@@ -280,17 +290,29 @@ helm-unittest: helm-install-plugins ## Run Helm chart
unittest
@helm unittest helm/polaris
@echo "--- Helm chart unittest complete ---"
-helm-lint: DEPENDENCIES := ct yamllint
-.PHONY: helm-lint
-helm-lint: check-dependencies ## Run Helm chart lint check
- @echo "--- Running Helm chart linting ---"
- @ct lint --charts helm/polaris
- @echo "--- Helm chart linting complete ---"
+##@ Minikube
-.PHONY: helm
-helm: helm-schema-generate helm-doc-generate helm-lint helm-unittest ## Run
all Helm targets (schema, docs, unittest, lint)
+minikube-cleanup: DEPENDENCIES := minikube $(DOCKER)
+.PHONY: minikube-cleanup
+minikube-cleanup: check-dependencies ## Cleanup the Minikube cluster
+ @echo "--- Checking Minikube cluster status ---"
+ @if minikube status -p $(MINIKUBE_PROFILE) >/dev/null 2>&1; then \
+ echo "--- Cleanup Minikube cluster ---"; \
+ minikube delete -p $(MINIKUBE_PROFILE); \
+ echo "--- Minikube cluster removed ---"; \
+ else \
+ echo "--- Minikube cluster does not exist. Skipping cleanup
---"; \
+ fi
-##@ Minikube
+minikube-load-images: DEPENDENCIES := minikube $(DOCKER)
+.PHONY: minikube-load-images
+minikube-load-images: minikube-start-cluster check-dependencies ## Load local
Docker images into the Minikube cluster
+ @echo "--- Loading images into Minikube cluster ---"
+ @minikube image load -p $(MINIKUBE_PROFILE)
docker.io/apache/polaris:latest
+ @minikube image tag -p $(MINIKUBE_PROFILE)
docker.io/apache/polaris:latest docker.io/apache/polaris:$(BUILD_VERSION)
+ @minikube image load -p $(MINIKUBE_PROFILE)
docker.io/apache/polaris-admin-tool:latest
+ @minikube image tag -p $(MINIKUBE_PROFILE)
docker.io/apache/polaris-admin-tool:latest
docker.io/apache/polaris-admin-tool:$(BUILD_VERSION)
+ @echo "--- Images loaded into Minikube cluster ---"
minikube-start-cluster: DEPENDENCIES := minikube $(DOCKER)
.PHONY: minikube-start-cluster
@@ -320,27 +342,6 @@ minikube-stop-cluster: check-dependencies ## Stop the
Minikube cluster
echo "--- Minikube cluster is already stopped or does not
exist. Skipping stop ---"; \
fi
-minikube-load-images: DEPENDENCIES := minikube $(DOCKER)
-.PHONY: minikube-load-images
-minikube-load-images: minikube-start-cluster check-dependencies ## Load local
Docker images into the Minikube cluster
- @echo "--- Loading images into Minikube cluster ---"
- @minikube image load -p $(MINIKUBE_PROFILE)
docker.io/apache/polaris:latest
- @minikube image tag -p $(MINIKUBE_PROFILE)
docker.io/apache/polaris:latest docker.io/apache/polaris:$(BUILD_VERSION)
- @minikube image load -p $(MINIKUBE_PROFILE)
docker.io/apache/polaris-admin-tool:latest
- @minikube image tag -p $(MINIKUBE_PROFILE)
docker.io/apache/polaris-admin-tool:latest
docker.io/apache/polaris-admin-tool:$(BUILD_VERSION)
- @echo "--- Images loaded into Minikube cluster ---"
-
-minikube-cleanup: DEPENDENCIES := minikube $(DOCKER)
-.PHONY: minikube-cleanup
-minikube-cleanup: check-dependencies ## Cleanup the Minikube cluster
- @echo "--- Checking Minikube cluster status ---"
- @if minikube status -p $(MINIKUBE_PROFILE) >/dev/null 2>&1; then \
- echo "--- Cleanup Minikube cluster ---"; \
- minikube delete -p $(MINIKUBE_PROFILE); \
- echo "--- Minikube cluster removed ---"; \
- else \
- echo "--- Minikube cluster does not exist. Skipping cleanup
---"; \
- fi
##@ Pre-commit