Skip to content

Commit

Permalink
feat(RHINENG-15391): Onboard vuln4shift to Sentry Instance (#377)
Browse files Browse the repository at this point in the history
  • Loading branch information
adonispuente authored Jan 31, 2025
1 parent 2e7951e commit 4b77880
Show file tree
Hide file tree
Showing 5 changed files with 744 additions and 378 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/sentry.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: sentryInit

on:
push:
branches:
- master
workflow_dispatch:
inputs:
commit_hash:
description: 'The commit hash (or branch/tag) to build'
required: false
default: ''

jobs:
createSentryRelease:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
ref: ${{ github.event.inputs.commit_hash || 'refs/heads/master' }}

- name: Install dependencies
run: npm ci

- name: Build
env:
ENABLE_SENTRY: ${{ secrets.ENABLE_SENTRY }}
SENTRY_RELEASE: ${{ github.event.inputs.commit_hash && github.event.inputs.commit_hash }}
SENTRY_AUTH_TOKEN: ${{ github.event.inputs.commit_hash && secrets.SENTRY_AUTH_TOKEN }}
SENTRY_ORG: ${{ secrets.SENTRY_ORG }}
SENTRY_PROJECT: ${{ secrets.SENTRY_PROJECT }}
run: npm run build --if-present
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,6 @@ cypress/screenshots
cypress/videos

# cache
.cache/
.cache/
# Sentry Config File
.env.sentry-build-plugin
24 changes: 23 additions & 1 deletion fec.config.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,33 @@
const { sentryWebpackPlugin } = require('@sentry/webpack-plugin');

module.exports = {
appUrl: '/openshift/insights/vulnerability',
debug: true,
useProxy: process.env.PROXY === 'true',
proxyVerbose: true,
sassPrefix: '.ocp-vulnerability, .ocpVulnerability',
interceptChromeConfig: false,
plugins: [],
devtool: 'hidden-source-map',
plugins: [
// Put the Sentry Webpack plugin after all other plugins
...(process.env.ENABLE_SENTRY
? [
sentryWebpackPlugin({
...(process.env.SENTRY_AUTH_TOKEN && {
authToken: process.env.SENTRY_AUTH_TOKEN,
}),
org: 'red-hat-it',
project: 'ocp-vulnerability',
moduleMetadata: ({ release }) => ({
dsn: `https://e88ee1ea3dcfd65015894853d75edf1c@o490301.ingest.us.sentry.io/4508683273830400`,
org: 'red-hat-it',
project: 'ocp-vulnerability',
release,
}),
}),
]
: []),
],
hotReload: process.env.HOT === 'true',
moduleFederation: {
exclude: ['react-router-dom'],
Expand Down
Loading

0 comments on commit 4b77880

Please sign in to comment.