Skip to content

Commit

Permalink
41 sentry integration (#58)
Browse files Browse the repository at this point in the history
* added sentry cli

* added source map

* code updated

---------

Co-authored-by: Nagarjun Sanji <[email protected]>
  • Loading branch information
nagarjunsanji and Nagarjun Sanji authored Sep 18, 2024
1 parent 54d59eb commit f9cfef0
Show file tree
Hide file tree
Showing 5 changed files with 258 additions and 22 deletions.
33 changes: 18 additions & 15 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,21 +53,24 @@ jobs:
runs-on: ubuntu-latest
needs: deploy
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v4

- name: Get latest tag
run: |
- name: Get latest tag
run: |
LATEST_TAG=$(git describe --tags --abbrev=0 2>/dev/null || echo "0.0.0")
echo "LATEST_TAG=$LATEST_TAG" >> $GITHUB_ENV
shell: /usr/bin/bash --noprofile --norc -e -o pipefail {0}

- name: Create Sentry release
uses: getsentry/action-release@v1
env:
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
SENTRY_ORG: ${{ secrets.SENTRY_ORG }}
SENTRY_PROJECT: ${{ secrets.SENTRY_PROJECT }}
SENTRY_URL: ${{ secrets.SENTRY_URL }}
with:
environment: production
version: ${{ env.LATEST_TAG }}
shell: /usr/bin/bash --noprofile --norc -e -o pipefail {0}

- name: Create Sentry release
uses: getsentry/action-release@v1
env:
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
SENTRY_ORG: ${{ secrets.SENTRY_ORG }}
SENTRY_PROJECT: ${{ secrets.SENTRY_PROJECT }}
SENTRY_URL: ${{ secrets.SENTRY_URL }}
with:
environment: production
version: ${{ env.LATEST_TAG }}

- name: upload sourcemaps to sentry
run: npm run sentry:sourcemaps
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,6 @@ node_modules
coverage
.debricked
resources/debricked-cli/debricked_download.log
resources/debricked-cli/cli
resources/debricked-cli/cli
# Sentry Config File
.sentryclirc
226 changes: 222 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,8 @@
"clean": "rimraf out && rimraf dist && rimraf coverage && rimraf .debricked",
"clean-all": "rimraf out && rimraf dist && rimraf coverage && rimraf .vscode-test",
"vsce": "vsce package",
"madge": "npm run compile-tests && rimraf out\\test && madge --include-npm --image graph.svg out"
"madge": "npm run compile-tests && rimraf out\\test && madge --include-npm --image graph.svg out",
"sentry:sourcemaps": "sentry-cli sourcemaps inject --org debricked --project visual-studio-code-extensions ./out && sentry-cli --url https://sentry.debricked.com/ sourcemaps upload --org debricked --project visual-studio-code-extensions ./out"
},
"devDependencies": {
"@types/chai": "^4.3.16",
Expand Down Expand Up @@ -157,6 +158,7 @@
"typescript": "^5.4.5"
},
"dependencies": {
"@sentry/cli": "^2.36.1",
"@sentry/node": "^8.27.0",
"mock-fs": "^5.2.0",
"proxyquire": "^2.1.3"
Expand Down
13 changes: 12 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@
"sourceMap": true,
"rootDir": "src",
"strict": true /* enable all strict type-checking options */,

/* Additional Checks */
"noImplicitReturns": true /* Report error when not all code paths in function return a value. */,

"noFallthroughCasesInSwitch": true /* Report errors for fallthrough cases in switch statement. */,
"noUnusedParameters": true /* Report errors on unused parameters. */,
"noUnusedLocals": true /* Report errors on unused local variables. */,
Expand All @@ -24,7 +26,16 @@
"strictBindCallApply": true,
"strictFunctionTypes": true,
"strictNullChecks": true,
"baseUrl": "./src"
"baseUrl": "./src",
"inlineSources": true,

// Set `sourceRoot` to "/" to strip the build path prefix
// from generated source code references.
// This improves issue grouping in Sentry.
// Set `sourceRoot` to "/" to strip the build path prefix
// from generated source code references.
// This improves issue grouping in Sentry.
"sourceRoot": "/"
},
"include": ["src/**/*.ts", "test/**/*.ts"]
}

0 comments on commit f9cfef0

Please sign in to comment.