Skip to content

Commit

Permalink
chore: use snapshot-sentry to handle sentry (#621)
Browse files Browse the repository at this point in the history
  • Loading branch information
wa0x6e authored Jul 29, 2023
1 parent 49005a5 commit 4c5609c
Show file tree
Hide file tree
Showing 22 changed files with 27 additions and 64 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@
"@ethersproject/hash": "^5.5.0",
"@ethersproject/providers": "^5.6.8",
"@ethersproject/wallet": "^5.6.2",
"@sentry/node": "^7.60.1",
"@snapshot-labs/keycard": "^0.1.0",
"@snapshot-labs/pineapple": "^0.1.0-beta.1",
"@snapshot-labs/snapshot-sentry": "^1.1.0",
"@snapshot-labs/snapshot.js": "^0.4.106",
"bluebird": "^3.7.2",
"connection-string": "^1.0.1",
Expand Down
2 changes: 1 addition & 1 deletion src/graphql/operations/aliases.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import db from '../../helpers/mysql';
import { buildWhereQuery, checkLimits } from '../helpers';
import log from '../../helpers/log';
import { capture } from '../../helpers/sentry';
import { capture } from '@snapshot-labs/snapshot-sentry';

export default async function (parent, args) {
const { first = 20, skip = 0, where = {} } = args;
Expand Down
2 changes: 1 addition & 1 deletion src/graphql/operations/follows.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import db from '../../helpers/mysql';
import { buildWhereQuery, checkLimits, formatFollow } from '../helpers';
import log from '../../helpers/log';
import { capture } from '../../helpers/sentry';
import { capture } from '@snapshot-labs/snapshot-sentry';

export default async function (parent, args) {
const { first = 20, skip = 0, where = {} } = args;
Expand Down
2 changes: 1 addition & 1 deletion src/graphql/operations/messages.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import db from '../../helpers/mysql';
import { buildWhereQuery, checkLimits } from '../helpers';
import log from '../../helpers/log';
import { capture } from '../../helpers/sentry';
import { capture } from '@snapshot-labs/snapshot-sentry';

export default async function (parent, args) {
const { first = 20, skip = 0, where = {} } = args;
Expand Down
2 changes: 1 addition & 1 deletion src/graphql/operations/proposal.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import db from '../../helpers/mysql';
import { formatProposal } from '../helpers';
import log from '../../helpers/log';
import { capture } from '../../helpers/sentry';
import { capture } from '@snapshot-labs/snapshot-sentry';

export default async function (parent, { id }) {
const query = `
Expand Down
2 changes: 1 addition & 1 deletion src/graphql/operations/proposals.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import db from '../../helpers/mysql';
import { buildWhereQuery, formatProposal, checkLimits } from '../helpers';
import log from '../../helpers/log';
import { verifiedSpaces } from '../../helpers/moderation';
import { capture } from '../../helpers/sentry';
import { capture } from '@snapshot-labs/snapshot-sentry';

export default async function (parent, args) {
const { first = 20, skip = 0, where = {} } = args;
Expand Down
2 changes: 1 addition & 1 deletion src/graphql/operations/ranking.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { checkLimits, formatSpace, handleRelatedSpaces, PublicError } from '../h
import log from '../../helpers/log';
import db from '../../helpers/mysql';
import { rankedSpaces } from '../../helpers/spaces';
import { capture } from '../../helpers/sentry';
import { capture } from '@snapshot-labs/snapshot-sentry';

export default async function (_parent, args, _context, info) {
checkLimits(args, 'ranking');
Expand Down
2 changes: 1 addition & 1 deletion src/graphql/operations/space.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { fetchSpaces, handleRelatedSpaces, PublicError } from '../helpers';
import log from '../../helpers/log';
import { capture } from '../../helpers/sentry';
import { capture } from '@snapshot-labs/snapshot-sentry';

export default async function (_parent, { id }, _context, info) {
if (!id) return new PublicError('Missing id');
Expand Down
2 changes: 1 addition & 1 deletion src/graphql/operations/spaces.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { checkLimits, fetchSpaces, handleRelatedSpaces, PublicError } from '../helpers';
import log from '../../helpers/log';
import { capture } from '../../helpers/sentry';
import { capture } from '@snapshot-labs/snapshot-sentry';

export default async function (_parent, args, _context, info) {
checkLimits(args, 'spaces');
Expand Down
2 changes: 1 addition & 1 deletion src/graphql/operations/statement.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import db from '../../helpers/mysql';
import log from '../../helpers/log';
import { capture } from '../../helpers/sentry';
import { capture } from '@snapshot-labs/snapshot-sentry';

export default async function (parent, args) {
const id = args.id;
Expand Down
2 changes: 1 addition & 1 deletion src/graphql/operations/statements.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import db from '../../helpers/mysql';
import { buildWhereQuery, checkLimits } from '../helpers';
import log from '../../helpers/log';
import { capture } from '../../helpers/sentry';
import { capture } from '@snapshot-labs/snapshot-sentry';

export default async function (parent, args) {
const { first = 20, skip = 0, where = {} } = args;
Expand Down
2 changes: 1 addition & 1 deletion src/graphql/operations/subscriptions.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import db from '../../helpers/mysql';
import { buildWhereQuery, checkLimits, formatSubscription } from '../helpers';
import log from '../../helpers/log';
import { capture } from '../../helpers/sentry';
import { capture } from '@snapshot-labs/snapshot-sentry';

export default async function (parent, args) {
const { first = 20, skip = 0, where = {} } = args;
Expand Down
2 changes: 1 addition & 1 deletion src/graphql/operations/user.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import db from '../../helpers/mysql';
import { formatUser } from '../helpers';
import log from '../../helpers/log';
import { capture } from '../../helpers/sentry';
import { capture } from '@snapshot-labs/snapshot-sentry';

export default async function (parent, args) {
const id = args.id;
Expand Down
2 changes: 1 addition & 1 deletion src/graphql/operations/users.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import db from '../../helpers/mysql';
import { buildWhereQuery, checkLimits, formatUser } from '../helpers';
import log from '../../helpers/log';
import { capture } from '../../helpers/sentry';
import { capture } from '@snapshot-labs/snapshot-sentry';

export default async function (parent, args) {
const { first = 20, skip = 0, where = {} } = args;
Expand Down
2 changes: 1 addition & 1 deletion src/graphql/operations/vote.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import graphqlFields from 'graphql-fields';
import db from '../../helpers/mysql';
import { formatProposal, formatVote } from '../helpers';
import log from '../../helpers/log';
import { capture } from '../../helpers/sentry';
import { capture } from '@snapshot-labs/snapshot-sentry';

export default async function (parent, { id }, context, info) {
const requestedFields = info ? graphqlFields(info) : {};
Expand Down
2 changes: 1 addition & 1 deletion src/graphql/operations/votes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import db from '../../helpers/mysql';
import { buildWhereQuery, checkLimits, formatProposal, formatSpace, formatVote } from '../helpers';
import serve from '../../helpers/ee';
import log from '../../helpers/log';
import { capture } from '../../helpers/sentry';
import { capture } from '@snapshot-labs/snapshot-sentry';

async function query(parent, args, context?, info?) {
const requestedFields = info ? graphqlFields(info) : {};
Expand Down
2 changes: 1 addition & 1 deletion src/helpers/moderation.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import snapshot from '@snapshot-labs/snapshot.js';
import log from './log';
import { capture } from './sentry';
import { capture } from '@snapshot-labs/snapshot-sentry';

const moderationURL = 'https://sh5.co/api/moderation';

Expand Down
44 changes: 0 additions & 44 deletions src/helpers/sentry.ts

This file was deleted.

2 changes: 1 addition & 1 deletion src/helpers/spaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { uniq } from 'lodash';
import db from './mysql';
import log from './log';
import { flaggedSpaces, verifiedSpaces } from './moderation';
import { capture } from './sentry';
import { capture } from '@snapshot-labs/snapshot-sentry';

export let spaces = {};
export const spacesMetadata = {};
Expand Down
2 changes: 1 addition & 1 deletion src/helpers/strategies.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import snapshot from '@snapshot-labs/snapshot.js';
import { spaces } from './spaces';
import log from './log';
import { capture } from './sentry';
import { capture } from '@snapshot-labs/snapshot-sentry';

export let strategies: any[] = [];
export let strategiesObj: any = {};
Expand Down
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import log from './helpers/log';
import './helpers/strategies';
import { verifyKeyCard } from './helpers/keycard';
import './helpers/moderation';
import { initLogger, fallbackLogger } from './helpers/sentry';
import { initLogger, fallbackLogger } from '@snapshot-labs/snapshot-sentry';

const app = express();
const PORT = process.env.PORT || 3000;
Expand Down
7 changes: 7 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1171,6 +1171,13 @@
resolved "https://registry.yarnpkg.com/@snapshot-labs/prettier-config/-/prettier-config-0.1.0-beta.7.tgz#c8e07e7e9baabee245020a72ac05835b65139823"
integrity sha512-k/FUf4VWhwLFUmKuWs2mNvmPe691hqhvCJuujD4TfbIivWysmL1TqthwfdQUrQEAQUqVQ2ZKEiGkbufp5J27eQ==

"@snapshot-labs/snapshot-sentry@^1.1.0":
version "1.1.0"
resolved "https://registry.yarnpkg.com/@snapshot-labs/snapshot-sentry/-/snapshot-sentry-1.1.0.tgz#b357d4789ffd287f90fb70e7f0b207b47627cf24"
integrity sha512-Z31Y/5RJkTudrUwPasRxfABEQG2eQ2Ka5+vpi5zEwspt5gwTEfVM8M1NlYMFikWYqXHvVk51EU3UmJTqgL6pIg==
dependencies:
"@sentry/node" "^7.60.1"

"@snapshot-labs/snapshot.js@^0.4.106":
version "0.4.106"
resolved "https://registry.yarnpkg.com/@snapshot-labs/snapshot.js/-/snapshot.js-0.4.106.tgz#1861b0346a93f1caf35e89c0dcff95945407dc31"
Expand Down

0 comments on commit 4c5609c

Please sign in to comment.