Skip to content

Commit

Permalink
Show stackVersion
Browse files Browse the repository at this point in the history
  • Loading branch information
fiskus committed Oct 18, 2024
1 parent fd98908 commit dca0602
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/deploy-catalog.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
push:
branches:
- master
- selective-package-download
- stack-version
paths:
- '.github/workflows/deploy-catalog.yaml'
- 'catalog/**'
Expand Down
4 changes: 2 additions & 2 deletions catalog/app/components/Footer/Footer.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand All @@ -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}
</M.Typography>
</div>
)
Expand Down
3 changes: 3 additions & 0 deletions catalog/app/utils/Config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 })
Expand Down Expand Up @@ -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) {
Expand Down
4 changes: 1 addition & 3 deletions catalog/app/utils/Sentry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion catalog/app/utils/tracking.js
Original file line number Diff line number Diff line change
Expand Up @@ -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],
)
Expand Down
4 changes: 0 additions & 4 deletions catalog/internals/webpack/webpack.base.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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({
Expand Down

0 comments on commit dca0602

Please sign in to comment.