diff --git a/.github/workflows/github-release.yml b/.github/workflows/github-release.yml index 2d236ab989..59498471d0 100644 --- a/.github/workflows/github-release.yml +++ b/.github/workflows/github-release.yml @@ -81,12 +81,10 @@ jobs: REACT_APP_ENVIRONMENT: "PRODUCTION" REACT_APP_FUSIONCHARTS_LICENSE_KEY: "${{ secrets.APPSMITH_FUSIONCHARTS_LICENSE_KEY }}" REACT_APP_SEGMENT_CE_KEY: "${{ secrets.APPSMITH_SEGMENT_CE_KEY }}" - REACT_APP_VERSION_ID: "${{ needs.prelude.outputs.tag }}" REACT_APP_INTERCOM_APP_ID: "${{ secrets.APPSMITH_INTERCOM_ID }}" REACT_APP_VERSION_EDITION: "Community" run: | - REACT_APP_VERSION_RELEASE_DATE="$(date -u '+%Y-%m-%dT%H:%M:%SZ')" \ - yarn build + yarn build ls -l build - name: Pack the client build directory diff --git a/app/client/jest.config.js b/app/client/jest.config.js index f054db071c..5775b5a563 100644 --- a/app/client/jest.config.js +++ b/app/client/jest.config.js @@ -107,6 +107,7 @@ module.exports = { cloudHosting: "CLOUD_HOSTING", appVersion: { id: parseConfig("__APPSMITH_VERSION_ID__"), + sha: parseConfig("__APPSMITH_VERSION_SHA__"), releaseDate: parseConfig("__APPSMITH_VERSION_RELEASE_DATE__"), }, intercomAppID: "APP_ID", diff --git a/app/client/public/index.html b/app/client/public/index.html index 16cfafaaf0..f20d72008a 100755 --- a/app/client/public/index.html +++ b/app/client/public/index.html @@ -296,6 +296,7 @@ cloudHosting: CLOUD_HOSTING, appVersion: { id: parseConfig("__APPSMITH_VERSION_ID__"), + sha: parseConfig("__APPSMITH_VERSION_SHA__"), releaseDate: parseConfig("__APPSMITH_VERSION_RELEASE_DATE__"), }, intercomAppID: INTERCOM_APP_ID, diff --git a/app/client/src/ce/configs/index.ts b/app/client/src/ce/configs/index.ts index 1f918e9040..5934c118ae 100644 --- a/app/client/src/ce/configs/index.ts +++ b/app/client/src/ce/configs/index.ts @@ -39,6 +39,7 @@ export interface INJECTED_CONFIGS { logLevel: "debug" | "error"; appVersion: { id: string; + sha: string; releaseDate: string; edition: string; }; @@ -106,8 +107,9 @@ export const getConfigsFromEnvVars = (): INJECTED_CONFIGS => { ? process.env.REACT_APP_CLOUD_HOSTING.length > 0 : false, appVersion: { - id: process.env.REACT_APP_VERSION_ID || "", - releaseDate: process.env.REACT_APP_VERSION_RELEASE_DATE || "", + id: "", + sha: "", + releaseDate: "", edition: process.env.REACT_APP_VERSION_EDITION || "", }, intercomAppID: process.env.REACT_APP_INTERCOM_APP_ID || "", @@ -291,14 +293,9 @@ export const getAppsmithConfigs = (): AppsmithUIConfigs => { logLevel: ENV_CONFIG.logLevel || APPSMITH_FEATURE_CONFIGS?.logLevel || false, appVersion: { - id: - APPSMITH_FEATURE_CONFIGS?.appVersion?.id || - ENV_CONFIG.appVersion?.id || - "", - releaseDate: - APPSMITH_FEATURE_CONFIGS?.appVersion?.releaseDate || - ENV_CONFIG.appVersion?.releaseDate || - "", + id: APPSMITH_FEATURE_CONFIGS?.appVersion?.id || "", + sha: APPSMITH_FEATURE_CONFIGS?.appVersion?.sha || "", + releaseDate: APPSMITH_FEATURE_CONFIGS?.appVersion?.releaseDate || "", edition: ENV_CONFIG.appVersion?.edition || APPSMITH_FEATURE_CONFIGS?.appVersion?.edition || diff --git a/app/client/src/ce/configs/types.ts b/app/client/src/ce/configs/types.ts index 55feb0ef30..b69ae38507 100644 --- a/app/client/src/ce/configs/types.ts +++ b/app/client/src/ce/configs/types.ts @@ -2,6 +2,7 @@ import type { LogLevelDesc } from "loglevel"; export interface AppVersionData { id: string; + sha: string; releaseDate: string; edition: string; } diff --git a/app/client/src/pages/common/SearchBar/HomepageHeaderAction.tsx b/app/client/src/pages/common/SearchBar/HomepageHeaderAction.tsx index fe57e67fbd..aa7bfe48e8 100644 --- a/app/client/src/pages/common/SearchBar/HomepageHeaderAction.tsx +++ b/app/client/src/pages/common/SearchBar/HomepageHeaderAction.tsx @@ -164,7 +164,9 @@ const HomepageHeaderAction = ({ {createMessage( APPSMITH_DISPLAY_VERSION, appVersion.edition, - appVersion.id, + appVersion.id.endsWith("-SNAPSHOT") + ? appVersion.sha.substring(0, 8) + : appVersion.id, )} {howMuchTimeBefore !== "" && ( diff --git a/deploy/docker/fs/opt/appsmith/caddy-reconfigure.mjs b/deploy/docker/fs/opt/appsmith/caddy-reconfigure.mjs index 4fd714fbe6..3c9f500364 100644 --- a/deploy/docker/fs/opt/appsmith/caddy-reconfigure.mjs +++ b/deploy/docker/fs/opt/appsmith/caddy-reconfigure.mjs @@ -165,6 +165,7 @@ function finalizeIndexHtml() { const info = JSON.parse(fs.readFileSync("/opt/appsmith/info.json", "utf8")) const extraEnv = { APPSMITH_VERSION_ID: info.version ?? "", + APPSMITH_VERSION_SHA: info.commitSha ?? "", APPSMITH_VERSION_RELEASE_DATE: info.imageBuiltAt ?? "", }