Skip to content

Commit

Permalink
Test sentry on CI
Browse files Browse the repository at this point in the history
  • Loading branch information
walidkayhan committed Dec 8, 2023
1 parent 4bcf52d commit 27d0890
Show file tree
Hide file tree
Showing 8 changed files with 42 additions and 43 deletions.
7 changes: 6 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,9 @@ gsender_server_log.txt

# Sentry Auth Token
.env.sentry-build-plugin
cypress.env.json
cypress.env.json
# Sentry Config File
.env.sentry-build-plugin

# Sentry Config File
.env.sentry-build-plugin
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@
"@mui/material": "^5.9.2",
"@octokit/core": "^3.6.0",
"@react-pdf/renderer": "3.0.0",
"@sentry/electron": "^4.11.0",
"@sentry/electron": "^4.14.0",
"@sentry/react": "^7.72.0",
"@serialport/parser-readline": "^11.0.0",
"@sienci/avrgirl-arduino": "^5.0.3",
Expand Down
18 changes: 8 additions & 10 deletions src/app/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ import LanguageDetector from 'i18next-browser-languagedetector';
import XHR from 'i18next-xhr-backend';
import { TRACE, DEBUG, INFO, WARN, ERROR } from 'universal-logger';
import { Provider as ReduxProvider } from 'react-redux';
//import * as Sentry from '@sentry/react';
import * as Sentry from '@sentry/react';

import { Provider as GridSystemProvider } from 'app/components/GridSystem';
import rootSaga from 'app/sagas';
Expand All @@ -65,15 +65,13 @@ import PopUpWidget from './containers/PopUpWidget';
import './styles/vendor.styl';
import './styles/app.styl';

// import * as Sentry from '@sentry/react';

// Sentry.init({
// dsn: 'https://c09ff263997c4a47ba22b3c948f19734@o558751.ingest.sentry.io/5692684',
// integrations: [
// new Sentry.BrowserTracing(),
// new Sentry.Replay()
// ],
// });
Sentry.init({
dsn: 'https://c09ff263997c4a47ba22b3c948f19734@o558751.ingest.sentry.io/5692684',
integrations: [
new Sentry.BrowserTracing(),
new Sentry.Replay()
],
});

const renderPage = () => {
const container = document.createElement('div');
Expand Down
10 changes: 5 additions & 5 deletions src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import isOnline from 'is-online';
import log from 'electron-log';
import path from 'path';
import fs from 'fs';
// import * as Sentry from '@sentry/electron/main';
import * as Sentry from '@sentry/electron/main';

import WindowManager from './electron-app/WindowManager';
import launchServer from './server-cli';
Expand All @@ -44,7 +44,7 @@ let hostInformation = {};
let grblLog = log.create('grbl');
let logPath;

// Sentry.init({ dsn: 'https://c09ff263997c4a47ba22b3c948f19734@o558751.ingest.sentry.io/5692684' });
Sentry.init({ dsn: 'https://c09ff263997c4a47ba22b3c948f19734@o558751.ingest.sentry.io/5692684' });

const main = () => {
// https://github.com/electron/electron/blob/master/docs/api/app.md#apprequestsingleinstancelock
Expand Down Expand Up @@ -134,7 +134,7 @@ const main = () => {
}
}

const { address, port, requestedHost, kiosk } = { ...res };
const { address, port, kiosk } = { ...res };
log.info(`Returned - http://${address}:${port}`);
hostInformation = {
address,
Expand Down Expand Up @@ -201,12 +201,12 @@ const main = () => {
if ('type' in error) {
log.transports.file.level = 'error';
}
if(error.type.includes('GRBL_HAL')) {

if (error.type.includes('GRBL_HAL')) {
(error.type === 'GRBL_HAL_ERROR') ? grblLog.error(`GRBL_HAL_ERROR:Error ${error.code} - ${error.description} Line ${error.lineNumber}: "${error.line.trim()}" Origin- ${error.origin.trim()}`) : grblLog.error(`GRBL_HAL_ALARM:Alarm ${error.code} - ${error.description}`);
} else {
(error.type === 'GRBL_ERROR') ? grblLog.error(`GRBL_ERROR:Error ${error.code} - ${error.description} Line ${error.lineNumber}: "${error.line.trim()}" Origin- ${error.origin.trim()}`) : grblLog.error(`GRBL_ALARM:Alarm ${error.code} - ${error.description}`);
}

});

ipcMain.on('clipboard', (channel, text) => {
Expand Down
2 changes: 1 addition & 1 deletion src/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
},
"main": "main.js",
"dependencies": {
"@sentry/electron": "^4.11.0",
"@sentry/electron": "^4.14.0",
"@sentry/react": "^7.72.0",
"@serialport/parser-readline": "^11.0.0",
"@sienci/avrgirl-arduino": "^5.0.3",
Expand Down
6 changes: 0 additions & 6 deletions src/server/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ import size from 'lodash/size';
import trimEnd from 'lodash/trimEnd';
import uniqWith from 'lodash/uniqWith';
import webappengine from 'webappengine';
// import * as Sentry from '@sentry/node';

import settings from './config/settings';
import app from './app';
Expand All @@ -52,11 +51,6 @@ import urljoin from './lib/urljoin';

const log = logger('init');

// Sentry.init({
// dsn: 'https://c09ff263997c4a47ba22b3c948f19734@o558751.ingest.sentry.io/5692684',
// tracesSampleRate: 0.3,
// });

const createServer = (options, callback) => {
options = { ...options };

Expand Down
23 changes: 12 additions & 11 deletions webpack.config.app.production.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const stylusLoader = require('stylus-loader');
const TerserPlugin = require('terser-webpack-plugin');
const webpack = require('webpack');
const ManifestPlugin = require('webpack-manifest-plugin');
// const { sentryWebpackPlugin } = require('@sentry/webpack-plugin');
const { sentryWebpackPlugin } = require('@sentry/webpack-plugin');

const babelConfig = require('./babel.config');
const buildConfig = require('./build.config');
Expand Down Expand Up @@ -42,7 +42,8 @@ module.exports = {
cache: true,
target: 'web',
context: path.resolve(__dirname, 'src/app'),
devtool: 'cheap-module-source-map',
devtool: 'source-map',
// devtool: 'cheap-module-source-map',
entry: {
polyfill: [
path.resolve(__dirname, 'src/app/polyfill/index.js')
Expand All @@ -58,8 +59,8 @@ module.exports = {
},
output: {
path: path.resolve(__dirname, 'dist/gsender/app'),
chunkFilename: `[name].[chunkhash].bundle.js?_=${timestamp}`,
filename: `[name].[chunkhash].bundle.js?_=${timestamp}`,
chunkFilename: '[name].[chunkhash].bundle.js',
filename: '[name].[chunkhash].bundle.js',
publicPath: publicPath
},
module: {
Expand Down Expand Up @@ -243,14 +244,14 @@ module.exports = {
meta: {
'viewport': 'width=device-width, initial-scale=1, maximum-scale=1',
}
}),
sentryWebpackPlugin({
org: process.env.SENTRY_ORG,
project: process.env.SENTRY_PROJECT,
authToken: process.env.SENTRY_AUTH_TOKEN,
urlPrefix: publicPath,
telemetry: false
})],
// sentryWebpackPlugin({
// org: process.env.SENTRY_ORG,
// project: process.env.SENTRY_PROJECT,
// authToken: process.env.SENTRY_AUTH_TOKEN,
// urlPrefix: publicPath,
// telemetry: false
// })],
resolve: {
modules: [
path.resolve(__dirname, 'src'),
Expand Down
17 changes: 9 additions & 8 deletions webpack.config.server.production.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const TerserPlugin = require('terser-webpack-plugin');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const webpack = require('webpack');
const nodeExternals = require('webpack-node-externals');
// const { sentryWebpackPlugin } = require('@sentry/webpack-plugin');
const { sentryWebpackPlugin } = require('@sentry/webpack-plugin');

const babelConfig = require('./babel.config');
const pkg = require('./package.json');
Expand All @@ -30,7 +30,8 @@ const buildVersion = pkg.version;

module.exports = {
mode: 'production',
devtool: 'cheap-module-source-map',
devtool: 'source-map',
// devtool: 'cheap-module-source-map',
target: 'node', // ignore built-in modules like path, fs, etc.
context: path.resolve(__dirname, 'src/server'),
entry: {
Expand Down Expand Up @@ -62,12 +63,12 @@ module.exports = {
template: path.resolve(__dirname, 'index.html'),
chunksSortMode: 'dependency' // Sort chunks by dependency
}),
// sentryWebpackPlugin({
// org: process.env.SENTRY_ORG,
// project: process.env.SENTRY_PROJECT,
// authToken: process.env.SENTRY_AUTH_TOKEN,
// telemetry: false
// }),
sentryWebpackPlugin({
org: process.env.SENTRY_ORG,
project: process.env.SENTRY_PROJECT,
authToken: process.env.SENTRY_AUTH_TOKEN,
telemetry: false
}),
],
module: {
rules: [
Expand Down

0 comments on commit 27d0890

Please sign in to comment.