Skip to content

Commit

Permalink
Merge main into 8.x.x with most recent release being 7.16.0 (#3838
Browse files Browse the repository at this point in the history
)

* merge

* remove empty files
  • Loading branch information
adinauer authored Nov 8, 2024
1 parent f11d784 commit e5e4336
Show file tree
Hide file tree
Showing 93 changed files with 1,472 additions and 187 deletions.
12 changes: 12 additions & 0 deletions .github/file-filters.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# This is used by the action https://github.com/dorny/paths-filter

high_risk_code: &high_risk_code
# Transport classes
- "sentry/src/main/java/io/sentry/transport/AsyncHttpTransport.java"
- "sentry/src/main/java/io/sentry/transport/HttpConnection.java"
- "sentry/src/main/java/io/sentry/transport/QueuedThreadPoolExecutor.java"
- "sentry/src/main/java/io/sentry/transport/RateLimiter.java"
- "sentry-apache-http-client-5/src/main/java/io/sentry/transport/apache/ApacheHttpClientTransport.java"

# Class used by hybrid SDKs
- "sentry-android-core/src/main/java/io/sentry/android/core/InternalSentrySdk.java"
4 changes: 2 additions & 2 deletions .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@0d30c9111cf47a838eb69c06d13f3f51ab2ed76f # pin@v3
uses: gradle/actions/setup-gradle@bb0c460cbf5354b0cddd15bacdf0d6aaa3e5a32b # pin@v3
with:
gradle-home-cache-cleanup: true

Expand All @@ -59,7 +59,7 @@ jobs:

# We tried to use the cache action to cache gradle stuff, but it made tests slower and timeout
- name: Run instrumentation tests
uses: reactivecircus/android-emulator-runner@f0d1ed2dcad93c7479e8b2f2226c83af54494915 # pin@v2
uses: reactivecircus/android-emulator-runner@62dbb605bba737720e10b196cb4220d374026a6d # pin@v2
with:
api-level: 30
force-avd-creation: false
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@0d30c9111cf47a838eb69c06d13f3f51ab2ed76f # pin@v3
uses: gradle/actions/setup-gradle@bb0c460cbf5354b0cddd15bacdf0d6aaa3e5a32b # 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@e28ff129e5465c2c0dcc6f003fc735cb6ae0c673 # pin@v4
uses: codecov/codecov-action@b9fd7d16f6d7d1b5d2bec1a2887e65ceed900238 # pin@v4
with:
name: sentry-java
fail_ci_if_error: false
Expand Down
49 changes: 49 additions & 0 deletions .github/workflows/changes-in-high-risk-code.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Changes In High Risk Code
on:
pull_request:

# https://docs.github.com/en/actions/using-jobs/using-concurrency#example-using-a-fallback-value
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

jobs:
files-changed:
name: Detect changed files
runs-on: ubuntu-latest
# Map a step output to a job output
outputs:
high_risk_code: ${{ steps.changes.outputs.high_risk_code }}
high_risk_code_files: ${{ steps.changes.outputs.high_risk_code_files }}
steps:
- uses: actions/checkout@v4
- name: Get changed files
id: changes
uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2
with:
token: ${{ github.token }}
filters: .github/file-filters.yml

# Enable listing of files matching each filter.
# Paths to files will be available in `${FILTER_NAME}_files` output variable.
list-files: csv

validate-high-risk-code:
if: needs.files-changed.outputs.high_risk_code == 'true'
needs: files-changed
runs-on: ubuntu-latest
steps:
- name: Comment on PR to notify of changes in high risk files
uses: actions/github-script@v7
env:
high_risk_code: ${{ needs.files-changed.outputs.high_risk_code_files }}
with:
script: |
const highRiskFiles = process.env.high_risk_code;
const fileList = highRiskFiles.split(',').map(file => `- [ ] ${file}`).join('\n');
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
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}`
})
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@0d30c9111cf47a838eb69c06d13f3f51ab2ed76f # pin@v3
uses: gradle/actions/setup-gradle@bb0c460cbf5354b0cddd15bacdf0d6aaa3e5a32b # pin@v3
with:
gradle-home-cache-cleanup: true

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

Expand All @@ -48,4 +48,4 @@ jobs:
./gradlew buildForCodeQL
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@294a9d92911152fe08befb9ec03e240add280cb3 # pin@v2
uses: github/codeql-action/analyze@662472033e021d55d94146f66f6058822b0b39fd # 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@0d30c9111cf47a838eb69c06d13f3f51ab2ed76f # pin@v3
uses: gradle/actions/setup-gradle@bb0c460cbf5354b0cddd15bacdf0d6aaa3e5a32b # 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@0d30c9111cf47a838eb69c06d13f3f51ab2ed76f # pin@v3
uses: gradle/actions/setup-gradle@bb0c460cbf5354b0cddd15bacdf0d6aaa3e5a32b # pin@v3
with:
gradle-home-cache-cleanup: true

- name: Generate Aggregate Javadocs
run: |
./gradlew aggregateJavadocs
- name: Deploy
uses: JamesIves/github-pages-deploy-action@920cbb300dcd3f0568dbc42700c61e2fd9e6139c # [email protected].4
uses: JamesIves/github-pages-deploy-action@881db5376404c5c8d621010bcbec0310b58d5e29 # [email protected].8
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@0d30c9111cf47a838eb69c06d13f3f51ab2ed76f # pin@v3
uses: gradle/actions/setup-gradle@bb0c460cbf5354b0cddd15bacdf0d6aaa3e5a32b # 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@0d30c9111cf47a838eb69c06d13f3f51ab2ed76f # pin@v3
uses: gradle/actions/setup-gradle@bb0c460cbf5354b0cddd15bacdf0d6aaa3e5a32b # pin@v3
with:
gradle-home-cache-cleanup: true

Expand Down
128 changes: 128 additions & 0 deletions .github/workflows/integration-tests-ui-critical.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
name: UI Tests Critical

on:
push:
branches:
- main
pull_request:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

env:
BASE_PATH: "sentry-android-integration-tests/sentry-uitest-android-critical"
BUILD_PATH: "build/outputs/apk/release"
APK_NAME: "sentry-uitest-android-critical-release.apk"
APK_ARTIFACT_NAME: "sentry-uitest-android-critical-release"
MAESTRO_VERSION: "1.39.0"

jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Java 17
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'

- name: Setup Gradle
uses: gradle/actions/setup-gradle@bb0c460cbf5354b0cddd15bacdf0d6aaa3e5a32b # pin@v3
with:
gradle-home-cache-cleanup: true

- name: Build debug APK
run: make assembleUiTestCriticalRelease

- name: Upload APK artifact
uses: actions/upload-artifact@v4
with:
name: ${{env.APK_ARTIFACT_NAME}}
path: "${{env.BASE_PATH}}/${{env.BUILD_PATH}}/${{env.APK_NAME}}"
retention-days: 1

run-maestro-tests:
name: Run Tests for API Level ${{ matrix.api-level }}
needs: build
runs-on: ubuntu-latest
strategy:
# we want that the matrix keeps running, default is to cancel them if it fails.
fail-fast: false
matrix:
include:
- api-level: 30 # Android 11
target: aosp_atd
channel: canary # Necessary for ATDs
arch: x86_64
- api-level: 31 # Android 12
target: aosp_atd
channel: canary # Necessary for ATDs
arch: x86_64
- api-level: 33 # Android 13
target: aosp_atd
channel: canary # Necessary for ATDs
arch: x86_64
- api-level: 34 # Android 14
target: aosp_atd
channel: canary # Necessary for ATDs
arch: x86_64
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup KVM
shell: bash
run: |
# check if virtualization is supported...
sudo apt install -y --no-install-recommends cpu-checker coreutils && echo "CPUs=$(nproc --all)" && kvm-ok
# allow access to KVM to run the emulator
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' \
| sudo tee /etc/udev/rules.d/99-kvm4all.rules
sudo udevadm control --reload-rules
sudo udevadm trigger --name-match=kvm
- name: Download APK artifact
uses: actions/download-artifact@v4
with:
name: ${{env.APK_ARTIFACT_NAME}}

- name: Install Maestro
uses: dniHze/maestro-test-action@bda8a93211c86d0a05b7a4597c5ad134566fbde4 # [email protected]
with:
version: ${{env.MAESTRO_VERSION}}

- name: Run tests
uses: reactivecircus/android-emulator-runner@62dbb605bba737720e10b196cb4220d374026a6d # [email protected]
with:
api-level: ${{ matrix.api-level }}
force-avd-creation: false
disable-animations: true
disable-spellchecker: true
target: ${{ matrix.target }}
channel: ${{ matrix.channel }}
arch: ${{ matrix.arch }}
emulator-options: >
-no-window
-no-snapshot-save
-gpu swiftshader_indirect
-noaudio
-no-boot-anim
-camera-back none
-camera-front none
-timezone US/Pacific
script: |
adb install -r -d "${{env.APK_NAME}}"
maestro test "${{env.BASE_PATH}}/maestro" --debug-output "${{env.BASE_PATH}}/maestro-logs"
- name: Upload Maestro test results
if: failure()
uses: actions/upload-artifact@v4
with:
name: maestro-logs
path: "${{env.BASE_PATH}}/maestro-logs"
retention-days: 1
2 changes: 1 addition & 1 deletion .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@0d30c9111cf47a838eb69c06d13f3f51ab2ed76f # pin@v3
uses: gradle/actions/setup-gradle@bb0c460cbf5354b0cddd15bacdf0d6aaa3e5a32b # pin@v3
with:
gradle-home-cache-cleanup: true

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@0d30c9111cf47a838eb69c06d13f3f51ab2ed76f # pin@v3
uses: gradle/actions/setup-gradle@bb0c460cbf5354b0cddd15bacdf0d6aaa3e5a32b # pin@v3
with:
gradle-home-cache-cleanup: true

Expand Down
34 changes: 30 additions & 4 deletions .github/workflows/system-tests-backend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,17 +43,38 @@ jobs:
java-version: '17'

- name: Setup Gradle
uses: gradle/actions/setup-gradle@0d30c9111cf47a838eb69c06d13f3f51ab2ed76f # pin@v3
uses: gradle/actions/setup-gradle@bb0c460cbf5354b0cddd15bacdf0d6aaa3e5a32b # pin@v3
with:
gradle-home-cache-cleanup: true

- name: Exclude android modules from build
run: |
sed -i -e '/.*"sentry-android-ndk",/d' -e '/.*"sentry-android",/d' -e '/.*"sentry-compose",/d' -e '/.*"sentry-android-core",/d' -e '/.*"sentry-android-fragment",/d' -e '/.*"sentry-android-navigation",/d' -e '/.*"sentry-android-sqlite",/d' -e '/.*"sentry-android-timber",/d' -e '/.*"sentry-android-integration-tests:sentry-uitest-android-benchmark",/d' -e '/.*"sentry-android-integration-tests:sentry-uitest-android",/d' -e '/.*"sentry-android-integration-tests:test-app-sentry",/d' -e '/.*"sentry-samples:sentry-samples-android",/d' -e '/.*"sentry-android-replay",/d' settings.gradle.kts
sed -i \
-e '/.*"sentry-android-ndk",/d' \
-e '/.*"sentry-android",/d' \
-e '/.*"sentry-compose",/d' \
-e '/.*"sentry-android-core",/d' \
-e '/.*"sentry-android-fragment",/d' \
-e '/.*"sentry-android-navigation",/d' \
-e '/.*"sentry-android-sqlite",/d' \
-e '/.*"sentry-android-timber",/d' \
-e '/.*"sentry-android-integration-tests:sentry-uitest-android-benchmark",/d' \
-e '/.*"sentry-android-integration-tests:sentry-uitest-android",/d' \
-e '/.*"sentry-android-integration-tests:sentry-uitest-android-critical",/d' \
-e '/.*"sentry-android-integration-tests:test-app-sentry",/d' \
-e '/.*"sentry-samples:sentry-samples-android",/d' \
-e '/.*"sentry-android-replay",/d' \
settings.gradle.kts
- name: Exclude android modules from ignore list
run: |
sed -i -e '/.*"sentry-uitest-android",/d' -e '/.*"sentry-uitest-android-benchmark",/d' -e '/.*"test-app-sentry",/d' -e '/.*"sentry-samples-android",/d' build.gradle.kts
sed -i \
-e '/.*"sentry-uitest-android",/d' \
-e '/.*"sentry-uitest-android-benchmark",/d' \
-e '/.*"sentry-uitest-android-critical",/d' \
-e '/.*"test-app-sentry",/d' \
-e '/.*"sentry-samples-android",/d' \
build.gradle.kts
- name: Build server jar
run: |
Expand All @@ -65,7 +86,12 @@ jobs:
- name: Start server and run integration test for sentry-cli commands
run: |
test/system-test-sentry-server-start.sh > sentry-mock-server.txt 2>&1 & test/system-test-spring-server-start.sh "${{ matrix.sample }}" "${{ matrix.agent }}" > spring-server.txt 2>&1 & test/wait-for-spring.sh && ./gradlew :sentry-samples:${{ matrix.sample }}:systemTest
test/system-test-sentry-server-start.sh \
> sentry-mock-server.txt 2>&1 & \
test/system-test-spring-server-start.sh "${{ matrix.sample }}" "${{ matrix.agent }}" \
> spring-server.txt 2>&1 & \
test/wait-for-spring.sh && \
./gradlew :sentry-samples:${{ matrix.sample }}:systemTest
- name: Upload test results
if: always()
Expand Down
4 changes: 2 additions & 2 deletions .sauce/sentry-uitest-android-benchmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ suites:
useTestOrchestrator: true
devices:
- id: Samsung_Galaxy_S10_Plus_11_real_us # Samsung Galaxy S10+ - api 30 (11) - high end
- id: Samsung_Galaxy_A71_5G_real_us # Samsung Galaxy A71 5G - api 30 (11) - mid end
- id: Google_Pixel_4a_real_us # Google Pixel 4a - api 30 (11) - mid end
- id: Google_Pixel_3a_real # Google Pixel 3a - api 30 (11) - low end

- name: "Android 10 (api 29)"
Expand All @@ -42,7 +42,7 @@ suites:
useTestOrchestrator: true
devices:
- id: Google_Pixel_3a_XL_real # Google Pixel 3a XL - api 29 (10)
- id: Motorola_Moto_G_Power_real_us # Motorola Moto G Power - api 29 (10)
- id: OnePlus_6T_real # OnePlus 6T - api 29 (10)

# At the time of writing (July, 4, 2022), the market share per android version is:
# 12.0 = 17.54%, 11.0 = 31.65%, 10.0 = 21.92%
Expand Down
Loading

0 comments on commit e5e4336

Please sign in to comment.