Skip to content

Commit

Permalink
Cherry-pick all changes since 7.18.0 (#3944)
Browse files Browse the repository at this point in the history
* Switch to 3 devices (Android 11, 13, 14), Increase timeout (#3897)

Co-authored-by: Stefano <[email protected]>

* Bump github/codeql-action from 3.27.0 to 3.27.5 (#3923)

Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.27.0 to 3.27.5.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](github/codeql-action@6624720...f09c1c0)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump codecov/codecov-action from 4.6.0 to 5.0.7 (#3922)

Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from 4.6.0 to 5.0.7.
- [Release notes](https://github.com/codecov/codecov-action/releases)
- [Changelog](https://github.com/codecov/codecov-action/blob/main/CHANGELOG.md)
- [Commits](codecov/codecov-action@b9fd7d1...015f24e)

---
updated-dependencies:
- dependency-name: codecov/codecov-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump gradle/actions (#3924)

Bumps [gradle/actions](https://github.com/gradle/actions) from 707359876a764dbcdb9da0b0ed08291818310c3d to 4ba34e96c5f6493e99d0696180a9a8d431577ba9.
- [Release notes](https://github.com/gradle/actions/releases)
- [Commits](gradle/actions@7073598...4ba34e9)

---
updated-dependencies:
- dependency-name: gradle/actions
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump JamesIves/github-pages-deploy-action from 4.6.8 to 4.6.9 (#3868)

Bumps [JamesIves/github-pages-deploy-action](https://github.com/jamesives/github-pages-deploy-action) from 4.6.8 to 4.6.9.
- [Release notes](https://github.com/jamesives/github-pages-deploy-action/releases)
- [Commits](JamesIves/github-pages-deploy-action@881db53...62fec3a)

---
updated-dependencies:
- dependency-name: JamesIves/github-pages-deploy-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore: Update PR template (#3909)

Remove I reviewed the code and add updating the wizard because we often forget to update it.

* Fix testTag not working for Jetpack Compose gesture detection (#3878)

* Fix testTag not working in new versions of Jetpack Compose

* Ensure field is accessible

* Update changelog

* Fix use getDeclaredField instead of getField

* add talk on session replay to readme (#3928)

#skip-changelog

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: Stefano <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Philipp Hofmann <[email protected]>
Co-authored-by: Bruno Garcia <[email protected]>
  • Loading branch information
5 people authored Dec 2, 2024
1 parent 429a4da commit 6c080ab
Show file tree
Hide file tree
Showing 16 changed files with 47 additions and 32 deletions.
2 changes: 1 addition & 1 deletion .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@
## :pencil: Checklist
<!--- Put an `x` in the boxes that apply -->

- [ ] I reviewed the submitted code.
- [ ] I added tests to verify the changes.
- [ ] No new PII added or SDK only sends newly added PII if `sendDefaultPII` is enabled.
- [ ] I updated the docs if needed.
- [ ] I updated the wizard if needed.
- [ ] Review from the native team if needed.
- [ ] No breaking change or entry added to the changelog.
- [ ] No breaking change for hybrid SDKs or communicated to hybrid SDKs.
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/agp-matrix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
java-version: '17'

- name: Setup Gradle
uses: gradle/actions/setup-gradle@707359876a764dbcdb9da0b0ed08291818310c3d # pin@v3
uses: gradle/actions/setup-gradle@4ba34e96c5f6493e99d0696180a9a8d431577ba9 # pin@v3
with:
gradle-home-cache-cleanup: true

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,15 @@ jobs:
java-version: '17'

- name: Setup Gradle
uses: gradle/actions/setup-gradle@707359876a764dbcdb9da0b0ed08291818310c3d # pin@v3
uses: gradle/actions/setup-gradle@4ba34e96c5f6493e99d0696180a9a8d431577ba9 # pin@v3
with:
gradle-home-cache-cleanup: true

- name: Run Tests with coverage and Lint
run: make preMerge

- name: Upload coverage to Codecov
uses: codecov/codecov-action@b9fd7d16f6d7d1b5d2bec1a2887e65ceed900238 # pin@v4
uses: codecov/codecov-action@015f24e6818733317a2da2edd6290ab26238649a # pin@v4
with:
name: sentry-java
fail_ci_if_error: false
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,12 @@ jobs:
java-version: '17'

- name: Setup Gradle
uses: gradle/actions/setup-gradle@707359876a764dbcdb9da0b0ed08291818310c3d # pin@v3
uses: gradle/actions/setup-gradle@4ba34e96c5f6493e99d0696180a9a8d431577ba9 # pin@v3
with:
gradle-home-cache-cleanup: true

- name: Initialize CodeQL
uses: github/codeql-action/init@662472033e021d55d94146f66f6058822b0b39fd # pin@v2
uses: github/codeql-action/init@f09c1c0a94de965c15400f5634aa42fac8fb8f88 # pin@v2
with:
languages: ${{ matrix.language }}

Expand All @@ -48,4 +48,4 @@ jobs:
./gradlew buildForCodeQL
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@662472033e021d55d94146f66f6058822b0b39fd # pin@v2
uses: github/codeql-action/analyze@f09c1c0a94de965c15400f5634aa42fac8fb8f88 # pin@v2
2 changes: 1 addition & 1 deletion .github/workflows/enforce-license-compliance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Setup Gradle
uses: gradle/actions/setup-gradle@707359876a764dbcdb9da0b0ed08291818310c3d # pin@v3
uses: gradle/actions/setup-gradle@4ba34e96c5f6493e99d0696180a9a8d431577ba9 # pin@v3
with:
gradle-home-cache-cleanup: true

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/generate-javadocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,15 @@ jobs:
java-version: '17'

- name: Setup Gradle
uses: gradle/actions/setup-gradle@707359876a764dbcdb9da0b0ed08291818310c3d # pin@v3
uses: gradle/actions/setup-gradle@4ba34e96c5f6493e99d0696180a9a8d431577ba9 # pin@v3
with:
gradle-home-cache-cleanup: true

- name: Generate Aggregate Javadocs
run: |
./gradlew aggregateJavadocs
- name: Deploy
uses: JamesIves/github-pages-deploy-action@881db5376404c5c8d621010bcbec0310b58d5e29 # [email protected].8
uses: JamesIves/github-pages-deploy-action@62fec3add6773ec5dbbf18d2ee4260911aa35cf4 # [email protected].9
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BRANCH: gh-pages
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/integration-tests-benchmarks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
java-version: '17'

- name: Setup Gradle
uses: gradle/actions/setup-gradle@707359876a764dbcdb9da0b0ed08291818310c3d # pin@v3
uses: gradle/actions/setup-gradle@4ba34e96c5f6493e99d0696180a9a8d431577ba9 # pin@v3
with:
gradle-home-cache-cleanup: true

Expand Down Expand Up @@ -86,7 +86,7 @@ jobs:
java-version: '17'

- name: Setup Gradle
uses: gradle/actions/setup-gradle@707359876a764dbcdb9da0b0ed08291818310c3d # pin@v3
uses: gradle/actions/setup-gradle@4ba34e96c5f6493e99d0696180a9a8d431577ba9 # pin@v3
with:
gradle-home-cache-cleanup: true

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/integration-tests-ui-critical.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
java-version: '17'

- name: Setup Gradle
uses: gradle/actions/setup-gradle@707359876a764dbcdb9da0b0ed08291818310c3d # pin@v3
uses: gradle/actions/setup-gradle@4ba34e96c5f6493e99d0696180a9a8d431577ba9 # pin@v3
with:
gradle-home-cache-cleanup: true

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/integration-tests-ui.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
java-version: '17'

- name: Setup Gradle
uses: gradle/actions/setup-gradle@707359876a764dbcdb9da0b0ed08291818310c3d # pin@v3
uses: gradle/actions/setup-gradle@4ba34e96c5f6493e99d0696180a9a8d431577ba9 # pin@v3
with:
gradle-home-cache-cleanup: true

Expand All @@ -42,7 +42,7 @@ jobs:
run: make assembleUiTests

- name: Install SauceLabs CLI
uses: saucelabs/saucectl-run-action@39e4f0666ca8ecb4b60847213c6e0fbd6a0c2bd8 # pin@v3
uses: saucelabs/saucectl-run-action@39e4f0666ca8ecb4b60847213c6e0fbd6a0c2bd8 # pin@v4.3.0
env:
GITHUB_TOKEN: ${{ github.token }}
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
java-version: '17'

- name: Setup Gradle
uses: gradle/actions/setup-gradle@707359876a764dbcdb9da0b0ed08291818310c3d # pin@v3
uses: gradle/actions/setup-gradle@4ba34e96c5f6493e99d0696180a9a8d431577ba9 # pin@v3
with:
gradle-home-cache-cleanup: true

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/system-tests-backend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ jobs:
java-version: '17'

- name: Setup Gradle
uses: gradle/actions/setup-gradle@707359876a764dbcdb9da0b0ed08291818310c3d # pin@v3
uses: gradle/actions/setup-gradle@4ba34e96c5f6493e99d0696180a9a8d431577ba9 # pin@v3
with:
gradle-home-cache-cleanup: true

Expand Down
20 changes: 6 additions & 14 deletions .sauce/sentry-uitest-android-ui.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,45 +11,37 @@ sauce:
- android

defaults:
timeout: 40m
timeout: 45m

espresso:
app: ./sentry-android-integration-tests/sentry-uitest-android/build/outputs/apk/release/sentry-uitest-android-release.apk
testApp: ./sentry-android-integration-tests/sentry-uitest-android/build/outputs/apk/androidTest/release/sentry-uitest-android-release-androidTest.apk
suites:

- name: "Android 13 Ui test (api 33)"
- name: "Android 14 Ui test (api 34)"
testOptions:
clearPackageData: true
useTestOrchestrator: true
devices:
- name: ".*"
platformVersion: "13"
platformVersion: "14"

- name: "Android 12 Ui test (api 31)"
- name: "Android 13 Ui test (api 33)"
testOptions:
clearPackageData: true
useTestOrchestrator: true
devices:
- name: ".*"
platformVersion: "12"
platformVersion: "13"

- name: "Android 11 Ui test (api 30)"
- name: "Android 11 Ui test (api 31)"
testOptions:
clearPackageData: true
useTestOrchestrator: true
devices:
- name: ".*"
platformVersion: "11"

- name: "Android 10 Ui test (api 29)"
testOptions:
clearPackageData: true
useTestOrchestrator: true
devices:
- name: ".*"
platformVersion: "10"

# Controls what artifacts to fetch when the suite on Sauce Cloud has finished.
artifacts:
download:
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@

- Bump OpenTelemetry to 1.44.1, OpenTelemetry Java Agent to 2.10.0 and Semantic Conventions to 1.28.0 ([#3935](https://github.com/getsentry/sentry-java/pull/3935))

### Fixes

- Fix testTag not working for Jetpack Compose user interaction tracking ([#3878](https://github.com/getsentry/sentry-java/pull/3878))

## 8.0.0-beta.3

### Features
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ This repo uses the following ways to release SDK updates:

# Useful links and docs

* A deep dive into how we built [Session Replay for Android](https://www.droidcon.com/2024/11/22/rewind-and-resolve-a-deep-dive-into-building-session-replay-for-android/) at Droidcon London 2024.
* Current Javadocs [generated from source code](https://getsentry.github.io/sentry-java/).
* Java SDK version 1.x [can still be found here](https://docs.sentry.io/clients/java/).
* Migration page from [sentry-android 1.x and 2.x to sentry-android 4.x](https://docs.sentry.io/platforms/android/migration/).
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package io.sentry.compose.gestures;

import androidx.compose.ui.Modifier;
import androidx.compose.ui.geometry.Rect;
import androidx.compose.ui.layout.ModifierInfo;
import androidx.compose.ui.node.LayoutNode;
Expand All @@ -15,6 +16,7 @@
import io.sentry.internal.gestures.GestureTargetLocator;
import io.sentry.internal.gestures.UiElement;
import io.sentry.util.AutoClosableReentrantLock;
import java.lang.reflect.Field;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
Expand Down Expand Up @@ -93,13 +95,28 @@ public ComposeGestureTargetLocator(final @NotNull ILogger logger) {
}
}
} else {
final @NotNull Modifier modifier = modifierInfo.getModifier();
// Newer Jetpack Compose 1.5 uses Node modifiers for clicks/scrolls
final @Nullable String type = modifierInfo.getModifier().getClass().getCanonicalName();
final @Nullable String type = modifier.getClass().getCanonicalName();
if ("androidx.compose.foundation.ClickableElement".equals(type)
|| "androidx.compose.foundation.CombinedClickableElement".equals(type)) {
isClickable = true;
} else if ("androidx.compose.foundation.ScrollingLayoutElement".equals(type)) {
isScrollable = true;
} else if ("androidx.compose.ui.platform.TestTagElement".equals(type)) {
// Newer Jetpack Compose uses TestTagElement as node elements
// See
// https://cs.android.com/androidx/platform/frameworks/support/+/androidx-main:compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/platform/TestTag.kt;l=34;drc=dcaa116fbfda77e64a319e1668056ce3b032469f
try {
final Field tagField = modifier.getClass().getDeclaredField("tag");
tagField.setAccessible(true);
final @Nullable Object value = tagField.get(modifier);
if (value instanceof String) {
lastKnownTag = (String) value;
}
} catch (Throwable e) {
// ignored
}
}
}
}
Expand Down
1 change: 1 addition & 0 deletions sentry-compose/proguard-rules.pro
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
-keepnames class androidx.compose.foundation.ClickableElement
-keepnames class androidx.compose.foundation.CombinedClickableElement
-keepnames class androidx.compose.foundation.ScrollingLayoutElement
-keepnames class androidx.compose.ui.platform.TestTagElement { *; }

# R8 will warn about missing classes if people don't have androidx.compose-navigation on their
# classpath, but this is fine, these classes are used in an internal class which is only used when
Expand Down

0 comments on commit 6c080ab

Please sign in to comment.