Skip to content

Commit

Permalink
feat: add Sentry source map (#64)
Browse files Browse the repository at this point in the history
* feat: add Sentry source map

* fix: detailled error of commitment mapper

* fix: remove button when the group is a group of vault-id

* fix: update error scope
  • Loading branch information
gabin54 authored Jun 21, 2023
1 parent fcb8261 commit 1abdefa
Show file tree
Hide file tree
Showing 8 changed files with 42 additions and 18 deletions.
22 changes: 11 additions & 11 deletions .github/actions/deploy/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,17 @@ runs:
run: |
CI=false yarn build
# - name: Create Sentry release
# uses: getsentry/action-release@v1
# env:
# SENTRY_AUTH_TOKEN: ${{ inputs.sentry-auth-token }}
# SENTRY_ORG: ${{ inputs.sentry-org }}
# SENTRY_PROJECT: ${{ inputs.sentry-project }}
# SENTRY_LOG_LEVEL: debug
# with:
# sourcemaps: './build'
# url_prefix: '~'
# environment: ${{ inputs.sentry-env }}
- name: Create Sentry release
uses: getsentry/action-release@v1
env:
SENTRY_AUTH_TOKEN: ${{ inputs.sentry-auth-token }}
SENTRY_ORG: ${{ inputs.sentry-org }}
SENTRY_PROJECT: ${{ inputs.sentry-project }}
SENTRY_LOG_LEVEL: debug
with:
sourcemaps: './build'
url_prefix: '~'
environment: ${{ inputs.sentry-env }}

- name: Remove source map
shell: bash
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/deploy_demo_beta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,7 @@ jobs:
role-to-assume: ${{ secrets.AWS_DEPLOY_ROLE }}
static-bucket-name: demo.vault-beta.sismo.io
env: demo-beta
sentry-env: DEMO_BETA
sentry-auth-token: ${{ secrets.SENTRY_AUTH_TOKEN }}
sentry-org: ${{ secrets.SENTRY_ORG }}
sentry-project: ${{ secrets.SENTRY_PROJECT }}
4 changes: 4 additions & 0 deletions .github/workflows/deploy_dev_beta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,7 @@ jobs:
role-to-assume: ${{ secrets.AWS_DEPLOY_ROLE }}
static-bucket-name: dev.vault-beta.sismo.io
env: dev-beta
sentry-env: DEMO_DEV
sentry-auth-token: ${{ secrets.SENTRY_AUTH_TOKEN }}
sentry-org: ${{ secrets.SENTRY_ORG }}
sentry-project: ${{ secrets.SENTRY_PROJECT }}
4 changes: 4 additions & 0 deletions .github/workflows/deploy_prod_beta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,7 @@ jobs:
role-to-assume: ${{ secrets.AWS_DEPLOY_ROLE }}
static-bucket-name: vault-beta.sismo.io
env: prod-beta
sentry-env: PROD_BETA
sentry-auth-token: ${{ secrets.SENTRY_AUTH_TOKEN }}
sentry-org: ${{ secrets.SENTRY_ORG }}
sentry-project: ${{ secrets.SENTRY_PROJECT }}
4 changes: 4 additions & 0 deletions .github/workflows/deploy_staging_beta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,7 @@ jobs:
role-to-assume: ${{ secrets.AWS_DEPLOY_ROLE }}
static-bucket-name: staging.vault-beta.sismo.io
env: staging-beta
sentry-env: STAGING_BETA
sentry-auth-token: ${{ secrets.SENTRY_AUTH_TOKEN }}
sentry-org: ${{ secrets.SENTRY_ORG }}
sentry-project: ${{ secrets.SENTRY_PROJECT }}
4 changes: 4 additions & 0 deletions .github/workflows/deploy_staging_dev_beta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,7 @@ jobs:
role-to-assume: ${{ secrets.AWS_DEPLOY_ROLE }}
static-bucket-name: staging.dev.vault-beta.sismo.io
env: staging-dev-beta
sentry-env: STAGING_DEV_BETA
sentry-auth-token: ${{ secrets.SENTRY_AUTH_TOKEN }}
sentry-org: ${{ secrets.SENTRY_ORG }}
sentry-project: ${{ secrets.SENTRY_PROJECT }}
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,10 @@ export function DataClaimRequest({
vault.importedAccounts,
]);

const isOnlySismoConnectApps = !Boolean(
groupMetadata.accountTypes.find((el) => !el.startsWith("sismo-connect-app"))
);

return (
<Container>
<Left>
Expand Down Expand Up @@ -241,7 +245,7 @@ export function DataClaimRequest({
<Right>
{vault?.importedAccounts && (
<>
{!isEligible && (
{!isEligible && !isOnlySismoConnectApps && (
<StyledButton
primary
verySmall
Expand Down
12 changes: 6 additions & 6 deletions src/pages/Modals/ImportAccount/provider/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ export default function ImportAccountModalProvider({
const triggerError = (e) => {
Sentry.withScope(function (scope) {
scope.setLevel("fatal");
Sentry.captureException(e);
Sentry.captureException(e?.response?.data);
});
console.error(e);
notificationAdded({
Expand Down Expand Up @@ -159,7 +159,7 @@ export default function ImportAccountModalProvider({
} catch (e) {
Sentry.withScope(function (scope) {
scope.setLevel("fatal");
Sentry.captureException(e);
Sentry.captureException(e?.response?.data);
});
console.error(e);
notificationAdded({
Expand Down Expand Up @@ -243,7 +243,7 @@ export default function ImportAccountModalProvider({
console.error(e);
Sentry.withScope(function (scope) {
scope.setLevel("fatal");
Sentry.captureException(e);
Sentry.captureException(e?.response?.data);
});
notificationAdded({
text: "Telegram account already imported in this vault or in another one",
Expand Down Expand Up @@ -304,7 +304,7 @@ export default function ImportAccountModalProvider({
console.error(e);
Sentry.withScope(function (scope) {
scope.setLevel("fatal");
Sentry.captureException(e);
Sentry.captureException(e?.response?.data);
});
notificationAdded({
text: "Github account already imported in this vault or in another one",
Expand Down Expand Up @@ -367,7 +367,7 @@ export default function ImportAccountModalProvider({
console.error(e);
Sentry.withScope(function (scope) {
scope.setLevel("fatal");
Sentry.captureException(e);
Sentry.captureException(e?.response?.data);
});
notificationAdded({
text: "Twitter account already imported in this vault or in another one",
Expand Down Expand Up @@ -429,7 +429,7 @@ export default function ImportAccountModalProvider({
console.error(e);
Sentry.withScope(function (scope) {
scope.setLevel("fatal");
Sentry.captureException(e);
Sentry.captureException(e?.response?.data);
});
notificationAdded({
text: "Twitter account already imported in this vault or in another one",
Expand Down

0 comments on commit 1abdefa

Please sign in to comment.