-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(RHINENG-1539): Onboard Vulnerability to Sentry Instance (#2198)
- Loading branch information
1 parent
d5a63bc
commit a504faa
Showing
5 changed files
with
606 additions
and
369 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,4 +33,6 @@ instrumented/ | |
build | ||
|
||
#cache | ||
.cache/ | ||
.cache/ | ||
# Sentry Config File | ||
.env.sentry-build-plugin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: { | ||
|
Oops, something went wrong.