From 7c4843987b1762dbca7ada192226ebbfed4fa108 Mon Sep 17 00:00:00 2001 From: busya Date: Tue, 7 Jul 2026 12:29:46 +0300 Subject: [PATCH] fix(frontend): dynamic year + git commit hash in APP_VERSION - Footer.svelte: replace hardcoded '2025' with new Date().getFullYear() - build.sh: append git short hash to APP_VERSION for all bundle commands (bundle, bundle:embeddings, bundle:light). Format: '0.5.2+58d06fb2'. Previously only the tag was passed (e.g. '0.5.2'), and .git was not available in Docker context so vite.config.js fell back to '0.0.0'. Verified: frontend assets contain '0.5.2+58d06fb2', getFullYear() replaces hardcoded 2025. --- build.sh | 21 ++++++++++++++++--- .../src/lib/components/layout/Footer.svelte | 2 +- 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/build.sh b/build.sh index d5fc202c..50912dd0 100755 --- a/build.sh +++ b/build.sh @@ -217,13 +217,18 @@ bundle_release() { local frontend_tag="superset-tools-frontend:${tag}" local agent_tag="superset-tools-agent:${tag}" + # Git commit hash for APP_VERSION (e.g. "0.5.2+58d06fb2") + local git_commit + git_commit="$(git rev-parse --short HEAD 2>/dev/null || echo 'unknown')" + local app_version="${tag}+${git_commit}" + mkdir -p "$DIST_ROOT" echo "[bundle] Building backend image ${backend_tag}..." docker build -f docker/backend.Dockerfile -t "${backend_tag}" . echo "[bundle] Building frontend image ${frontend_tag}..." - docker build --build-arg "APP_VERSION=${tag}" -f docker/frontend.Dockerfile -t "${frontend_tag}" . + docker build --build-arg "APP_VERSION=${app_version}" -f docker/frontend.Dockerfile -t "${frontend_tag}" . echo "[bundle] Building agent image ${agent_tag}..." docker build -f docker/Dockerfile.agent -t "${agent_tag}" . @@ -403,10 +408,15 @@ bundle_light() { local tag="$1" local image_tag="superset-tools:${tag}" + # Git commit hash for APP_VERSION (e.g. "0.5.2+58d06fb2") + local git_commit + git_commit="$(git rev-parse --short HEAD 2>/dev/null || echo 'unknown')" + local app_version="${tag}+${git_commit}" + mkdir -p "$DIST_ROOT" echo "[bundle:light] Building all-in-one image ${image_tag}..." - docker build -f docker/all-in-one.Dockerfile -t "${image_tag}" . + docker build --build-arg "APP_VERSION=${app_version}" -f docker/all-in-one.Dockerfile -t "${image_tag}" . echo "[bundle:light] Exporting .tar.xz..." docker save "${image_tag}" | xz -T0 -3 > "${DIST_ROOT}/superset-tools.${tag}.tar.xz" @@ -518,13 +528,18 @@ bundle_embeddings() { local frontend_tag="superset-tools-frontend:${tag}-embeddings" local agent_tag="superset-tools-agent:${tag}-embeddings" + # Git commit hash for APP_VERSION (e.g. "0.5.2+58d06fb2") + local git_commit + git_commit="$(git rev-parse --short HEAD 2>/dev/null || echo 'unknown')" + local app_version="${tag}+${git_commit}" + mkdir -p "$DIST_ROOT" echo "[bundle:embeddings] Building backend image ${backend_tag}..." docker build -f docker/backend.Dockerfile -t "${backend_tag}" . echo "[bundle:embeddings] Building frontend image ${frontend_tag}..." - docker build --build-arg "APP_VERSION=${tag}" -f docker/frontend.Dockerfile -t "${frontend_tag}" . + docker build --build-arg "APP_VERSION=${app_version}" -f docker/frontend.Dockerfile -t "${frontend_tag}" . echo "[bundle:embeddings] Building agent image ${agent_tag} (WITH_EMBEDDINGS=true)..." docker build \ diff --git a/frontend/src/lib/components/layout/Footer.svelte b/frontend/src/lib/components/layout/Footer.svelte index 92a57e68..f25615e8 100644 --- a/frontend/src/lib/components/layout/Footer.svelte +++ b/frontend/src/lib/components/layout/Footer.svelte @@ -9,6 +9,6 @@