fix(sentry): sync dist parameter to resolve minified stack traces
This commit is contained in:
+3
-1
@@ -20,7 +20,9 @@ ENV GITHUB_SHA=$GITHUB_SHA \
|
|||||||
SENTRY_RELEASE=$SENTRY_RELEASE
|
SENTRY_RELEASE=$SENTRY_RELEASE
|
||||||
|
|
||||||
RUN ./scripts/prebuild.sh && \
|
RUN ./scripts/prebuild.sh && \
|
||||||
flutter build web --release --source-maps --dart-define=SENTRY_RELEASE=$SENTRY_RELEASE && \
|
flutter build web --release --source-maps \
|
||||||
|
--dart-define=SENTRY_RELEASE=$SENTRY_RELEASE \
|
||||||
|
--dart-define=SENTRY_DIST=$GITHUB_SHA && \
|
||||||
if [ -n "$SENTRY_AUTH_TOKEN" ] && [ -n "$SENTRY_ORG" ] && [ -n "$SENTRY_PROJECT" ] && [ -n "$SENTRY_RELEASE" ]; then \
|
if [ -n "$SENTRY_AUTH_TOKEN" ] && [ -n "$SENTRY_ORG" ] && [ -n "$SENTRY_PROJECT" ] && [ -n "$SENTRY_RELEASE" ]; then \
|
||||||
echo "Sentry configuration detected, uploading sourcemaps..." && \
|
echo "Sentry configuration detected, uploading sourcemaps..." && \
|
||||||
curl -sL https://sentry.io/get-cli/ | SENTRY_CLI_VERSION=2.20.7 bash && \
|
curl -sL https://sentry.io/get-cli/ | SENTRY_CLI_VERSION=2.20.7 bash && \
|
||||||
|
|||||||
@@ -32,6 +32,11 @@ class SentryConfig {
|
|||||||
// Check if Sentry is available
|
// Check if Sentry is available
|
||||||
final bool isAvailable;
|
final bool isAvailable;
|
||||||
|
|
||||||
|
// The distribution version of the release.
|
||||||
|
// In this project, it represents the Git SHA passed via `--dart-define=SENTRY_DIST`.
|
||||||
|
// This must match the `--dist` parameter used when uploading source maps to Sentry.
|
||||||
|
final String? dist;
|
||||||
|
|
||||||
SentryConfig({
|
SentryConfig({
|
||||||
required this.dsn,
|
required this.dsn,
|
||||||
required this.environment,
|
required this.environment,
|
||||||
@@ -42,6 +47,7 @@ class SentryConfig {
|
|||||||
this.isDebug = BuildUtils.isDebugMode,
|
this.isDebug = BuildUtils.isDebugMode,
|
||||||
this.attachScreenshot = false,
|
this.attachScreenshot = false,
|
||||||
this.isAvailable = false,
|
this.isAvailable = false,
|
||||||
|
this.dist,
|
||||||
});
|
});
|
||||||
|
|
||||||
/// Load configuration from an env file.
|
/// Load configuration from an env file.
|
||||||
@@ -62,11 +68,14 @@ class SentryConfig {
|
|||||||
|
|
||||||
final appVersion = await ApplicationManager().getAppVersion();
|
final appVersion = await ApplicationManager().getAppVersion();
|
||||||
|
|
||||||
|
const sentryDist = String.fromEnvironment('SENTRY_DIST');
|
||||||
|
|
||||||
return SentryConfig(
|
return SentryConfig(
|
||||||
dsn: sentryDSN,
|
dsn: sentryDSN,
|
||||||
environment: sentryEnvironment,
|
environment: sentryEnvironment,
|
||||||
release: appVersion,
|
release: appVersion,
|
||||||
isAvailable: isAvailable,
|
isAvailable: isAvailable,
|
||||||
|
dist: sentryDist.isNotEmpty ? sentryDist : null,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -30,6 +30,7 @@ class SentryInitializer {
|
|||||||
options.dsn = config.dsn;
|
options.dsn = config.dsn;
|
||||||
options.environment = config.environment;
|
options.environment = config.environment;
|
||||||
options.release = config.release;
|
options.release = config.release;
|
||||||
|
options.dist = config.dist;
|
||||||
options.tracesSampleRate = config.tracesSampleRate;
|
options.tracesSampleRate = config.tracesSampleRate;
|
||||||
options.profilesSampleRate = config.profilesSampleRate;
|
options.profilesSampleRate = config.profilesSampleRate;
|
||||||
options.enableLogs = config.enableLogs;
|
options.enableLogs = config.enableLogs;
|
||||||
|
|||||||
Reference in New Issue
Block a user