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-tools.git


The following commit(s) were added to refs/heads/main by this push:
     new 62b6687  Sort Makefile targets and factor (#171)
62b6687 is described below

commit 62b668755a880f8706c1110e3ea8cdfec1d3ec3e
Author: Yong Zheng <[email protected]>
AuthorDate: Tue Feb 24 10:03:56 2026 -0600

    Sort Makefile targets and factor (#171)
---
 Makefile            | 106 +++++++++++++++++-----------------------------
 benchmarks/Makefile | 119 +++++++++++++++++++++++++++++++++++-----------------
 console/Makefile    | 100 +++++++++++++++++++++++++++++++++----------
 3 files changed, 196 insertions(+), 129 deletions(-)

diff --git a/Makefile b/Makefile
index 96d5a9e..e8511c0 100644
--- a/Makefile
+++ b/Makefile
@@ -28,103 +28,75 @@ help: ## Display this help
 
 ##@ Benchmarks
 
-.PHONY: benchmarks-pre-requisite
-benchmarks-pre-requisite:
-       @if [ ! -f "benchmarks/application.conf" ]; then \
-               echo "ERROR: benchmarks/application.conf is missing"; \
-               exit 1; \
-       fi
+# Note: APPLICATION_CONF_PATH can be passed to specify a custom config file 
path.
+# Can be an absolute path or relative to the benchmarks/ directory.
+
+.PHONY: benchmarks-create-commits-simulation
+benchmarks-create-commits-simulation: ## Run create commits simulation
+       @$(MAKE) -C benchmarks create-commits-simulation
 
 .PHONY: benchmarks-create-dataset-simulation
-benchmarks-create-dataset-simulation: benchmarks-pre-requisite ## Run create 
dataset simulation
-       @echo "--- Running create dataset simulation ---"
+benchmarks-create-dataset-simulation: ## Run create dataset simulation
        @$(MAKE) -C benchmarks create-dataset-simulation
-       @echo "--- Create dataset simulation completed ---"
 
 .PHONY: benchmarks-read-simulation
-benchmarks-read-simulation: benchmarks-pre-requisite ## Run read simulation
-       @echo "--- Running read simulation ---"
+benchmarks-read-simulation: ## Run read simulation
        @$(MAKE) -C benchmarks read-simulation
-       @echo "--- Read simulation completed ---"
 
 .PHONY: benchmarks-read-update-simulation
-benchmarks-read-update-simulation: benchmarks-pre-requisite ## Run read/update 
simulation
-       @echo "--- Running read/update simulation ---"
+benchmarks-read-update-simulation: ## Run read/update simulation
        @$(MAKE) -C benchmarks read-update-simulation
-       @echo "--- Read/Update simulation completed ---"
-
-.PHONY: benchmarks-create-commits-simulation
-benchmarks-create-commits-simulation: benchmarks-pre-requisite ## Run create 
commits simulation
-       @echo "--- Running create commits simulation ---"
-       @$(MAKE) -C benchmarks create-commits-simulation
-       @echo "--- Create commits simulation completed ---"
 
-.PHONY: benchmarks-weighted-workload-simulation
-benchmarks-weighted-workload-simulation: benchmarks-pre-requisite ## Run 
weighted workload simulation
-       @echo "--- Running weighted workload simulation ---"
-       @$(MAKE) -C benchmarks weighted-workload-simulation
-       @echo "--- Weighted workload simulation completed ---"
+.PHONY: benchmarks-reports-clean
+benchmarks-reports-clean: ## Clean benchmark reports
+       @$(MAKE) -C benchmarks reports-clean
 
 .PHONY: benchmarks-reports-list
 benchmarks-reports-list: ## List benchmark reports
-       @echo "--- Listing benchmark reports ---"
        @$(MAKE) -C benchmarks reports-list
-       @echo "--- List benchmark reports completed ---"
 
-.PHONY: benchmarks-reports-clean
-benchmarks-reports-clean: ## Clean benchmark reports
-       @echo "--- Cleaning benchmark reports ---"
-       @$(MAKE) -C benchmarks reports-clean
-       @echo "--- Clean benchmark reports completed ---"
+.PHONY: benchmarks-weighted-workload-simulation
+benchmarks-weighted-workload-simulation: ## Run weighted workload simulation
+       @$(MAKE) -C benchmarks weighted-workload-simulation
 
+.PHONY: benchmarks-version
+benchmarks-version: ## Display version for benchmarks project
+       @$(MAKE) -C benchmarks version
 
 ##@ Console
 
+.PHONY: console-build
+console-build: ## Build console project
+       @$(MAKE) -C console build
+
 .PHONY: console-build-docker
 console-build-docker: ## Build docker image for console project
-       @echo "--- Building docker image for console project---"
        @$(MAKE) -C console build-docker
-       @echo "--- Docker image for console project built ---"
+
+.PHONY: console-dev
+console-dev: ## Run the console project in development mode
+       @$(MAKE) -C console dev
+
+.PHONY: console-format-check
+console-format-check: ## Check formatting in the console project
+       @$(MAKE) -C console format-check
+
+.PHONY: console-format-fix
+console-format-fix: ## Fix formatting in the console project
+       @$(MAKE) -C console format-fix
 
 .PHONY: console-install
 console-install: ## Install dependencies for console project
-       @echo "--- Install dependencies for console project ---"
        @$(MAKE) -C console install
-       @echo "--- Dependencies for console project completed ---"
-
-.PHONY: console-build
-console-build: console-install ## Build console project
-       @echo "--- Building console project---"
-       @$(MAKE) -C console build
-       @echo "--- Console project built ---"
 
 .PHONY: console-lint
-console-lint: console-install ## Lint the console project
-       @echo "--- Linting the console project ---"
+console-lint: ## Lint the console project
        @$(MAKE) -C console lint
-       @echo "--- Console project linted ---"
 
 .PHONY: console-lint-fix
-console-lint-fix: console-install ## Fix linting issues in the console project
-       @echo "--- Fixing linting issues in the console project ---"
+console-lint-fix: ## Fix linting issues in the console project
        @$(MAKE) -C console lint-fix
-       @echo "--- Linting issues in the console project fixed ---"
-
-.PHONY: console-format-check
-console-format-check: console-install ## Check formatting in the console 
project
-       @echo "--- Checking formatting in the console project ---"
-       @$(MAKE) -C console format-check
-       @echo "--- Formatting in the console project checked ---"
-
-.PHONY: console-format-fix
-console-format-fix: console-install ## Fix formatting in the console project
-       @echo "--- Fixing formatting in the console project ---"
-       @$(MAKE) -C console format-fix
-       @echo "--- Formatting in the console project fixed ---"
-
-.PHONY: console-dev
-console-dev: console-install ## Run the console project in development mode
-       @echo "--- Running console project in development mode ---"
-       @$(MAKE) -C console dev
-       @echo "--- Console project in development mode completed ---"
 
+.PHONY: console-version
+console-version: ## Display version for console project
+       @$(MAKE) -C console version
diff --git a/benchmarks/Makefile b/benchmarks/Makefile
index ee9f0d2..7ece33c 100644
--- a/benchmarks/Makefile
+++ b/benchmarks/Makefile
@@ -1,49 +1,87 @@
+#  Licensed to the Apache Software Foundation (ASF) under one
+#  or more contributor license agreements.  See the NOTICE file
+#  distributed with this work for additional information
+#  regarding copyright ownership.  The ASF licenses this file
+#  to you under the Apache License, Version 2.0 (the
+#  "License"); you may not use this file except in compliance
+#  with the License.  You may obtain a copy of the License at
 #
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
+#    http://www.apache.org/licenses/LICENSE-2.0
 #
+#  Unless required by applicable law or agreed to in writing,
+#  software distributed under the License is distributed on an
+#  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+#  KIND, either express or implied.  See the License for the
+#  specific language governing permissions and limitations
+#  under the License.
+
+# Configures the shell for recipes to use bash, enabling bash commands and 
ensuring
+# that recipes exit on any command failure (including within pipes).
+SHELL = /usr/bin/env bash -o pipefail
+.SHELLFLAGS = -ec
+
+## Variables
+APPLICATION_CONF_PATH ?= application.conf
+
+## Version information
+GIT_COMMIT := $(shell git rev-parse HEAD)
+
+##@ General
+
+.PHONY: help
+help: ## Display this help
+       @awk 'BEGIN {FS = ":.*##"; printf "\nUsage:\n  make 
\033[36m<target>\033[0m\n"} /^[a-zA-Z_0-9\.-]+:.*?##/ { printf "  
\033[36m%-40s\033[0m %s\n", $$1, $$2 } /^##@/ { printf "\n\033[1m%s\033[0m\n", 
substr($$0, 5) } ' $(MAKEFILE_LIST)
+
+.PHONY: version
+version: ## Display version information
+       @echo "Git commit: ${GIT_COMMIT}"
+
+##@ Polaris Benchmark
+
+.PHONY: benchmarks-pre-requisite
+benchmarks-pre-requisite:
+       @if [ ! -f "${APPLICATION_CONF_PATH}" ]; then \
+               echo "ERROR: ${APPLICATION_CONF_PATH} is missing"; \
+               exit 1; \
+       fi
+
+.PHONY: create-commits-simulation
+create-commits-simulation: benchmarks-pre-requisite ## Run create commits 
simulation
+       @echo "--- Running create commits simulation ---"
+       @./gradlew gatlingRun --simulation 
org.apache.polaris.benchmarks.simulations.CreateCommits \
+      -Dconfig.file=${APPLICATION_CONF_PATH}
+       @echo "--- Create commits simulation completed ---"
 
 .PHONY: create-dataset-simulation
-create-dataset-simulation:
-       ./gradlew gatlingRun --simulation 
org.apache.polaris.benchmarks.simulations.CreateTreeDataset \
-      -Dconfig.file=./application.conf
+create-dataset-simulation: benchmarks-pre-requisite ## Run create dataset 
simulation
+       @echo "--- Running create dataset simulation ---"
+       @./gradlew gatlingRun --simulation 
org.apache.polaris.benchmarks.simulations.CreateTreeDataset \
+      -Dconfig.file=${APPLICATION_CONF_PATH}
+       @echo "--- Create dataset simulation completed ---"
 
 .PHONY: read-simulation
-read-simulation:
-       ./gradlew gatlingRun --simulation 
org.apache.polaris.benchmarks.simulations.ReadTreeDataset \
-      -Dconfig.file=./application.conf
+read-simulation: benchmarks-pre-requisite ## Run read simulation
+       @echo "--- Running read simulation ---"
+       @./gradlew gatlingRun --simulation 
org.apache.polaris.benchmarks.simulations.ReadTreeDataset \
+      -Dconfig.file=${APPLICATION_CONF_PATH}
+       @echo "--- Read simulation completed ---"
 
 .PHONY: read-update-simulation
-read-update-simulation:
-       ./gradlew gatlingRun --simulation 
org.apache.polaris.benchmarks.simulations.ReadUpdateTreeDataset \
-      -Dconfig.file=./application.conf
-
-.PHONY: create-commits-simulation
-create-commits-simulation:
-       ./gradlew gatlingRun --simulation 
org.apache.polaris.benchmarks.simulations.CreateCommits \
-      -Dconfig.file=./application.conf
+read-update-simulation: benchmarks-pre-requisite ## Run read/update simulation
+       @echo "--- Running read/update simulation ---"
+       @./gradlew gatlingRun --simulation 
org.apache.polaris.benchmarks.simulations.ReadUpdateTreeDataset \
+      -Dconfig.file=${APPLICATION_CONF_PATH}
+       @echo "--- Read/Update simulation completed ---"
 
-.PHONY: weighted-workload-simulation
-weighted-workload-simulation:
-       ./gradlew gatlingRun --simulation 
org.apache.polaris.benchmarks.simulations.WeightedWorkloadOnTreeDataset \
-      -Dconfig.file=./application.conf
+.PHONY: reports-clean
+reports-clean: ## Clean benchmark reports
+       @echo "--- Cleaning benchmark reports ---"
+       @rm -rf build/reports/gatling/*/ 2>/dev/null || true
+       @echo "--- Clean benchmark reports completed ---"
 
 .PHONY: reports-list
-reports-list:
+reports-list: ## List benchmark reports
+       @echo "--- Listing benchmark reports ---"
        @for report in $$(ls -d build/reports/gatling/*/ 2>/dev/null | sort 
-r); do \
                basename="$$(basename $$report)"; \
                name="$$(echo $$basename | sed 's/-[0-9]\{17\}$$//')"; \
@@ -62,8 +100,11 @@ reports-list:
                        fi; \
                fi; \
        done
+       @echo "--- List benchmark reports completed ---"
 
-.PHONY: reports-clean
-reports-clean:
-       @rm -rf build/reports/gatling/*/ 2>/dev/null || true
-
+.PHONY: weighted-workload-simulation
+weighted-workload-simulation: benchmarks-pre-requisite ## Run weighted 
workload simulation
+       @echo "--- Running weighted workload simulation ---"
+       @./gradlew gatlingRun --simulation 
org.apache.polaris.benchmarks.simulations.WeightedWorkloadOnTreeDataset \
+      -Dconfig.file=${APPLICATION_CONF_PATH}
+       @echo "--- Weighted workload simulation completed ---"
diff --git a/console/Makefile b/console/Makefile
index 7373ad3..d307684 100644
--- a/console/Makefile
+++ b/console/Makefile
@@ -1,37 +1,91 @@
+#  Licensed to the Apache Software Foundation (ASF) under one
+#  or more contributor license agreements.  See the NOTICE file
+#  distributed with this work for additional information
+#  regarding copyright ownership.  The ASF licenses this file
+#  to you under the Apache License, Version 2.0 (the
+#  "License"); you may not use this file except in compliance
+#  with the License.  You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+#  Unless required by applicable law or agreed to in writing,
+#  software distributed under the License is distributed on an
+#  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+#  KIND, either express or implied.  See the License for the
+#  specific language governing permissions and limitations
+#  under the License.
 
+# Configures the shell for recipes to use bash, enabling bash commands and 
ensuring
+# that recipes exit on any command failure (including within pipes).
+SHELL = /usr/bin/env bash -o pipefail
+.SHELLFLAGS = -ec
+
+## Variables
 DOCKER ?= docker
 DOCKER_IMAGE_NAME ?= apache/polaris-console
 DOCKER_IMAGE_TAG ?= latest
 
-.PHONY: build-docker
-build-docker:
-       @$(DOCKER) build -f docker/Dockerfile -t 
$(DOCKER_IMAGE_NAME):$(DOCKER_IMAGE_TAG) .
+## Version information
+BUILD_VERSION := $(shell grep version package.json | sed 's/.*"version": 
"\(.*\)".*/\1/')
+GIT_COMMIT := $(shell git rev-parse HEAD)
 
+##@ General
 
-.PHONY: install
-install:
-       npm install
+.PHONY: help
+help: ## Display this help
+       @awk 'BEGIN {FS = ":.*##"; printf "\nUsage:\n  make 
\033[36m<target>\033[0m\n"} /^[a-zA-Z_0-9\.-]+:.*?##/ { printf "  
\033[36m%-40s\033[0m %s\n", $$1, $$2 } /^##@/ { printf "\n\033[1m%s\033[0m\n", 
substr($$0, 5) } ' $(MAKEFILE_LIST)
 
-.PHONY: lint
-lint: format-check
-       npm run lint
+.PHONY: version
+version: ## Display version information
+       @echo "Build version: ${BUILD_VERSION}"
+       @echo "Git commit: ${GIT_COMMIT}"
 
-.PHONY: format-fix
-format-fix:
-       npm run format
+##@ Polaris Console
+
+.PHONY: build
+build: lint ## Build console project
+       @echo "--- Building console project---"
+       @npm run build
+       @echo "--- Console project built ---"
 
-.PHONE: lint-fix
-lint-fix: format-fix
-       npm run lint -- --fix
+.PHONY: build-docker
+build-docker: install ## Build docker image for console project
+       @echo "--- Building docker image for console project---"
+       @$(DOCKER) build -f docker/Dockerfile -t 
$(DOCKER_IMAGE_NAME):$(DOCKER_IMAGE_TAG) .
+       @echo "--- Docker image for console project built ---"
+
+.PHONY: dev
+dev: install ## Run the console project in development mode
+       @echo "--- Running console project in development mode ---"
+       @npm run dev
+       @echo "--- Console project in development mode completed ---"
 
 .PHONY: format-check
-format-check:
-       npm run format:check
+format-check: install ## Check formatting in the console project
+       @echo "--- Checking formatting in the console project ---"
+       @npm run format:check
+       @echo "--- Formatting in the console project checked ---"
 
-.PHONY: build
-build: lint
-       npm run build
+.PHONY: format-fix
+format-fix: install ## Fix linting issues in the console project
+       @echo "--- Fixing formatting in the console project ---"
+       @npm run format
+       @echo "--- Formatting in the console project fixed ---"
 
-.PHONY: dev
-dev:
-       npm run dev
\ No newline at end of file
+.PHONY: install
+install: ## Install dependencies for console project
+       @echo "--- Install dependencies for console project ---"
+       @npm install
+       @echo "--- Dependencies for console project completed ---"
+
+.PHONY: lint
+lint: format-check ## Lint the console project
+       @echo "--- Linting the console project ---"
+       @npm run lint
+       @echo "--- Console project linted ---"
+
+.PHONY: lint-fix
+lint-fix: format-fix ## Fix linting issues in the console project
+       @echo "--- Fixing linting issues in the console project ---"
+       @npm run lint -- --fix
+       @echo "--- Linting issues in the console project fixed ---"

Reply via email to