Skip to content

Commit

Permalink
feat(RHINENG-1539): Onboard Vulnerability to Sentry Instance (#2198)
Browse files Browse the repository at this point in the history
  • Loading branch information
adonispuente authored Jan 30, 2025
1 parent d5a63bc commit a504faa
Show file tree
Hide file tree
Showing 5 changed files with 606 additions and 369 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 @@ -33,4 +33,6 @@ instrumented/
build

#cache
.cache/
.cache/
# Sentry Config File
.env.sentry-build-plugin
23 changes: 22 additions & 1 deletion fec.config.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,34 @@
/* eslint-disable no-undef */
const { resolve } = require('path');
const { sentryWebpackPlugin } = require("@sentry/webpack-plugin");

module.exports = {
appUrl: '/insights/vulnerability',
debug: true,
useProxy: process.env.PROXY === 'true',
proxyVerbose: true,
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: 'vulnerability-rhel',
moduleMetadata: ({ release }) => ({
dsn: `https://[email protected]/4508683271077888`,
org: 'red-hat-it',
project: 'vulnerability-rhel',
release,
}),
}),
]
: []),
],
...(process.env.HOT ? { hotReload: process.env.HOT === 'true' } : { hotReload: true }),
...(process.env.port ? { port: parseInt(process.env.port) } : {}),
moduleFederation: {
Expand Down
Loading

0 comments on commit a504faa

Please sign in to comment.