Skip to content

Commit 7748b7c

Browse files
denrasebuenaflor
andauthored
APM for hive (#1672)
* setup sentry hive library * Add SentryBox with first test * test added spans * Add sentry hive impl * introduce base box to avoid duplication * implement lazy box test * expose sentry hive and updata documentation * add hive to flutter example app * test throwing in base_box, cleanup * test lazy box error cases * test sentry hive impl failures * run fix & format * fix test failure race condition * add hive workflow, update other workflows * add changelog entry * remove path+provider from dev_dependencies * add coverage dev dependency * fix deprecation warnings * fix changelog * move span wrapping on own class to avoid duplication * add sentry box collection * test added spans, fix imports * test throwing code * fix changelog * change dbSystem value * change db system * remove unneccessary async & await * Fix analyze * Formatting * Add changelog symlink * Ignore hive coverage * Create symlink for dartdoc_options --------- Co-authored-by: Giancarlo Buenaflor <[email protected]>
1 parent 3e5078c commit 7748b7c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+3441
-1600
lines changed

.craft.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ targets:
1111
dio:
1212
file:
1313
sqflite:
14+
hive:
1415
drift:
1516
- name: github
1617
- name: registry
@@ -21,5 +22,6 @@ targets:
2122
pub:sentry_dio:
2223
pub:sentry_file:
2324
pub:sentry_sqflite:
24-
# This needs to be published on pub.dev first before uncommenting
25+
# Initial release on pub.dev needed first before uncommenting
2526
# pub:sentry_drift:
27+
# pub:sentry_hive:

.github/workflows/dart.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ on:
1111
- "dio/**"
1212
- "file/**"
1313
- "sqflite/**"
14+
- "hive/**"
1415
- "drift/**"
1516

1617
jobs:

.github/workflows/diagrams.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,10 @@ jobs:
4343
working-directory: ./logging
4444
run: lakos . -i "{test/**,example/**}" | dot -Tsvg -o class-diagram.svg
4545

46+
- name: hive
47+
working-directory: ./hive
48+
run: lakos . -i "{test/**,example/**}" | dot -Tsvg -o class-diagram.svg
49+
4650
# Source: https://stackoverflow.com/a/58035262
4751
- name: Extract branch name
4852
shell: bash

.github/workflows/dio.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ on:
1111
- "flutter/**"
1212
- "file/**"
1313
- "sqflite/**"
14+
- "hive/**"
1415
- "drift/**"
1516

1617
jobs:

.github/workflows/e2e_dart.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ on:
1212
- "flutter/**"
1313
- "file/**"
1414
- "sqflite/**"
15+
- "hive/**"
1516
- "drift/**"
1617

1718
env:

.github/workflows/file.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ on:
1111
- "flutter/**"
1212
- "dio/**"
1313
- "sqflite/**"
14+
- "hive/**"
1415
- "drift/**"
1516

1617
jobs:

.github/workflows/flutter.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ on:
1111
- "dio/**"
1212
- "file/**"
1313
- "sqflite/**"
14+
- "hive/**"
1415
- "drift/**"
1516

1617
jobs:

.github/workflows/hive.yml

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
name: sentry-hive
2+
on:
3+
push:
4+
branches:
5+
- main
6+
- release/**
7+
pull_request:
8+
paths-ignore:
9+
- "**/*.md"
10+
- "logging/**"
11+
- "flutter/**"
12+
- "dio/**"
13+
- "file/**"
14+
- "sqflite/**"
15+
16+
jobs:
17+
cancel-previous-workflow:
18+
runs-on: ubuntu-latest
19+
steps:
20+
- name: Cancel Previous Runs
21+
uses: styfle/cancel-workflow-action@b173b6ec0100793626c2d9e6b90435061f4fc3e5 # [email protected]
22+
with:
23+
access_token: ${{ github.token }}
24+
25+
build:
26+
name: Build ${{matrix.sdk}} on ${{matrix.os}}
27+
runs-on: ${{ matrix.os }}
28+
timeout-minutes: 30
29+
defaults:
30+
run:
31+
shell: bash
32+
working-directory: ./hive
33+
strategy:
34+
fail-fast: false
35+
matrix:
36+
os: [ubuntu-latest, windows-latest, macos-latest]
37+
sdk: [stable, beta]
38+
exclude:
39+
- os: windows-latest
40+
sdk: beta
41+
- os: macos-latest
42+
sdk: beta
43+
steps:
44+
- uses: dart-lang/setup-dart@6a218f2413a3e78e9087f638a238f6b40893203d # pin@v1
45+
with:
46+
sdk: ${{ matrix.sdk }}
47+
- uses: actions/checkout@v3
48+
49+
- name: Test VM
50+
run: |
51+
dart pub get
52+
dart test -p vm --coverage=coverage --test-randomize-ordering-seed=random --chain-stack-traces
53+
dart pub run coverage:format_coverage --lcov --in=coverage --out=coverage/lcov.info --packages=.dart_tool/package_config.json --report-on=lib
54+
55+
- uses: codecov/codecov-action@d9f34f8cd5cb3b3eb79b3e4b5dae3a16df499a70 # pin@v3
56+
if: runner.os == 'Linux' && matrix.sdk == 'stable'
57+
with:
58+
name: sentry_hive
59+
files: ./hive/coverage/lcov.info
60+
61+
- uses: VeryGoodOpenSource/very_good_coverage@e5c91bc7ce9843e87c800b3bcafdfb86fbe28491 # [email protected]
62+
if: runner.os == 'Linux' && matrix.sdk == 'stable'
63+
with:
64+
path: "./hive/coverage/lcov.info"
65+
min_coverage: 55
66+
67+
analyze:
68+
uses: ./.github/workflows/analyze.yml
69+
with:
70+
package: hive
71+
panaThreshold: 90

.github/workflows/logging.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ on:
1111
- "flutter/**"
1212
- "file/**"
1313
- "sqflite/**"
14+
- "hive/**"
1415
- "drift/**"
1516

1617
jobs:

.github/workflows/min_version_test.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ on:
99
- "**/*.md"
1010
- "file/**"
1111
- "sqflite/**"
12+
- "hive/**"
1213
- "drift/**"
1314

1415
jobs:

.github/workflows/sqflite.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ on:
1111
- "flutter/**"
1212
- "dio/**"
1313
- "file/**"
14+
- "hive/**"
1415
- "drift/**"
1516

1617
jobs:

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ file/coverage/*
2323
flutter/coverage/*
2424
sqflite/coverage/*
2525
drift/coverage/*
26+
hive/coverage/*
2627

2728
pubspec.lock
2829
Podfile.lock

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
- Add APM integration for Drift ([#1709](https://github.com/getsentry/sentry-dart/pull/1709))
1515
- StackTraces in `PlatformException.message` will get nicely formatted too when present ([#1716](https://github.com/getsentry/sentry-dart/pull/1716))
1616
- Breadcrumbs for database operations ([#1656](https://github.com/getsentry/sentry-dart/pull/1656))
17+
- APM for hive ([#1672](https://github.com/getsentry/sentry-dart/pull/1672))
1718
- Add `attachScreenshotOnlyWhenResumed` to options ([#1700](https://github.com/getsentry/sentry-dart/pull/1700))
1819

1920
### Dependencies

dart/lib/src/sentry_trace_origins.dart

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@ class SentryTraceOrigins {
1818
'auto.db.sqflite.database_executor';
1919
static const autoDbSqfliteDatabaseFactory =
2020
'auto.db.sqflite.database_factory';
21+
static const autoDbHive = 'auto.db.hive';
22+
static const autoDbHiveBoxBase = 'auto.db.hive.box_base';
23+
static const autoDbHiveLazyBox = 'auto.db.hive.lazy_box';
24+
static const autoDbHiveBoxCollection = 'auto.db.hive.box_collection';
2125
static const autoDbDriftQueryExecutor = 'auto.db.drift.query.executor';
2226
static const autoDbDriftTransactionExecutor =
2327
'auto.db.drift.transaction.executor';

0 commit comments

Comments
 (0)