Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 0 additions & 9 deletions .github/workflows/update-deps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,6 @@ jobs:
name: Android SDK
ssh-key: ${{ secrets.CI_DEPLOY_KEY }}

android-stubs:
runs-on: ubuntu-latest
steps:
- uses: getsentry/github-workflows/updater@v3
with:
path: scripts/update-android-stubs.sh
name: Android SDK Stubs
ssh-key: ${{ secrets.CI_DEPLOY_KEY }}

cocoa:
runs-on: ubuntu-latest
steps:
Expand Down
4 changes: 4 additions & 0 deletions scripts/update-android-stubs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ get-repo)
set-version)
newValue="${BASH_REMATCH[1]}$2"
echo "${content/${BASH_REMATCH[0]}/$newValue}" >$file

# Rebuild the stubs jar and JS types
cd ..
yarn build:replay-stubs || true
;;
*)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: The yarn build:replay-stubs || true command will silently fail in CI due to missing dependencies, causing a stale replay-stubs.jar to be committed.
Severity: HIGH

Suggested Fix

Remove || true from the command to ensure the script fails loudly if the build fails. Additionally, ensure the CI environment has the necessary dependencies (Node.js, yarn, Java/Gradle) installed to execute the build command successfully.

Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent.
Verify if this is a real issue. If it is, propose a fix; if not, explain why it's not
valid.

Location: scripts/update-android-stubs.sh#L28

Potential issue: The script `update-android-stubs.sh` uses `yarn build:replay-stubs ||
true` to rebuild a JAR file. The CI environment where this script runs likely lacks the
necessary dependencies (Node.js, yarn, Gradle). The `|| true` will suppress the error
when the build command fails, causing the script to appear successful. This results in a
stale `replay-stubs.jar` artifact being committed to the repository, which will be out
of sync with the updated Android SDK version. This discrepancy can lead to build
failures or runtime issues for users of the SDK.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct, but it's better to silently fail the stub code than silently fail the entire CI bump.
We can always check the Bump Action from stub when a PR updates Android but doesn't update the stub.

echo "Unknown argument $1"
Expand Down
5 changes: 5 additions & 0 deletions scripts/update-android.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/usr/bin/env bash
set -euo pipefail

ORIGINAL_DIR=$(cd "$(dirname "$0")" && pwd)
cd $(dirname "$0")/../packages/core/android
file='build.gradle'
content=$(cat $file)
Expand All @@ -25,6 +26,10 @@ set-version)
# Update sentry-spotlight
newContent=$(echo "$newContent" | sed -E "s/(io\.sentry:sentry-spotlight:)([0-9\.]+)/\1$2/g")
echo "$newContent" >$file

# Update replay-stubs to match
cd $ORIGINAL_DIR
./update-android-stubs.sh set-version $2
;;
*)
echo "Unknown argument $1"
Expand Down
Loading