Skip to content

Commit

Permalink
Merge branch 'main' into feat/refactor-android-sqlite-instrumentation
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanosiano authored May 29, 2023
2 parents ae7deca + f1e4d4c commit ae287d1
Show file tree
Hide file tree
Showing 82 changed files with 3,138 additions and 253 deletions.
39 changes: 30 additions & 9 deletions .github/workflows/agp-matrix.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: AGP Matrix Sample Release
name: AGP Matrix Compatibility

on:
push:
Expand All @@ -16,29 +16,50 @@ jobs:
with:
access_token: ${{ github.token }}

agp-matrix-sample-release:
runs-on: ubuntu-latest
agp-matrix-compatibility:
timeout-minutes: 25
runs-on: macos-latest
strategy:
fail-fast: false
matrix:
agp: ['8.0.0-rc01','8.1.0-alpha11']
agp: [ '8.0.0','8.1.0-alpha11' ]
ndk: [ true, false ]

name: AGP Matrix Sample Release - AGP ${{ matrix.agp }}
name: AGP Matrix Release - AGP ${{ matrix.agp }} - NDK ${{ matrix.ndk }}
env:
VERSION_AGP: ${{ matrix.agp }}
APPLY_NDK: ${{ matrix.ndk }}

steps:
- name: Checkout Repo
uses: actions/checkout@v3

- name: Setup Gradle
uses: gradle/gradle-build-action@749f47bda3e44aa060e82d7b3ef7e40d953bd629 # pin@v2

- name: Setup Java Version
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '17'

- name: Build the Release variant
uses: gradle/gradle-build-action@749f47bda3e44aa060e82d7b3ef7e40d953bd629 # pin@v2
# Clean, build and release a test apk
- name: Make assembleUiTests
run: make assembleUiTests

# We stop gradle at the end to make sure the cache folders
# don't contain any lock files and are free to be cached.
- name: Make stop
run: make stop

- name: Run instrumentation tests
uses: reactivecircus/android-emulator-runner@d94c3fbe4fe6a29e4a5ba47c12fb47677c73656b # pin@v2
with:
cache-read-only: ${{ github.ref != 'refs/heads/main' }}
arguments: sentry-android-integration-tests:sentry-test-agp:assembleRelease
api-level: 30
force-avd-creation: false
emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
disable-animations: true
disable-spellchecker: true
target: 'aosp_atd'
channel: canary # Necessary for ATDs
script: ./gradlew sentry-android-integration-tests:sentry-uitest-android:connectedReleaseAndroidTest -DtestBuildType=release --daemon
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,6 @@ jobs:
- name: Upload coverage to Codecov
# We need coverage data from only one the builds
if: runner.os == 'Linux' && matrix.java == '17'
uses: codecov/codecov-action@894ff025c7b54547a9a2a1e9f228beae737ad3c2 # pin@v3
uses: codecov/codecov-action@eaaf4bedf32dbdc6b720b63067d99c4d77d6047d # pin@v3
with:
name: sentry-java
4 changes: 2 additions & 2 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,12 @@ jobs:
${{ runner.os }}-gradle-
- name: Initialize CodeQL
uses: github/codeql-action/init@29b1f65c5e92e24fe6b6647da1eaabe529cec70f # pin@v2
uses: github/codeql-action/init@0225834cc549ee0ca93cb085b92954821a145866 # pin@v2
with:
languages: ${{ matrix.language }}

- run: |
./gradlew assemble
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@29b1f65c5e92e24fe6b6647da1eaabe529cec70f # pin@v2
uses: github/codeql-action/analyze@0225834cc549ee0ca93cb085b92954821a145866 # pin@v2
2 changes: 1 addition & 1 deletion .github/workflows/generate-javadocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
run: |
./gradlew aggregateJavadocs
- name: Deploy
uses: JamesIves/github-pages-deploy-action@ba1486788b0490a235422264426c45848eac35c6 # [email protected].1
uses: JamesIves/github-pages-deploy-action@22a6ee251d6f13c6ab1ecb200d974f1a6feb1b8d # [email protected].2
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BRANCH: gh-pages
Expand Down
11 changes: 10 additions & 1 deletion .github/workflows/integration-tests-ui.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: 'Integration Tests - Ui tests'
name: 'Integration Tests'
on:
push:
branches:
Expand All @@ -7,6 +7,14 @@ on:
pull_request:

jobs:
cancel-previous-workflow:
runs-on: ubuntu-latest
steps:
- name: Cancel Previous Runs
uses: styfle/cancel-workflow-action@b173b6ec0100793626c2d9e6b90435061f4fc3e5 # [email protected]
with:
access_token: ${{ github.token }}

test:
name: Ui tests
runs-on: ubuntu-latest
Expand Down Expand Up @@ -43,3 +51,4 @@ jobs:
sauce-access-key: ${{ secrets.SAUCE_ACCESS_KEY }}
config-file: .sauce/sentry-uitest-android-ui.yml
if: env.SAUCE_USERNAME != null

2 changes: 1 addition & 1 deletion .sauce/sentry-uitest-android-benchmark-lite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ sauce:
region: us-west-1
concurrency: 2
metadata:
name: Android benchmarks with Espresso
build: sentry-uitest-android-benchmark-lite-$CI_COMMIT_SHORT_SHA
tags:
- benchmarks
- android
Expand Down
2 changes: 1 addition & 1 deletion .sauce/sentry-uitest-android-benchmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ sauce:
region: us-west-1
concurrency: 2
metadata:
name: Android benchmarks with Espresso
build: sentry-uitest-android-benchmark-$CI_COMMIT_SHORT_SHA
tags:
- benchmarks
- android
Expand Down
2 changes: 1 addition & 1 deletion .sauce/sentry-uitest-android-ui.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ sauce:
# Controls how many suites are executed at the same time (sauce test env only).
concurrency: 1
metadata:
name: Android end2end tests with Espresso
build: sentry-uitest-android-ui@$CI_COMMIT_SHORT_SHA
tags:
- e2e
- android
Expand Down
46 changes: 46 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,44 @@
### Features

- Refactor android sqlite instrumentation (SDK side) ([#2722](https://github.com/getsentry/sentry-java/pull/2722))
- Add SentryWrapper for Callable and Supplier Interface ([#2720](https://github.com/getsentry/sentry-java/pull/2720))

## 6.20.0

### Features

- Add support for Sentry Kotlin Compiler Plugin ([#2695](https://github.com/getsentry/sentry-java/pull/2695))
- In conjunction with our sentry-kotlin-compiler-plugin we improved Jetpack Compose support for
- [View Hierarchy](https://docs.sentry.io/platforms/android/enriching-events/viewhierarchy/) support for Jetpack Compose screens
- Automatic breadcrumbs for [user interactions](https://docs.sentry.io/platforms/android/performance/instrumentation/automatic-instrumentation/#user-interaction-instrumentation)
- More granular http requests instrumentation with a new SentryOkHttpEventListener ([#2659](https://github.com/getsentry/sentry-java/pull/2659))
- Create spans for time spent on:
- Proxy selection
- DNS resolution
- HTTPS setup
- Connection
- Requesting headers
- Receiving response
- You can attach the event listener to your OkHttpClient through `client.eventListener(new SentryOkHttpEventListener()).addInterceptor(new SentryOkHttpInterceptor()).build();`
- In case you already have an event listener you can use the SentryOkHttpEventListener as well through `client.eventListener(new SentryOkHttpEventListener(myListener)).addInterceptor(new SentryOkHttpInterceptor()).build();`
- Add a new option to disable `RootChecker` ([#2735](https://github.com/getsentry/sentry-java/pull/2735))

### Fixes

- Base64 encode internal Apollo3 Headers ([#2707](https://github.com/getsentry/sentry-java/pull/2707))
- Fix `SentryTracer` crash when scheduling auto-finish of a transaction, but the timer has already been cancelled ([#2731](https://github.com/getsentry/sentry-java/pull/2731))
- Fix `AndroidTransactionProfiler` crash when finishing a profile that happened due to race condition ([#2731](https://github.com/getsentry/sentry-java/pull/2731))

## 6.19.1

### Fixes

- Ensure screenshots and view hierarchies are captured on the main thread ([#2712](https://github.com/getsentry/sentry-java/pull/2712))

## 6.19.0

### Features

- Add Screenshot and ViewHierarchy to integrations list ([#2698](https://github.com/getsentry/sentry-java/pull/2698))
- New ANR detection based on [ApplicationExitInfo API](https://developer.android.com/reference/android/app/ApplicationExitInfo) ([#2697](https://github.com/getsentry/sentry-java/pull/2697))
- This implementation completely replaces the old one (based on a watchdog) on devices running Android 11 and above:
Expand All @@ -16,17 +54,25 @@
- If you would like us to provide support for the old approach working alongside the new one on Android 11 and above (e.g. for raising events for slow code on main thread), consider upvoting [this issue](https://github.com/getsentry/sentry-java/issues/2693).
- The old watchdog implementation will continue working for older API versions (Android < 11)
- Open up `TransactionOptions`, `ITransaction` and `IHub` methods allowing consumers modify start/end timestamp of transactions and spans ([#2701](https://github.com/getsentry/sentry-java/pull/2701))
- Send source bundle IDs to Sentry to enable source context ([#2663](https://github.com/getsentry/sentry-java/pull/2663))
- For more information on how to enable source context, please refer to [#633](https://github.com/getsentry/sentry-java/issues/633#issuecomment-1465599120)

### Fixes

- Android Profiler on calling thread ([#2691](https://github.com/getsentry/sentry-java/pull/2691))
- Use `configureScope` instead of `withScope` in `Hub.close()`. This ensures that the main scope releases the in-memory data when closing a hub instance. ([#2688](https://github.com/getsentry/sentry-java/pull/2688))
- Remove null keys/values before creating concurrent hashmap in order to avoid NPE ([#2708](https://github.com/getsentry/sentry-java/pull/2708))
- Exclude SentryOptions from R8/ProGuard obfuscation ([#2699](https://github.com/getsentry/sentry-java/pull/2699))
- This fixes AGP 8.+ incompatibility, where full R8 mode is enforced

### Dependencies

- Bump Gradle from v8.1.0 to v8.1.1 ([#2666](https://github.com/getsentry/sentry-java/pull/2666))
- [changelog](https://github.com/gradle/gradle/blob/master release-test/CHANGELOG.md#v811)
- [diff](https://github.com/gradle/gradle/compare/v8.1.0...v8.1.1)
- Bump Native SDK from v0.6.1 to v0.6.2 ([#2689](https://github.com/getsentry/sentry-java/pull/2689))
- [changelog](https://github.com/getsentry/sentry-native/blob/master/CHANGELOG.md#062)
- [diff](https://github.com/getsentry/sentry-native/compare/0.6.1...0.6.2)

## 6.18.1

Expand Down
10 changes: 10 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,16 @@ subprojects {
assignAarTypes()
}

// this is needed for sentry-unity to consume our artifacts locally as proper maven publication
configure<PublishingExtension> {
repositories {
maven {
name = "unityMaven"
url = file("${rootProject.buildDir}/unityMaven").toURI()
}
}
}

// maven central info go to:
// ~/.gradle/gradle.properties

Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ android.useAndroidX=true
android.defaults.buildfeatures.buildconfig=true

# Release information
versionName=6.18.1
versionName=6.20.0

# Override the SDK name on native crashes on Android
sentryAndroidSdkName=sentry.native.android
Expand Down
8 changes: 7 additions & 1 deletion sentry-android-core/api/sentry-android-core.api
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,7 @@ public final class io/sentry/android/core/SentryAndroidOptions : io/sentry/Sentr
public fun enableAllAutoBreadcrumbs (Z)V
public fun getAnrTimeoutIntervalMillis ()J
public fun getDebugImagesLoader ()Lio/sentry/android/core/IDebugImagesLoader;
public fun getNativeSdkName ()Ljava/lang/String;
public fun getProfilingTracesHz ()I
public fun getProfilingTracesIntervalMillis ()I
public fun getStartupCrashDurationThresholdMillis ()J
Expand All @@ -223,6 +224,7 @@ public final class io/sentry/android/core/SentryAndroidOptions : io/sentry/Sentr
public fun isEnableAutoActivityLifecycleTracing ()Z
public fun isEnableFramesTracking ()Z
public fun isEnableNetworkEventBreadcrumbs ()Z
public fun isEnableRootCheck ()Z
public fun isEnableSystemEventBreadcrumbs ()Z
public fun setAnrEnabled (Z)V
public fun setAnrReportInDebug (Z)V
Expand All @@ -238,7 +240,9 @@ public final class io/sentry/android/core/SentryAndroidOptions : io/sentry/Sentr
public fun setEnableAutoActivityLifecycleTracing (Z)V
public fun setEnableFramesTracking (Z)V
public fun setEnableNetworkEventBreadcrumbs (Z)V
public fun setEnableRootCheck (Z)V
public fun setEnableSystemEventBreadcrumbs (Z)V
public fun setNativeSdkName (Ljava/lang/String;)V
public fun setProfilingTracesHz (I)V
public fun setProfilingTracesIntervalMillis (I)V
}
Expand Down Expand Up @@ -315,8 +319,10 @@ public final class io/sentry/android/core/ViewHierarchyEventProcessor : io/sentr
public fun <init> (Lio/sentry/android/core/SentryAndroidOptions;)V
public fun process (Lio/sentry/SentryEvent;Lio/sentry/Hint;)Lio/sentry/SentryEvent;
public static fun snapshotViewHierarchy (Landroid/app/Activity;Lio/sentry/ILogger;)Lio/sentry/protocol/ViewHierarchy;
public static fun snapshotViewHierarchy (Landroid/app/Activity;Ljava/util/List;Lio/sentry/util/thread/IMainThreadChecker;Lio/sentry/ILogger;)Lio/sentry/protocol/ViewHierarchy;
public static fun snapshotViewHierarchy (Landroid/view/View;)Lio/sentry/protocol/ViewHierarchy;
public static fun snapshotViewHierarchyAsData (Landroid/app/Activity;Lio/sentry/ISerializer;Lio/sentry/ILogger;)[B
public static fun snapshotViewHierarchy (Landroid/view/View;Ljava/util/List;)Lio/sentry/protocol/ViewHierarchy;
public static fun snapshotViewHierarchyAsData (Landroid/app/Activity;Lio/sentry/util/thread/IMainThreadChecker;Lio/sentry/ISerializer;Lio/sentry/ILogger;)[B
}

public final class io/sentry/android/core/cache/AndroidEnvelopeCache : io/sentry/cache/EnvelopeCache {
Expand Down
4 changes: 4 additions & 0 deletions sentry-android-core/proguard-rules.pro
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,8 @@
# Keep Classnames for integrations
-keepnames class * implements io.sentry.IntegrationName

# Keep any custom option classes like SentryAndroidOptions, as they're loaded via reflection
# Also keep method names, as they're e.g. used by native via JNI calls
-keep class * extends io.sentry.SentryOptions { *; }

##---------------End: proguard configuration for android-core ----------
Loading

0 comments on commit ae287d1

Please sign in to comment.