Skip to content

Commit

Permalink
Merge branch 'main' into feat/database-breadcrumbs
Browse files Browse the repository at this point in the history
  • Loading branch information
denrase committed Oct 17, 2023
2 parents 9978a74 + daa1b33 commit 26a77fc
Show file tree
Hide file tree
Showing 27 changed files with 4,891 additions and 65 deletions.
56 changes: 56 additions & 0 deletions .github/workflows/diagrams.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: diagrams
on:
workflow_dispatch:

jobs:
diagrams:
runs-on: ubuntu-latest
name: "Create class diagrams of all packages"
steps:
- uses: dart-lang/setup-dart@6a218f2413a3e78e9087f638a238f6b40893203d # pin@v1
with:
sdk: stable

- uses: actions/checkout@v3

- name: dependencies
run: |
dart pub global activate lakos
sudo apt update
sudo apt install graphviz
- name: dart
working-directory: ./dart
run: lakos . -i "{test/**,example/**,example_web/**}" | dot -Tsvg -o class-diagram.svg

- name: flutter
working-directory: ./flutter
run: lakos . -i "{test/**,example/**}" | dot -Tsvg -o class-diagram.svg

- name: dio
working-directory: ./dio
run: lakos . -i "{test/**,example/**}" | dot -Tsvg -o class-diagram.svg

- name: file
working-directory: ./file
run: lakos . -i "{test/**,example/**}" | dot -Tsvg -o class-diagram.svg

- name: sqflite
working-directory: ./sqflite
run: lakos . -i "{test/**,example/**}" | dot -Tsvg -o class-diagram.svg

- name: logging
working-directory: ./logging
run: lakos . -i "{test/**,example/**}" | dot -Tsvg -o class-diagram.svg

# Source: https://stackoverflow.com/a/58035262
- name: Extract branch name
shell: bash
run: echo "branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_OUTPUT
id: extract_branch

# actions/checkout fetches only a single commit in a detached HEAD state. Therefore
# we need to pass the current branch, otherwise we can't commit the changes.
# GITHUB_HEAD_REF is the name of the head branch. GitHub Actions only sets this for PRs.
- name: Commit & push
run: ./scripts/commit-code.sh ${{ steps.extract_branch.outputs.branch }} "Update class diagrams"
2 changes: 1 addition & 1 deletion .github/workflows/format-and-fix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,4 @@ jobs:
# we need to pass the current branch, otherwise we can't commit the changes.
# GITHUB_HEAD_REF is the name of the head branch. GitHub Actions only sets this for PRs.
- name: Commit & push
run: ./scripts/commit-formatted-code.sh ${{ steps.extract_branch.outputs.branch }}
run: ./scripts/commit-code.sh ${{ steps.extract_branch.outputs.branch }} "Format & fix code"
9 changes: 6 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,12 @@
### Dependencies

- Enable compatibility with uuid v4 ([#1647](https://github.com/getsentry/sentry-dart/pull/1647))
- Bump Cocoa SDK from v8.11.0 to v8.12.0 ([#1650](https://github.com/getsentry/sentry-dart/pull/1650))
- [changelog](https://github.com/getsentry/sentry-cocoa/blob/main/CHANGELOG.md#8120)
- [diff](https://github.com/getsentry/sentry-cocoa/compare/8.11.0...8.12.0)
- Bump Android SDK from v6.29.0 to v6.31.0 ([#1660](https://github.com/getsentry/sentry-dart/pull/1660), [#1676](https://github.com/getsentry/sentry-dart/pull/1676))
- [changelog](https://github.com/getsentry/sentry-java/blob/main/CHANGELOG.md#6310)
- [diff](https://github.com/getsentry/sentry-java/compare/6.29.0...6.31.0)
- Bump Cocoa SDK from v8.11.0 to v8.13.1 ([#1650](https://github.com/getsentry/sentry-dart/pull/1650), [#1655](https://github.com/getsentry/sentry-dart/pull/1655), [#1677](https://github.com/getsentry/sentry-dart/pull/1677))
- [changelog](https://github.com/getsentry/sentry-cocoa/blob/main/CHANGELOG.md#8131)
- [diff](https://github.com/getsentry/sentry-cocoa/compare/8.11.0...8.13.1)

## 7.10.1

Expand Down
3,364 changes: 3,364 additions & 0 deletions dart/class-diagram.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions dart/lib/src/hub.dart
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ class Hub {
exception: exception,
stackTrace: stackTrace,
);
if (_options.devMode) {
if (_options.automatedTestMode) {
rethrow;
}
}
Expand Down Expand Up @@ -377,7 +377,7 @@ class Hub {
SentryLevel.error,
"Error in the 'configureScope' callback, error: $err",
);
if (_options.devMode) {
if (_options.automatedTestMode) {
rethrow;
}
}
Expand Down
4 changes: 2 additions & 2 deletions dart/lib/src/scope.dart
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ class Scope {
exception: exception,
stackTrace: stackTrace,
);
if (_options.devMode) {
if (_options.automatedTestMode) {
rethrow;
}
}
Expand Down Expand Up @@ -345,7 +345,7 @@ class Scope {
exception: exception,
stackTrace: stackTrace,
);
if (_options.devMode) {
if (_options.automatedTestMode) {
rethrow;
}
}
Expand Down
2 changes: 1 addition & 1 deletion dart/lib/src/sentry.dart
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ class Sentry {
exception: exception,
stackTrace: stackTrace,
);
if (sentryOptions.devMode) {
if (sentryOptions.automatedTestMode) {
rethrow;
}
}
Expand Down
4 changes: 2 additions & 2 deletions dart/lib/src/sentry_client.dart
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,7 @@ class SentryClient {
exception: exception,
stackTrace: stackTrace,
);
if (_options.devMode) {
if (_options.automatedTestMode) {
rethrow;
}
}
Expand Down Expand Up @@ -438,7 +438,7 @@ class SentryClient {
exception: exception,
stackTrace: stackTrace,
);
if (_options.devMode) {
if (_options.automatedTestMode) {
rethrow;
}
}
Expand Down
4 changes: 2 additions & 2 deletions dart/lib/src/sentry_options.dart
Original file line number Diff line number Diff line change
Expand Up @@ -353,10 +353,10 @@ class SentryOptions {
/// are set.
bool? enableTracing;

/// Changed SDK behaviour when set to true:
/// Only for internal use. Changed SDK behaviour when set to true:
/// - Rethrow exceptions that occur in user provided closures
@internal
bool devMode = false;
bool automatedTestMode = false;

SentryOptions({this.dsn, PlatformChecker? checker}) {
if (checker != null) {
Expand Down
2 changes: 1 addition & 1 deletion dart/lib/src/sentry_traces_sampler.dart
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class SentryTracesSampler {
exception: exception,
stackTrace: stackTrace,
);
if (_options.devMode) {
if (_options.automatedTestMode) {
rethrow;
}
}
Expand Down
4 changes: 2 additions & 2 deletions dart/test/environment_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ void main() {
release: 'release-9.8.7',
dist: 'bar',
);
options.devMode = true;
options.automatedTestMode = true;

await Sentry.init(
(options) => options,
Expand All @@ -44,7 +44,7 @@ void main() {
release: 'release-9.8.7',
dist: 'bar',
);
options.devMode = true;
options.automatedTestMode = true;

await Sentry.init(
(options) => options,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ void main() {

final transport = MockTransport();

final options = SentryOptions(dsn: fakeDsn)..devMode = true;
final options = SentryOptions(dsn: fakeDsn)..automatedTestMode = true;
await Sentry.init(
(options) {
options.dsn = fakeDsn;
Expand Down
2 changes: 1 addition & 1 deletion dart/test/event_processor/enricher/io_enricher_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ void main() {
});

test('$IoEnricherEventProcessor gets added on init', () async {
final options = SentryOptions(dsn: fakeDsn)..devMode = true;
final options = SentryOptions(dsn: fakeDsn)..automatedTestMode = true;
late SentryOptions configuredOptions;
await Sentry.init(
(options) {
Expand Down
4 changes: 2 additions & 2 deletions dart/test/initialization_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ void main() {
});

test('async re-initilization', () async {
final options = SentryOptions(dsn: fakeDsn)..devMode = true;
final options = SentryOptions(dsn: fakeDsn)..automatedTestMode = true;
await Sentry.init(
(options) {
options.dsn = fakeDsn;
Expand All @@ -35,7 +35,7 @@ void main() {
// This is the failure from
// https://github.com/getsentry/sentry-dart/issues/508
test('re-initilization', () async {
final options = SentryOptions(dsn: fakeDsn)..devMode = true;
final options = SentryOptions(dsn: fakeDsn)..automatedTestMode = true;
await Sentry.init(
(options) {
options.dsn = fakeDsn;
Expand Down
40 changes: 20 additions & 20 deletions dart/test/sentry_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ void main() {
var anException = Exception();

setUp(() async {
final options = SentryOptions(dsn: fakeDsn)..devMode = true;
final options = SentryOptions(dsn: fakeDsn)..automatedTestMode = true;
await Sentry.init(
options: options,
(options) => {
Expand Down Expand Up @@ -137,7 +137,7 @@ void main() {
});

test('null DSN', () async {
final options = SentryOptions(dsn: fakeDsn)..devMode = true;
final options = SentryOptions(dsn: fakeDsn)..automatedTestMode = true;
expect(
() async => await Sentry.init(
options: options,
Expand All @@ -150,7 +150,7 @@ void main() {

test('appRunner should be optional', () async {
expect(Sentry.isEnabled, false);
final options = SentryOptions(dsn: fakeDsn)..devMode = true;
final options = SentryOptions(dsn: fakeDsn)..automatedTestMode = true;
await Sentry.init(
options: options,
(options) => options.dsn = fakeDsn,
Expand All @@ -159,7 +159,7 @@ void main() {
});

test('empty DSN', () async {
final options = SentryOptions(dsn: fakeDsn)..devMode = true;
final options = SentryOptions(dsn: fakeDsn)..automatedTestMode = true;
await Sentry.init(
options: options,
(options) => options.dsn = '',
Expand All @@ -170,7 +170,7 @@ void main() {
test('empty DSN disables the SDK but runs the integrations', () async {
final integration = MockIntegration();

final options = SentryOptions(dsn: fakeDsn)..devMode = true;
final options = SentryOptions(dsn: fakeDsn)..automatedTestMode = true;
await Sentry.init(
options: options,
(options) {
Expand All @@ -183,7 +183,7 @@ void main() {
});

test('close disables the SDK', () async {
final options = SentryOptions(dsn: fakeDsn)..devMode = true;
final options = SentryOptions(dsn: fakeDsn)..automatedTestMode = true;
await Sentry.init(
options: options,
(options) => options.dsn = fakeDsn,
Expand All @@ -207,7 +207,7 @@ void main() {
test('should install integrations', () async {
final integration = MockIntegration();

final options = SentryOptions(dsn: fakeDsn)..devMode = true;
final options = SentryOptions(dsn: fakeDsn)..automatedTestMode = true;
await Sentry.init(
options: options,
(options) {
Expand All @@ -221,7 +221,7 @@ void main() {

test('should add default integrations', () async {
late SentryOptions optionsReference;
final options = SentryOptions(dsn: fakeDsn)..devMode = true;
final options = SentryOptions(dsn: fakeDsn)..automatedTestMode = true;
await Sentry.init(
options: options,
(options) {
Expand All @@ -245,7 +245,7 @@ void main() {
}, onPlatform: {'browser': Skip()});

test('should add only web compatible default integrations', () async {
final options = SentryOptions(dsn: fakeDsn)..devMode = true;
final options = SentryOptions(dsn: fakeDsn)..automatedTestMode = true;
await Sentry.init(
options: options,
(options) {
Expand All @@ -261,7 +261,7 @@ void main() {
test('should close integrations', () async {
final integration = MockIntegration();

final options = SentryOptions(dsn: fakeDsn)..devMode = true;
final options = SentryOptions(dsn: fakeDsn)..automatedTestMode = true;
await Sentry.init(
options: options,
(options) {
Expand All @@ -277,7 +277,7 @@ void main() {
});

test('$DeduplicationEventProcessor is added on init', () async {
final options = SentryOptions(dsn: fakeDsn)..devMode = true;
final options = SentryOptions(dsn: fakeDsn)..automatedTestMode = true;
await Sentry.init(
options: options,
(options) {
Expand All @@ -294,7 +294,7 @@ void main() {
final completer = Completer();
var completed = false;

final options = SentryOptions(dsn: fakeDsn)..devMode = true;
final options = SentryOptions(dsn: fakeDsn)..automatedTestMode = true;
final init = Sentry.init(
options: options,
(options) {
Expand All @@ -321,7 +321,7 @@ void main() {
final completer = Completer();
var completed = false;

final options = SentryOptions(dsn: fakeDsn)..devMode = true;
final options = SentryOptions(dsn: fakeDsn)..automatedTestMode = true;
final init = Sentry.init(
options: options,
(options) {
Expand All @@ -345,11 +345,11 @@ void main() {

test('options.environment debug', () async {
final sentryOptions = SentryOptions(dsn: fakeDsn)
..devMode = true
..automatedTestMode = true
..platformChecker = FakePlatformChecker.debugMode();

final options = SentryOptions();
options.devMode = true;
options.automatedTestMode = true;
await Sentry.init(
(options) {
options.dsn = fakeDsn;
Expand All @@ -363,7 +363,7 @@ void main() {
test('options.environment profile', () async {
final sentryOptions =
SentryOptions(dsn: fakeDsn, checker: FakePlatformChecker.profileMode())
..devMode = true;
..automatedTestMode = true;

await Sentry.init(
(options) {
Expand All @@ -378,7 +378,7 @@ void main() {
test('options.environment production (defaultEnvironment)', () async {
final sentryOptions =
SentryOptions(dsn: fakeDsn, checker: FakePlatformChecker.releaseMode())
..devMode = true;
..automatedTestMode = true;
await Sentry.init(
(options) {
options.dsn = fakeDsn;
Expand All @@ -392,7 +392,7 @@ void main() {
test('options.logger is set by setting the debug flag', () async {
final sentryOptions =
SentryOptions(dsn: fakeDsn, checker: FakePlatformChecker.debugMode())
..devMode = true;
..automatedTestMode = true;

await Sentry.init(
(options) {
Expand All @@ -417,7 +417,7 @@ void main() {

test('throw is handled and logged', () async {
final sentryOptions = SentryOptions(dsn: fakeDsn)
..devMode = false
..automatedTestMode = false
..debug = true
..logger = fixture.mockLogger;

Expand All @@ -439,7 +439,7 @@ void main() {

test('throw is handled and logged', () async {
final sentryOptions = SentryOptions(dsn: fakeDsn)
..devMode = false
..automatedTestMode = false
..debug = true
..logger = fixture.mockLogger;

Expand Down
Loading

0 comments on commit 26a77fc

Please sign in to comment.