diff --git a/.github/workflows/deploy-catalog.yaml b/.github/workflows/deploy-catalog.yaml index 94e31bfda51..7df1108363c 100644 --- a/.github/workflows/deploy-catalog.yaml +++ b/.github/workflows/deploy-catalog.yaml @@ -4,7 +4,7 @@ on: push: branches: - master - - selective-package-download + - stack-version paths: - '.github/workflows/deploy-catalog.yaml' - 'catalog/**' diff --git a/catalog/app/components/Footer/Footer.js b/catalog/app/components/Footer/Footer.js index 28850786fa1..bcabe2c2a8b 100644 --- a/catalog/app/components/Footer/Footer.js +++ b/catalog/app/components/Footer/Footer.js @@ -36,7 +36,7 @@ function Version() { const classes = useVersionStyles() const { push } = Notifications.use() const handleCopy = React.useCallback(() => { - copyToClipboard(process.env.REVISION_HASH) + copyToClipboard(cfg.stackVersion) push('Web catalog container hash has been copied to clipboard') }, [push]) return ( @@ -47,7 +47,7 @@ function Version() { title="Copy product revision hash to clipboard" variant="caption" > - Revision: {process.env.REVISION_HASH.substring(0, 8)} + Version: {cfg.stackVersion} ) diff --git a/catalog/app/utils/Config.ts b/catalog/app/utils/Config.ts index 977015fe6a7..3aa15e47940 100644 --- a/catalog/app/utils/Config.ts +++ b/catalog/app/utils/Config.ts @@ -47,6 +47,8 @@ export interface ConfigJson { qurator?: boolean build_version?: string // not sure where this comes from + + stackVersion?: string } const ajv = new Ajv({ allErrors: true, removeAdditional: true }) @@ -92,6 +94,7 @@ const transformConfig = (cfg: ConfigJson) => ({ desktop: !!cfg.desktop, chunkedChecksums: !!cfg.chunkedChecksums, qurator: !!cfg.qurator, + stackVersion: cfg.stackVersion, }) export function prepareConfig(input: unknown) { diff --git a/catalog/app/utils/Sentry.ts b/catalog/app/utils/Sentry.ts index 210b9659412..02b99626958 100644 --- a/catalog/app/utils/Sentry.ts +++ b/catalog/app/utils/Sentry.ts @@ -6,14 +6,12 @@ import * as Sentry from '@sentry/react' import * as AuthSelectors from 'containers/Auth/selectors' import type { Config } from 'utils/Config' -const RELEASE = `catalog@${process.env.REVISION_HASH}` - export function init(cfg: Config, history?: History) { if (!cfg.sentryDSN) return false Sentry.init({ dsn: cfg.sentryDSN, - release: RELEASE, + release: cfg.stackVersion, environment: process.env.NODE_ENV === 'development' ? 'dev' : 'prod', integrations: [ history diff --git a/catalog/app/utils/tracking.js b/catalog/app/utils/tracking.js index a99b0c70ec8..10b3da94020 100644 --- a/catalog/app/utils/tracking.js +++ b/catalog/app/utils/tracking.js @@ -76,7 +76,7 @@ export function TrackingProvider({ userSelector, children }) { origin: window.location.origin, location, user, - catalog_release: process.env.REVISION_HASH, + catalog_release: cfg.stackVersion, }), [location, user], ) diff --git a/catalog/internals/webpack/webpack.base.js b/catalog/internals/webpack/webpack.base.js index e20cb0ede1f..4bf9c41743a 100644 --- a/catalog/internals/webpack/webpack.base.js +++ b/catalog/internals/webpack/webpack.base.js @@ -9,9 +9,6 @@ const CopyWebpackPlugin = require('copy-webpack-plugin') const ForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin') const HtmlWebpackPlugin = require('html-webpack-plugin') const webpack = require('webpack') -const { execSync } = require('child_process') - -const revisionHash = execSync('git rev-parse HEAD').toString() class RevertPathOverwriteByPerspective { apply(compiler) { @@ -144,7 +141,6 @@ module.exports = (options) => ({ // NODE_ENV is exposed automatically based on the "mode" option new webpack.EnvironmentPlugin({ LOGGER_REDUX: process.env.LOGGER_REDUX || 'enabled', - REVISION_HASH: revisionHash, }), new webpack.ProvidePlugin({