Skip to content

Commit eb9b830

Browse files
committed
Merge branch '8.x.x' into feat/potel-unit-testing
2 parents 135e1f0 + e5e4336 commit eb9b830

197 files changed

Lines changed: 4289 additions & 579 deletions

File tree

Some content is hidden

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

.github/file-filters.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# This is used by the action https://github.com/dorny/paths-filter
2+
3+
high_risk_code: &high_risk_code
4+
# Transport classes
5+
- "sentry/src/main/java/io/sentry/transport/AsyncHttpTransport.java"
6+
- "sentry/src/main/java/io/sentry/transport/HttpConnection.java"
7+
- "sentry/src/main/java/io/sentry/transport/QueuedThreadPoolExecutor.java"
8+
- "sentry/src/main/java/io/sentry/transport/RateLimiter.java"
9+
- "sentry-apache-http-client-5/src/main/java/io/sentry/transport/apache/ApacheHttpClientTransport.java"
10+
11+
# Class used by hybrid SDKs
12+
- "sentry-android-core/src/main/java/io/sentry/android/core/InternalSentrySdk.java"

.github/workflows/agp-matrix.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ jobs:
3838
java-version: '17'
3939

4040
- name: Setup Gradle
41-
uses: gradle/actions/setup-gradle@0d30c9111cf47a838eb69c06d13f3f51ab2ed76f # pin@v3
41+
uses: gradle/actions/setup-gradle@bb0c460cbf5354b0cddd15bacdf0d6aaa3e5a32b # pin@v3
4242
with:
4343
gradle-home-cache-cleanup: true
4444

@@ -59,7 +59,7 @@ jobs:
5959

6060
# We tried to use the cache action to cache gradle stuff, but it made tests slower and timeout
6161
- name: Run instrumentation tests
62-
uses: reactivecircus/android-emulator-runner@f0d1ed2dcad93c7479e8b2f2226c83af54494915 # pin@v2
62+
uses: reactivecircus/android-emulator-runner@62dbb605bba737720e10b196cb4220d374026a6d # pin@v2
6363
with:
6464
api-level: 30
6565
force-avd-creation: false

.github/workflows/build.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,15 @@ jobs:
2727
java-version: '17'
2828

2929
- name: Setup Gradle
30-
uses: gradle/actions/setup-gradle@0d30c9111cf47a838eb69c06d13f3f51ab2ed76f # pin@v3
30+
uses: gradle/actions/setup-gradle@bb0c460cbf5354b0cddd15bacdf0d6aaa3e5a32b # pin@v3
3131
with:
3232
gradle-home-cache-cleanup: true
3333

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

3737
- name: Upload coverage to Codecov
38-
uses: codecov/codecov-action@e28ff129e5465c2c0dcc6f003fc735cb6ae0c673 # pin@v4
38+
uses: codecov/codecov-action@b9fd7d16f6d7d1b5d2bec1a2887e65ceed900238 # pin@v4
3939
with:
4040
name: sentry-java
4141
fail_ci_if_error: false
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Changes In High Risk Code
2+
on:
3+
pull_request:
4+
5+
# https://docs.github.com/en/actions/using-jobs/using-concurrency#example-using-a-fallback-value
6+
concurrency:
7+
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
8+
cancel-in-progress: true
9+
10+
jobs:
11+
files-changed:
12+
name: Detect changed files
13+
runs-on: ubuntu-latest
14+
# Map a step output to a job output
15+
outputs:
16+
high_risk_code: ${{ steps.changes.outputs.high_risk_code }}
17+
high_risk_code_files: ${{ steps.changes.outputs.high_risk_code_files }}
18+
steps:
19+
- uses: actions/checkout@v4
20+
- name: Get changed files
21+
id: changes
22+
uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2
23+
with:
24+
token: ${{ github.token }}
25+
filters: .github/file-filters.yml
26+
27+
# Enable listing of files matching each filter.
28+
# Paths to files will be available in `${FILTER_NAME}_files` output variable.
29+
list-files: csv
30+
31+
validate-high-risk-code:
32+
if: needs.files-changed.outputs.high_risk_code == 'true'
33+
needs: files-changed
34+
runs-on: ubuntu-latest
35+
steps:
36+
- name: Comment on PR to notify of changes in high risk files
37+
uses: actions/github-script@v7
38+
env:
39+
high_risk_code: ${{ needs.files-changed.outputs.high_risk_code_files }}
40+
with:
41+
script: |
42+
const highRiskFiles = process.env.high_risk_code;
43+
const fileList = highRiskFiles.split(',').map(file => `- [ ] ${file}`).join('\n');
44+
github.rest.issues.createComment({
45+
issue_number: context.issue.number,
46+
owner: context.repo.owner,
47+
repo: context.repo.repo,
48+
body: `### 🚨 Detected changes in high risk code 🚨 \n High-risk code has higher potential to break the SDK and may be hard to test. To prevent severe bugs, apply the rollout process for releasing such changes and be extra careful when changing and reviewing these files:\n ${fileList}`
49+
})

.github/workflows/codeql-analysis.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,12 @@ jobs:
3434
java-version: '17'
3535

3636
- name: Setup Gradle
37-
uses: gradle/actions/setup-gradle@0d30c9111cf47a838eb69c06d13f3f51ab2ed76f # pin@v3
37+
uses: gradle/actions/setup-gradle@bb0c460cbf5354b0cddd15bacdf0d6aaa3e5a32b # pin@v3
3838
with:
3939
gradle-home-cache-cleanup: true
4040

4141
- name: Initialize CodeQL
42-
uses: github/codeql-action/init@294a9d92911152fe08befb9ec03e240add280cb3 # pin@v2
42+
uses: github/codeql-action/init@662472033e021d55d94146f66f6058822b0b39fd # pin@v2
4343
with:
4444
languages: ${{ matrix.language }}
4545

@@ -48,4 +48,4 @@ jobs:
4848
./gradlew buildForCodeQL
4949
5050
- name: Perform CodeQL Analysis
51-
uses: github/codeql-action/analyze@294a9d92911152fe08befb9ec03e240add280cb3 # pin@v2
51+
uses: github/codeql-action/analyze@662472033e021d55d94146f66f6058822b0b39fd # pin@v2

.github/workflows/enforce-license-compliance.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
runs-on: ubuntu-latest
1212
steps:
1313
- name: Setup Gradle
14-
uses: gradle/actions/setup-gradle@0d30c9111cf47a838eb69c06d13f3f51ab2ed76f # pin@v3
14+
uses: gradle/actions/setup-gradle@bb0c460cbf5354b0cddd15bacdf0d6aaa3e5a32b # pin@v3
1515
with:
1616
gradle-home-cache-cleanup: true
1717

.github/workflows/generate-javadocs.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,15 @@ jobs:
2020
java-version: '17'
2121

2222
- name: Setup Gradle
23-
uses: gradle/actions/setup-gradle@0d30c9111cf47a838eb69c06d13f3f51ab2ed76f # pin@v3
23+
uses: gradle/actions/setup-gradle@bb0c460cbf5354b0cddd15bacdf0d6aaa3e5a32b # pin@v3
2424
with:
2525
gradle-home-cache-cleanup: true
2626

2727
- name: Generate Aggregate Javadocs
2828
run: |
2929
./gradlew aggregateJavadocs
3030
- name: Deploy
31-
uses: JamesIves/github-pages-deploy-action@920cbb300dcd3f0568dbc42700c61e2fd9e6139c # pin@4.6.4
31+
uses: JamesIves/github-pages-deploy-action@881db5376404c5c8d621010bcbec0310b58d5e29 # pin@4.6.8
3232
with:
3333
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3434
BRANCH: gh-pages

.github/workflows/integration-tests-benchmarks.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ jobs:
3737
java-version: '17'
3838

3939
- name: Setup Gradle
40-
uses: gradle/actions/setup-gradle@0d30c9111cf47a838eb69c06d13f3f51ab2ed76f # pin@v3
40+
uses: gradle/actions/setup-gradle@bb0c460cbf5354b0cddd15bacdf0d6aaa3e5a32b # pin@v3
4141
with:
4242
gradle-home-cache-cleanup: true
4343

@@ -86,7 +86,7 @@ jobs:
8686
java-version: '17'
8787

8888
- name: Setup Gradle
89-
uses: gradle/actions/setup-gradle@0d30c9111cf47a838eb69c06d13f3f51ab2ed76f # pin@v3
89+
uses: gradle/actions/setup-gradle@bb0c460cbf5354b0cddd15bacdf0d6aaa3e5a32b # pin@v3
9090
with:
9191
gradle-home-cache-cleanup: true
9292

Lines changed: 128 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,128 @@
1+
name: UI Tests Critical
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
9+
concurrency:
10+
group: ${{ github.workflow }}-${{ github.ref }}
11+
cancel-in-progress: true
12+
13+
env:
14+
BASE_PATH: "sentry-android-integration-tests/sentry-uitest-android-critical"
15+
BUILD_PATH: "build/outputs/apk/release"
16+
APK_NAME: "sentry-uitest-android-critical-release.apk"
17+
APK_ARTIFACT_NAME: "sentry-uitest-android-critical-release"
18+
MAESTRO_VERSION: "1.39.0"
19+
20+
jobs:
21+
build:
22+
name: Build
23+
runs-on: ubuntu-latest
24+
steps:
25+
- name: Checkout code
26+
uses: actions/checkout@v4
27+
28+
- name: Set up Java 17
29+
uses: actions/setup-java@v4
30+
with:
31+
distribution: 'temurin'
32+
java-version: '17'
33+
34+
- name: Setup Gradle
35+
uses: gradle/actions/setup-gradle@bb0c460cbf5354b0cddd15bacdf0d6aaa3e5a32b # pin@v3
36+
with:
37+
gradle-home-cache-cleanup: true
38+
39+
- name: Build debug APK
40+
run: make assembleUiTestCriticalRelease
41+
42+
- name: Upload APK artifact
43+
uses: actions/upload-artifact@v4
44+
with:
45+
name: ${{env.APK_ARTIFACT_NAME}}
46+
path: "${{env.BASE_PATH}}/${{env.BUILD_PATH}}/${{env.APK_NAME}}"
47+
retention-days: 1
48+
49+
run-maestro-tests:
50+
name: Run Tests for API Level ${{ matrix.api-level }}
51+
needs: build
52+
runs-on: ubuntu-latest
53+
strategy:
54+
# we want that the matrix keeps running, default is to cancel them if it fails.
55+
fail-fast: false
56+
matrix:
57+
include:
58+
- api-level: 30 # Android 11
59+
target: aosp_atd
60+
channel: canary # Necessary for ATDs
61+
arch: x86_64
62+
- api-level: 31 # Android 12
63+
target: aosp_atd
64+
channel: canary # Necessary for ATDs
65+
arch: x86_64
66+
- api-level: 33 # Android 13
67+
target: aosp_atd
68+
channel: canary # Necessary for ATDs
69+
arch: x86_64
70+
- api-level: 34 # Android 14
71+
target: aosp_atd
72+
channel: canary # Necessary for ATDs
73+
arch: x86_64
74+
steps:
75+
- name: Checkout code
76+
uses: actions/checkout@v4
77+
78+
- name: Setup KVM
79+
shell: bash
80+
run: |
81+
# check if virtualization is supported...
82+
sudo apt install -y --no-install-recommends cpu-checker coreutils && echo "CPUs=$(nproc --all)" && kvm-ok
83+
# allow access to KVM to run the emulator
84+
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' \
85+
| sudo tee /etc/udev/rules.d/99-kvm4all.rules
86+
sudo udevadm control --reload-rules
87+
sudo udevadm trigger --name-match=kvm
88+
89+
- name: Download APK artifact
90+
uses: actions/download-artifact@v4
91+
with:
92+
name: ${{env.APK_ARTIFACT_NAME}}
93+
94+
- name: Install Maestro
95+
uses: dniHze/maestro-test-action@bda8a93211c86d0a05b7a4597c5ad134566fbde4 # pin@v1.0.0
96+
with:
97+
version: ${{env.MAESTRO_VERSION}}
98+
99+
- name: Run tests
100+
uses: reactivecircus/android-emulator-runner@62dbb605bba737720e10b196cb4220d374026a6d # pin@v2.33.0
101+
with:
102+
api-level: ${{ matrix.api-level }}
103+
force-avd-creation: false
104+
disable-animations: true
105+
disable-spellchecker: true
106+
target: ${{ matrix.target }}
107+
channel: ${{ matrix.channel }}
108+
arch: ${{ matrix.arch }}
109+
emulator-options: >
110+
-no-window
111+
-no-snapshot-save
112+
-gpu swiftshader_indirect
113+
-noaudio
114+
-no-boot-anim
115+
-camera-back none
116+
-camera-front none
117+
-timezone US/Pacific
118+
script: |
119+
adb install -r -d "${{env.APK_NAME}}"
120+
maestro test "${{env.BASE_PATH}}/maestro" --debug-output "${{env.BASE_PATH}}/maestro-logs"
121+
122+
- name: Upload Maestro test results
123+
if: failure()
124+
uses: actions/upload-artifact@v4
125+
with:
126+
name: maestro-logs
127+
path: "${{env.BASE_PATH}}/maestro-logs"
128+
retention-days: 1

.github/workflows/integration-tests-ui.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
java-version: '17'
3333

3434
- name: Setup Gradle
35-
uses: gradle/actions/setup-gradle@0d30c9111cf47a838eb69c06d13f3f51ab2ed76f # pin@v3
35+
uses: gradle/actions/setup-gradle@bb0c460cbf5354b0cddd15bacdf0d6aaa3e5a32b # pin@v3
3636
with:
3737
gradle-home-cache-cleanup: true
3838

0 commit comments

Comments
 (0)