Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fabo/1911 add sentry version #1971

Merged
merged 10 commits into from
Feb 14, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,16 @@ jobs:
- sync:
dist_path: *DIST

# Release code and sourcemaps to Sentry
sentry:
executor: web
steps:
- checkout
- yarn-install
- run: |
mkdir -p app/dist
CIRCLECI=true RELEASE=true yarn build:ui

# Create release.
release:
docker:
Expand Down Expand Up @@ -304,6 +314,14 @@ workflows:
only:
- develop
- master
- sentry:
requires:
- testUnit
filters:
branches:
only:
- develop
- master

# - testE2e:
# requires:
Expand Down
3 changes: 3 additions & 0 deletions .sentryclirc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[defaults]
org = tendermint
project = voyager
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- [\#1928](https://github.com/cosmos/voyager/issues/1928) Added Browserstack reference to README @sabau
- [\#1918](https://github.com/cosmos/voyager/issues/1918) added message to log in when sending transactions and the user is not authenticated @fedekunze
- [\#1866](https://github.com/cosmos/voyager/issues/1866) Added blocks to network page and a page for viewing individual blocks @jbibla
- [\#1911](https://github.com/cosmos/voyager/issues/1911) Upload code to Sentry for remote error analyzer @faboweb
- Added development mode warning @faboweb

### Changed
Expand Down
3 changes: 2 additions & 1 deletion app/src/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,6 @@ export default {
node_halted_timeout: 120000,
block_timeout: 10000,
default_gas: 500000,
faucet
faucet,
version: process.env.RELEASE
}
4 changes: 2 additions & 2 deletions app/src/renderer/vuex/modules/user.js
Original file line number Diff line number Diff line change
Expand Up @@ -173,8 +173,8 @@ export default ({}) => {

if (state.errorCollection) {
state.externals.Sentry.init({
dsn: config.sentry_dsn,
release: `voyager@${state.externals.config.version}`
dsn: state.externals.config.sentry_dsn,
release: state.externals.config.version
})
state.externals.enableGoogleAnalytics(
state.externals.config.google_analytics_uid
Expand Down
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
"devDependencies": {
"@nodeguy/cli": "0.2.2",
"@octokit/rest": "15.9.4",
"@sentry/webpack-plugin": "1.6.2",
"babel-core": "6.26.3",
"babel-eslint": "7.2.3",
"babel-jest": "21.2.0",
Expand Down Expand Up @@ -99,9 +100,9 @@
"vue-template-compiler": "2.5.21",
"vue-template-es2015-compiler": "1.8.1",
"webpack": "4.28.3",
"webpack-bundle-analyzer": "3.0.3",
"webpack-cli": "3.2.0",
"webpack-dev-server": "3.1.14",
"webpack-bundle-analyzer": "3.0.3"
"webpack-dev-server": "3.1.14"
},
"dependencies": {
"@sentry/browser": "4.4.1",
Expand Down
5 changes: 3 additions & 2 deletions test/unit/specs/store/user.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ describe(`Module: User`, () => {
config: {
development: false,
google_analytics_uid: `UA-123`,
version: `0.0.1`
version: `abcfdef`,
sentry_dsn: `https://1:[email protected]/1`
},
loadKeys: () => [
{
Expand Down Expand Up @@ -243,7 +244,7 @@ describe(`Module: User`, () => {
})
expect(state.externals.Sentry.init).toHaveBeenCalledWith({
dsn: expect.stringMatching(`https://.*@sentry.io/.*`),
release: `[email protected]`
release: `abcfdef`
})
})

Expand Down
17 changes: 17 additions & 0 deletions webpack.renderer.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,19 @@ const VueLoaderPlugin = require(`vue-loader/lib/plugin`)
const BundleAnalyzerPlugin = require(`webpack-bundle-analyzer`)
.BundleAnalyzerPlugin
const CleanWebpackPlugin = require(`clean-webpack-plugin`)
const SentryPlugin = require(`@sentry/webpack-plugin`)

function resolve(dir) {
return path.join(__dirname, dir)
}

const buildPath = path.join(__dirname, `app/dist`)

const commitHash = require(`child_process`)
.execSync(`git rev-parse HEAD`)
.toString()
.trim()

const devPlugins = process.env.CIRCLECI
? []
: [
Expand Down Expand Up @@ -88,6 +94,7 @@ const rendererConfig = {
// the global.GENTLY below fixes a compile issue with superagent + webpack
// https://github.com/visionmedia/superagent/issues/672
new webpack.DefinePlugin({ "global.GENTLY": false }),
new webpack.DefinePlugin({ "process.env.RELEASE": `"${commitHash}"` }),
new webpack.DefinePlugin({
"process.env.NODE_ENV": `"${process.env.NODE_ENV}"`
}),
Expand Down Expand Up @@ -171,4 +178,14 @@ if (process.env.NODE_ENV === `production`) {
)
}

if (process.env.RELEASE) {
console.log(`releasing to Sentry`)
rendererConfig.plugins.push(
new SentryPlugin({
include: `./app/dist`,
validate: true
})
)
}

module.exports = rendererConfig
36 changes: 35 additions & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,18 @@
"@sentry/utils" "4.4.1"
tslib "^1.9.3"

"@sentry/cli@^1.35.5":
version "1.39.0"
resolved "https://registry.yarnpkg.com/@sentry/cli/-/cli-1.39.0.tgz#126a20ade9df90ce3e9b99f5b36c8ca6c8ee5b9d"
integrity sha512-pt0pc3aVGLOkmXZmaTmZtMdnmD6dlW/bct3H475Zq/+dNxuWHEq6QA0en1ODUNdndku0ZrWZkKwex2yLNOakig==
dependencies:
fs-copy-file-sync "^1.1.1"
https-proxy-agent "^2.2.1"
mkdirp "^0.5.1"
node-fetch "^2.1.2"
progress "2.0.0"
proxy-from-env "^1.0.0"

"@sentry/[email protected]":
version "4.4.1"
resolved "https://registry.yarnpkg.com/@sentry/core/-/core-4.4.1.tgz#8836813d9d309059913b464cee6d23da09cc4056"
Expand Down Expand Up @@ -220,6 +232,13 @@
"@sentry/types" "4.4.1"
tslib "^1.9.3"

"@sentry/[email protected]":
version "1.6.2"
resolved "https://registry.yarnpkg.com/@sentry/webpack-plugin/-/webpack-plugin-1.6.2.tgz#47b1a43f7e691c1c8dc45677f7380c5e1aa6596d"
integrity sha512-OZ4ISH0xAP6dTHpQ3xFnIa35o+rVKZxcoCn0a41rfgM+XFdXMtw3yc+nsRHkuRpbzWzXUIisBqbBm5KcEark4A==
dependencies:
"@sentry/cli" "^1.35.5"

"@types/node@^10.11.7":
version "10.12.18"
resolved "https://registry.yarnpkg.com/@types/node/-/node-10.12.18.tgz#1d3ca764718915584fcd9f6344621b7672665c67"
Expand Down Expand Up @@ -4227,6 +4246,11 @@ fs-constants@^1.0.0:
resolved "https://registry.yarnpkg.com/fs-constants/-/fs-constants-1.0.0.tgz#6be0de9be998ce16af8afc24497b9ee9b7ccd9ad"
integrity sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow==

fs-copy-file-sync@^1.1.1:
version "1.1.1"
resolved "https://registry.yarnpkg.com/fs-copy-file-sync/-/fs-copy-file-sync-1.1.1.tgz#11bf32c096c10d126e5f6b36d06eece776062918"
integrity sha512-2QY5eeqVv4m2PfyMiEuy9adxNP+ajf+8AR05cEi+OAzPcOj90hvFImeZhTmKLBgSd9EvG33jsD7ZRxsx9dThkQ==

[email protected]:
version "7.0.0"
resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-7.0.0.tgz#8cc3f47ce07ef7b3593a11b9fb245f7e34c041d6"
Expand Down Expand Up @@ -6861,6 +6885,11 @@ node-fetch@^2.1.1:
resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.1.2.tgz#ab884e8e7e57e38a944753cec706f788d1768bb5"
integrity sha1-q4hOjn5X44qUR1POxwb3iNF2i7U=

node-fetch@^2.1.2:
version "2.3.0"
resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.3.0.tgz#1a1d940bbfb916a1d3e0219f037e89e71f8c5fa5"
integrity sha512-MOd8pV3fxENbryESLgVIeaGKrdl+uaYhCSSVkjeOb/31/njTpcis5aWfdqgNlHIrKOLRbMnfPINPOML2CIFeXA==

[email protected]:
version "0.7.5"
resolved "https://registry.yarnpkg.com/node-forge/-/node-forge-0.7.5.tgz#6c152c345ce11c52f465c2abd957e8639cd674df"
Expand Down Expand Up @@ -8011,7 +8040,7 @@ progress-stream@^1.0.1:
speedometer "~0.1.2"
through2 "~0.2.3"

progress@^2.0.0:
progress@2.0.0, progress@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/progress/-/progress-2.0.0.tgz#8a1be366bf8fc23db2bd23f10c6fe920b4389d1f"
integrity sha1-ihvjZr+Pwj2yvSPxDG/pILQ4nR8=
Expand Down Expand Up @@ -8050,6 +8079,11 @@ proxy-addr@~2.0.4:
forwarded "~0.1.2"
ipaddr.js "1.8.0"

proxy-from-env@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/proxy-from-env/-/proxy-from-env-1.0.0.tgz#33c50398f70ea7eb96d21f7b817630a55791c7ee"
integrity sha1-M8UDmPcOp+uW0h97gXYwpVeRx+4=

prr@~1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/prr/-/prr-1.0.1.tgz#d3fc114ba06995a45ec6893f484ceb1d78f5f476"
Expand Down