chore: Show commit SHA instead of SNAPSHOT version (#30850)
Show the commit SHA in the version popup, instead of a snapshot version number like `v1.11-SNAPSHOT`. But if the version number doesn't have a `-SNAPSHOT` at the end, we show the version number as is. So if it's `v1.12`, we show that instead of the commit SHA. 
This commit is contained in:
parent
6d0b7af54e
commit
67c444e2a5
4
.github/workflows/github-release.yml
vendored
4
.github/workflows/github-release.yml
vendored
|
|
@ -81,12 +81,10 @@ jobs:
|
||||||
REACT_APP_ENVIRONMENT: "PRODUCTION"
|
REACT_APP_ENVIRONMENT: "PRODUCTION"
|
||||||
REACT_APP_FUSIONCHARTS_LICENSE_KEY: "${{ secrets.APPSMITH_FUSIONCHARTS_LICENSE_KEY }}"
|
REACT_APP_FUSIONCHARTS_LICENSE_KEY: "${{ secrets.APPSMITH_FUSIONCHARTS_LICENSE_KEY }}"
|
||||||
REACT_APP_SEGMENT_CE_KEY: "${{ secrets.APPSMITH_SEGMENT_CE_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_INTERCOM_APP_ID: "${{ secrets.APPSMITH_INTERCOM_ID }}"
|
||||||
REACT_APP_VERSION_EDITION: "Community"
|
REACT_APP_VERSION_EDITION: "Community"
|
||||||
run: |
|
run: |
|
||||||
REACT_APP_VERSION_RELEASE_DATE="$(date -u '+%Y-%m-%dT%H:%M:%SZ')" \
|
yarn build
|
||||||
yarn build
|
|
||||||
ls -l build
|
ls -l build
|
||||||
|
|
||||||
- name: Pack the client build directory
|
- name: Pack the client build directory
|
||||||
|
|
|
||||||
|
|
@ -107,6 +107,7 @@ module.exports = {
|
||||||
cloudHosting: "CLOUD_HOSTING",
|
cloudHosting: "CLOUD_HOSTING",
|
||||||
appVersion: {
|
appVersion: {
|
||||||
id: parseConfig("__APPSMITH_VERSION_ID__"),
|
id: parseConfig("__APPSMITH_VERSION_ID__"),
|
||||||
|
sha: parseConfig("__APPSMITH_VERSION_SHA__"),
|
||||||
releaseDate: parseConfig("__APPSMITH_VERSION_RELEASE_DATE__"),
|
releaseDate: parseConfig("__APPSMITH_VERSION_RELEASE_DATE__"),
|
||||||
},
|
},
|
||||||
intercomAppID: "APP_ID",
|
intercomAppID: "APP_ID",
|
||||||
|
|
|
||||||
|
|
@ -296,6 +296,7 @@
|
||||||
cloudHosting: CLOUD_HOSTING,
|
cloudHosting: CLOUD_HOSTING,
|
||||||
appVersion: {
|
appVersion: {
|
||||||
id: parseConfig("__APPSMITH_VERSION_ID__"),
|
id: parseConfig("__APPSMITH_VERSION_ID__"),
|
||||||
|
sha: parseConfig("__APPSMITH_VERSION_SHA__"),
|
||||||
releaseDate: parseConfig("__APPSMITH_VERSION_RELEASE_DATE__"),
|
releaseDate: parseConfig("__APPSMITH_VERSION_RELEASE_DATE__"),
|
||||||
},
|
},
|
||||||
intercomAppID: INTERCOM_APP_ID,
|
intercomAppID: INTERCOM_APP_ID,
|
||||||
|
|
|
||||||
|
|
@ -39,6 +39,7 @@ export interface INJECTED_CONFIGS {
|
||||||
logLevel: "debug" | "error";
|
logLevel: "debug" | "error";
|
||||||
appVersion: {
|
appVersion: {
|
||||||
id: string;
|
id: string;
|
||||||
|
sha: string;
|
||||||
releaseDate: string;
|
releaseDate: string;
|
||||||
edition: string;
|
edition: string;
|
||||||
};
|
};
|
||||||
|
|
@ -106,8 +107,9 @@ export const getConfigsFromEnvVars = (): INJECTED_CONFIGS => {
|
||||||
? process.env.REACT_APP_CLOUD_HOSTING.length > 0
|
? process.env.REACT_APP_CLOUD_HOSTING.length > 0
|
||||||
: false,
|
: false,
|
||||||
appVersion: {
|
appVersion: {
|
||||||
id: process.env.REACT_APP_VERSION_ID || "",
|
id: "",
|
||||||
releaseDate: process.env.REACT_APP_VERSION_RELEASE_DATE || "",
|
sha: "",
|
||||||
|
releaseDate: "",
|
||||||
edition: process.env.REACT_APP_VERSION_EDITION || "",
|
edition: process.env.REACT_APP_VERSION_EDITION || "",
|
||||||
},
|
},
|
||||||
intercomAppID: process.env.REACT_APP_INTERCOM_APP_ID || "",
|
intercomAppID: process.env.REACT_APP_INTERCOM_APP_ID || "",
|
||||||
|
|
@ -291,14 +293,9 @@ export const getAppsmithConfigs = (): AppsmithUIConfigs => {
|
||||||
logLevel:
|
logLevel:
|
||||||
ENV_CONFIG.logLevel || APPSMITH_FEATURE_CONFIGS?.logLevel || false,
|
ENV_CONFIG.logLevel || APPSMITH_FEATURE_CONFIGS?.logLevel || false,
|
||||||
appVersion: {
|
appVersion: {
|
||||||
id:
|
id: APPSMITH_FEATURE_CONFIGS?.appVersion?.id || "",
|
||||||
APPSMITH_FEATURE_CONFIGS?.appVersion?.id ||
|
sha: APPSMITH_FEATURE_CONFIGS?.appVersion?.sha || "",
|
||||||
ENV_CONFIG.appVersion?.id ||
|
releaseDate: APPSMITH_FEATURE_CONFIGS?.appVersion?.releaseDate || "",
|
||||||
"",
|
|
||||||
releaseDate:
|
|
||||||
APPSMITH_FEATURE_CONFIGS?.appVersion?.releaseDate ||
|
|
||||||
ENV_CONFIG.appVersion?.releaseDate ||
|
|
||||||
"",
|
|
||||||
edition:
|
edition:
|
||||||
ENV_CONFIG.appVersion?.edition ||
|
ENV_CONFIG.appVersion?.edition ||
|
||||||
APPSMITH_FEATURE_CONFIGS?.appVersion?.edition ||
|
APPSMITH_FEATURE_CONFIGS?.appVersion?.edition ||
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,7 @@ import type { LogLevelDesc } from "loglevel";
|
||||||
|
|
||||||
export interface AppVersionData {
|
export interface AppVersionData {
|
||||||
id: string;
|
id: string;
|
||||||
|
sha: string;
|
||||||
releaseDate: string;
|
releaseDate: string;
|
||||||
edition: string;
|
edition: string;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -164,7 +164,9 @@ const HomepageHeaderAction = ({
|
||||||
{createMessage(
|
{createMessage(
|
||||||
APPSMITH_DISPLAY_VERSION,
|
APPSMITH_DISPLAY_VERSION,
|
||||||
appVersion.edition,
|
appVersion.edition,
|
||||||
appVersion.id,
|
appVersion.id.endsWith("-SNAPSHOT")
|
||||||
|
? appVersion.sha.substring(0, 8)
|
||||||
|
: appVersion.id,
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
{howMuchTimeBefore !== "" && (
|
{howMuchTimeBefore !== "" && (
|
||||||
|
|
|
||||||
|
|
@ -165,6 +165,7 @@ function finalizeIndexHtml() {
|
||||||
const info = JSON.parse(fs.readFileSync("/opt/appsmith/info.json", "utf8"))
|
const info = JSON.parse(fs.readFileSync("/opt/appsmith/info.json", "utf8"))
|
||||||
const extraEnv = {
|
const extraEnv = {
|
||||||
APPSMITH_VERSION_ID: info.version ?? "",
|
APPSMITH_VERSION_ID: info.version ?? "",
|
||||||
|
APPSMITH_VERSION_SHA: info.commitSha ?? "",
|
||||||
APPSMITH_VERSION_RELEASE_DATE: info.imageBuiltAt ?? "",
|
APPSMITH_VERSION_RELEASE_DATE: info.imageBuiltAt ?? "",
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user