From db5745d458a10b6e0b25fa1c665816feb1c46af6 Mon Sep 17 00:00:00 2001 From: Z8MB1E Date: Sun, 6 Sep 2026 17:22:58 -0400 Subject: [PATCH] fix(version): compose version+commit label when git describe is unavailable Coolify builds have no git metadata, so fall back to + in both the version overlay and version-info generator instead of showing a bare version. Ultraworked with [Sisyphus](https://github.com/code-yeongju/oh-my-openagent) Co-authored-by: Sisyphus --- src/components/static/VersionOverlay.tsx | 8 +++++++- src/scripts/generateVersionInfo.ts | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/components/static/VersionOverlay.tsx b/src/components/static/VersionOverlay.tsx index 5f8fd26..bea01a8 100644 --- a/src/components/static/VersionOverlay.tsx +++ b/src/components/static/VersionOverlay.tsx @@ -16,7 +16,13 @@ const EMPTY: VersionInfo = { }; function resolveVersionLabel(info: VersionInfo): string { - return info.gitDescribe ?? info.tag ?? info.version ?? "unknown version"; + // Coolify strips .git from the build context, so only commitHash (via the + // SOURCE_COMMIT build arg) resolves there — compose it into the label so + // every deploy shows a distinct version without a manual semver bump. + if (info.gitDescribe) return info.gitDescribe; + if (info.tag) return info.tag; + if (info.version && info.commitHash) return `${info.version}+${info.commitHash}`; + return info.version ?? "unknown version"; } function formatCommitDate(iso: string | null): string | null { diff --git a/src/scripts/generateVersionInfo.ts b/src/scripts/generateVersionInfo.ts index 7472e5e..d7dd99b 100644 --- a/src/scripts/generateVersionInfo.ts +++ b/src/scripts/generateVersionInfo.ts @@ -87,7 +87,7 @@ function main(): void { "utf8", ); - const label = gitDescribe ?? tag ?? version ?? "unknown"; + const label = gitDescribe ?? tag ?? (version && commitHash ? `${version}+${commitHash}` : null) ?? version ?? "unknown"; console.log(`[version-info] wrote src/generated/versionInfo.json (${label})`); }