Skip to content

Commit

Permalink
Improve Sentry support (#11776)
Browse files Browse the repository at this point in the history
- Close enso-org/cloud-v2#1590
- Add source maps to built bundle for sentry to pick up
- Close enso-org/cloud-v2#1589
- Add global Sentry filter to avoid sending 400 responses from backend
- Wrap settings user and organization profile picture inputs in form
- Upgrade from deprecated sentry APIs

# Important Notes
None
  • Loading branch information
somebody1234 authored Dec 19, 2024
1 parent 42cfa69 commit 20c066a
Show file tree
Hide file tree
Showing 17 changed files with 525 additions and 448 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -701,10 +701,13 @@ jobs:
ENSO_CLOUD_ENVIRONMENT: ${{ vars.ENSO_CLOUD_ENVIRONMENT }}
ENSO_CLOUD_GOOGLE_ANALYTICS_TAG: ${{ vars.ENSO_CLOUD_GOOGLE_ANALYTICS_TAG }}
ENSO_CLOUD_SENTRY_DSN: ${{ vars.ENSO_CLOUD_SENTRY_DSN }}
ENSO_CLOUD_SENTRY_ORGANIZATION: ${{ vars.ENSO_CLOUD_SENTRY_ORGANIZATION }}
ENSO_CLOUD_SENTRY_PROJECT: ${{ vars.ENSO_CLOUD_SENTRY_PROJECT }}
ENSO_CLOUD_STRIPE_KEY: ${{ vars.ENSO_CLOUD_STRIPE_KEY }}
ENSO_IDE_AG_GRID_LICENSE_KEY: ${{ vars.ENSO_AG_GRID_LICENSE_KEY }}
ENSO_IDE_MAPBOX_API_TOKEN: ${{ vars.ENSO_MAPBOX_API_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
WIN_CSC_KEY_PASSWORD: ${{ secrets.MICROSOFT_CODE_SIGNING_CERT_PASSWORD }}
WIN_CSC_LINK: ${{ secrets.MICROSOFT_CODE_SIGNING_CERT }}
- if: failure() && runner.os == 'Windows'
Expand Down
3 changes: 3 additions & 0 deletions app/gui/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,6 @@ src/project-view/util/iconName.ts

*storybook.log
storybook-static

# Sentry Config File
.env.sentry-build-plugin
128 changes: 66 additions & 62 deletions app/gui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,13 @@
"bugs": {
"url": "https://github.com/enso-org/enso/issues"
},
"//": {},
"//": [
"--max-old-space-size=4096 is required when sourcemaps are enabled,",
"otherwise Rollup runs out of memory when Vite is rendering chunks."
],
"scripts": {
"typecheck": "vue-tsc --noEmit -p tsconfig.app.json",
"build": "vite build",
"build": "cross-env NODE_OPTIONS=--max-old-space-size=4096 vite build",
"build-cloud": "cross-env CLOUD_BUILD=true corepack pnpm run build",
"preview": "vite preview",
"lint": "eslint . --cache --max-warnings=0",
Expand All @@ -41,31 +44,58 @@
"playwright:install": "playwright install chromium"
},
"dependencies": {
"@ag-grid-community/client-side-row-model": "^32.3.3",
"@ag-grid-community/core": "^32.3.3",
"@ag-grid-community/styles": "^32.3.3",
"@ag-grid-enterprise/core": "^32.3.3",
"@ag-grid-enterprise/range-selection": "^32.3.3",
"@aws-amplify/auth": "5.6.5",
"@aws-amplify/core": "5.8.5",
"@hookform/resolvers": "^3.4.0",
"@internationalized/date": "^3.5.5",
"@lexical/html": "^0.21.0",
"@lexical/link": "^0.21.0",
"@lexical/markdown": "^0.21.0",
"@lezer/common": "^1.1.0",
"@lezer/highlight": "^1.1.6",
"@monaco-editor/react": "4.6.0",
"@sentry/react": "^7.74.0",
"@noble/hashes": "^1.4.0",
"@react-aria/interactions": "^3.22.3",
"@sentry/react": "^7.74.0",
"@sentry/vite-plugin": "^2.22.7",
"@stripe/react-stripe-js": "^2.7.1",
"@stripe/stripe-js": "^3.5.0",
"@tanstack/react-query": "5.55.0",
"@tanstack/vue-query": ">= 5.54.0 < 5.56.0",
"@vueuse/core": "^10.4.1",
"@vueuse/gesture": "^2.0.0",
"ag-grid-community": "^32.3.3",
"ag-grid-enterprise": "^32.3.3",
"ag-grid-vue3": "^32.3.3",
"ajv": "^8.12.0",
"amazon-cognito-identity-js": "6.3.6",
"babel-plugin-react-compiler": "19.0.0-beta-a7bf2bd-20241110",
"clsx": "^2.1.1",
"papaparse": "^5.4.1",
"codemirror": "^6.0.1",
"culori": "^3.2.0",
"enso-common": "workspace:*",
"events": "^3.3.0",
"framer-motion": "11.3.0",
"hash-sum": "^2.0.0",
"idb-keyval": "^6.2.1",
"input-otp": "1.2.4",
"install": "^0.13.0",
"is-network-error": "^1.0.1",
"isomorphic-ws": "^5.0.0",
"lexical": "^0.21.0",
"lib0": "^0.2.85",
"magic-string": "^0.30.3",
"marked": "14.1.3",
"monaco-editor": "0.48.0",
"murmurhash": "^2.0.1",
"papaparse": "^5.4.1",
"postcss-inline-svg": "^6.0.0",
"postcss-nesting": "^12.0.1",
"qrcode.react": "3.1.0",
"react": "^18.3.1",
"react-aria": "^3.34.3",
Expand All @@ -83,15 +113,7 @@
"tiny-invariant": "^1.3.3",
"ts-results": "^3.3.0",
"validator": "^13.12.0",
"zod": "^3.23.8",
"zustand": "^4.5.4",
"@ag-grid-community/client-side-row-model": "^32.3.3",
"@ag-grid-community/core": "^32.3.3",
"@ag-grid-community/styles": "^32.3.3",
"@ag-grid-enterprise/core": "^32.3.3",
"@ag-grid-enterprise/range-selection": "^32.3.3",
"@babel/parser": "^7.24.7",
"babel-plugin-react-compiler": "19.0.0-beta-a7bf2bd-20241110",
"@codemirror/commands": "^6.7.1",
"@codemirror/language": "^6.10.6",
"@codemirror/lang-markdown": "^v6.3.0",
Expand All @@ -101,25 +123,6 @@
"@codemirror/view": "^6.35.3",
"@fast-check/vitest": "^0.0.8",
"@floating-ui/vue": "^1.0.6",
"@lezer/common": "^1.1.0",
"@lezer/highlight": "^1.1.6",
"@noble/hashes": "^1.4.0",
"@vueuse/core": "^10.4.1",
"@vueuse/gesture": "^2.0.0",
"ag-grid-community": "^32.3.3",
"ag-grid-enterprise": "^32.3.3",
"ag-grid-vue3": "^32.3.3",
"codemirror": "^6.0.1",
"culori": "^3.2.0",
"events": "^3.3.0",
"hash-sum": "^2.0.0",
"install": "^0.13.0",
"isomorphic-ws": "^5.0.0",
"lib0": "^0.2.85",
"magic-string": "^0.30.3",
"murmurhash": "^2.0.1",
"postcss-inline-svg": "^6.0.0",
"postcss-nesting": "^12.0.1",
"sucrase": "^3.34.0",
"veaury": "^2.3.18",
"vue": "^3.5.2",
Expand All @@ -129,14 +132,19 @@
"y-websocket": "^1.5.0",
"ydoc-shared": "workspace:*",
"yjs": "^13.6.7",
"marked": "14.1.3"
"zod": "^3.23.8",
"zustand": "^4.5.4"
},
"devDependencies": {
"@babel/plugin-syntax-import-attributes": "^7.24.7",
"@chromatic-com/storybook": "^3.2.2",
"@codemirror/theme-one-dark": "^6.1.2",
"@danmarshall/deckgl-typings": "^4.9.28",
"@fast-check/vitest": "^0.0.8",
"@histoire/plugin-vue": "^0.17.12",
"@modyfi/vite-plugin-yaml": "^1.0.4",
"@open-rpc/server-js": "^1.9.4",
"@playwright/test": "^1.40.0",
"@babel/plugin-syntax-import-attributes": "^7.24.7",
"@react-types/shared": "^3.22.1",
"@storybook/addon-essentials": "^8.4.2",
"@storybook/addon-interactions": "^8.4.2",
Expand All @@ -148,68 +156,64 @@
"@storybook/vue3": "^8.4.2",
"@storybook/vue3-vite": "^8.4.2",
"@tanstack/react-query-devtools": "5.45.1",
"@types/node": "^22.9.0",
"@types/papaparse": "^5.3.15",
"@types/react": "^18.0.27",
"@types/react-dom": "^18.0.10",
"@types/validator": "^13.11.7",
"@vitejs/plugin-react": "^4.3.3",
"chalk": "^5.3.0",
"cross-env": "^7.0.3",
"fast-check": "^3.15.0",
"playwright": "^1.39.0",
"postcss": "^8.4.29",
"prettier-plugin-organize-imports": "^4.0.0",
"prettier-plugin-tailwindcss": "^0.5.11",
"react-toastify": "^9.1.3",
"tailwindcss": "^3.4.1",
"tailwindcss-animate": "1.0.7",
"tailwindcss-react-aria-components": "^1.1.1",
"typescript": "^5.5.3",
"vite": "^5.4.10",
"vitest": "^1.3.1",
"@codemirror/theme-one-dark": "^6.1.2",
"@danmarshall/deckgl-typings": "^4.9.28",
"@histoire/plugin-vue": "^0.17.12",
"@open-rpc/server-js": "^1.9.4",
"@testing-library/jest-dom": "6.6.3",
"@testing-library/react": "16.0.1",
"@testing-library/react-hooks": "8.0.1",
"@testing-library/user-event": "14.5.2",
"@tsconfig/node20": "^20.1.4",
"@types/css.escape": "^1.5.2",
"@types/culori": "^2.0.1",
"@types/d3": "^7.4.0",
"@types/hash-sum": "^1.0.0",
"@types/jsdom": "^21.1.1",
"@types/mapbox-gl": "^3.4.1",
"@types/node": "^22.9.0",
"@types/papaparse": "^5.3.15",
"@types/react": "^18.0.27",
"@types/react-dom": "^18.0.10",
"@types/shuffle-seed": "^1.1.0",
"@types/tar": "^6.1.4",
"@types/validator": "^13.11.7",
"@types/wicg-file-system-access": "^2023.10.2",
"@types/ws": "^8.5.5",
"@vitejs/plugin-react": "^4.3.3",
"@vitejs/plugin-vue": "^5.0.4",
"@vitest/coverage-v8": "^1.3.1",
"@vue/test-utils": "^2.4.6",
"@vue/tsconfig": "^0.5.1",
"@testing-library/jest-dom": "6.6.3",
"@testing-library/react": "16.0.1",
"@testing-library/user-event": "14.5.2",
"@testing-library/react-hooks": "8.0.1",
"chalk": "^5.3.0",
"chromatic": "11.18.1",
"cross-env": "^7.0.3",
"css.escape": "^1.5.1",
"d3": "^7.4.0",
"enso-common": "workspace:*",
"fast-check": "^3.15.0",
"floating-vue": "^2.0.0-beta.24",
"hash-wasm": "^4.11.0",
"histoire": "^0.17.2",
"jsdom": "^24.1.0",
"playwright": "^1.39.0",
"postcss": "^8.4.29",
"postcss-nesting": "^12.0.1",
"prettier": "^3.3.2",
"prettier-plugin-organize-imports": "^4.0.0",
"prettier-plugin-tailwindcss": "^0.5.11",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-toastify": "^9.1.3",
"shuffle-seed": "^1.1.6",
"sql-formatter": "^13.0.0",
"storybook": "^8.4.2",
"chromatic": "11.18.1",
"tailwindcss": "^3.4.1",
"tailwindcss-animate": "1.0.7",
"tailwindcss-react-aria-components": "^1.1.1",
"tar": "^6.2.1",
"tsx": "^4.7.1",
"typescript": "^5.5.3",
"vite": "^5.4.10",
"vite-plugin-vue-devtools": "7.6.3",
"vite-plugin-wasm": "^3.3.0",
"vitest": "^1.3.1",
"vue-react-wrapper": "^0.3.1",
"vue-tsc": "^2.0.24",
"yaml": "^2.4.5",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
/** @file A hidden file input. */
import {
Form,
type FieldPath,
type FieldProps,
type FieldStateProps,
type FieldValues,
type FieldVariantProps,
type TSchema,
} from '#/components/AriaComponents'
import { Input, type InputProps } from '#/components/aria'

/** Props for {@link HiddenFile}. */
export interface HiddenFileProps<Schema extends TSchema, TFieldName extends FieldPath<Schema>>
extends FieldStateProps<
Omit<InputProps, 'children' | 'value'> & { value: FieldValues<Schema>[TFieldName] },
Schema,
TFieldName
>,
FieldProps,
FieldVariantProps {
/** When true, triggers `form.submit()` on input. */
readonly autoSubmit?: boolean | undefined
readonly accept?: string | undefined
}

/** A hidden file input. */
export function HiddenFile<Schema extends TSchema, TFieldName extends FieldPath<Schema>>(
props: HiddenFileProps<Schema, TFieldName>,
) {
const {
form,
autoSubmit = false,
accept,
// eslint-disable-next-line @typescript-eslint/naming-convention
defaultValue: _defaultValue,
// eslint-disable-next-line @typescript-eslint/naming-convention
disabled: _disabled,
...inputProps
} = props
const formInstance = Form.useFormContext(form)

return (
<Form.Controller
{...inputProps}
control={formInstance.control}
render={({ field }) => (
<Input
type="file"
className="focus-child w-0"
accept={accept}
onChange={(event) => {
field.onChange(event.target.files?.[0])
if (autoSubmit) {
void formInstance.submit()
}
}}
/>
)}
/>
)
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/** @file Barrel file for HiddenFile component. */
export * from './HiddenFile'
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
export * from './ComboBox'
export * from './DatePicker'
export * from './Dropdown'
export * from './HiddenFile'
export * from './Input'
export * from './MultiSelector'
export * from './OTPInput'
Expand Down
Loading

0 comments on commit 20c066a

Please sign in to comment.