Skip to content

Commit

Permalink
Merge branch 'main' into feat/add-spotlight-vscode
Browse files Browse the repository at this point in the history
  • Loading branch information
lucas-zimerman authored Dec 18, 2024
2 parents d0a73ac + c6f01ea commit 0c77283
Show file tree
Hide file tree
Showing 13 changed files with 274 additions and 128 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ jobs:

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@aa578102511db1f4524ed59b8cc2bae4f6e88195 # pin@v3.27.6
uses: github/codeql-action/init@df409f7d9260372bd5f19e5b04e83cb3c43714ae # pin@v3.27.9
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
Expand All @@ -55,7 +55,7 @@ jobs:
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@aa578102511db1f4524ed59b8cc2bae4f6e88195 # pin@v3.27.6
uses: github/codeql-action/autobuild@df409f7d9260372bd5f19e5b04e83cb3c43714ae # pin@v3.27.9

# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions
Expand All @@ -66,4 +66,4 @@ jobs:
# make bootstrap
# make release
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@aa578102511db1f4524ed59b8cc2bae4f6e88195 # pin@v3.27.6
uses: github/codeql-action/analyze@df409f7d9260372bd5f19e5b04e83cb3c43714ae # pin@v3.27.9
10 changes: 8 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,16 @@ jobs:
runs-on: ubuntu-latest
name: "Release a new version"
steps:
- name: Get auth token
id: token
uses: actions/create-github-app-token@5d869da34e18e7287c1daad50e0b8ea0f506ce69 # v1.11.0
with:
app-id: ${{ vars.SENTRY_RELEASE_BOT_CLIENT_ID }}
private-key: ${{ secrets.SENTRY_RELEASE_BOT_PRIVATE_KEY }}
- name: Check out current commit (${{ github.sha }})
uses: actions/checkout@v4
with:
token: ${{ secrets.GH_RELEASE_PAT }}
token: ${{ steps.token.outputs.token }}
fetch-depth: 0
- run: corepack enable
- uses: actions/setup-node@v4
Expand All @@ -31,7 +37,7 @@ jobs:
- name: Prepare release
uses: getsentry/action-prepare-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GH_RELEASE_PAT }}
GITHUB_TOKEN: ${{ steps.token.outputs.token }}
with:
version: ${{ github.event.inputs.version }}
force: ${{ github.event.inputs.force }}
Expand Down
139 changes: 139 additions & 0 deletions .github/workflows/sample-application-expo.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,139 @@
name: Sample Application Expo

on:
push:
branches:
- main
- v5
pull_request:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}

env:
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
RN_SENTRY_POD_NAME: RNSentry

jobs:
diff_check:
uses: ./.github/workflows/skip-ci.yml

build:
name: Build ${{ matrix.platform }} ${{ matrix.build-type }} ${{ matrix.ios-use-frameworks}}
runs-on: ${{ matrix.runs-on }}
needs: [diff_check]
if: ${{ needs.diff_check.outputs.skip_ci != 'true' }}
env:
SENTRY_DISABLE_AUTO_UPLOAD: 'true'
strategy:
# we want that the matrix keeps running, default is to cancel them if it fails.
fail-fast: false
matrix:
ios-use-frameworks: ['no-frameworks', 'dynamic-frameworks']
platform: ['android', 'ios']
build-type: ['dev', 'production']
include:
- platform: ios
runs-on: macos-15
- platform: android
runs-on: ubuntu-latest
- platform: web
runs-on: ubuntu-latest
exclude:
- platform: 'android'
ios-use-frameworks: 'dynamic-frameworks'
steps:
- uses: actions/checkout@v4

- name: Enable Corepack
run: |
npm install -g corepack@0.29.4
corepack enable
- uses: actions/setup-node@v4
with:
node-version: 18
cache: 'yarn'
cache-dependency-path: yarn.lock

- uses: ruby/setup-ruby@v1
if: ${{ matrix.platform == 'ios' }}
with:
working-directory: ${{ matrix.platform == 'ios' && ' samples/expo' }}
ruby-version: '3.3.0' # based on what is used in the sample
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
cache-version: 1 # cache the installed gems

- uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'adopt'

- name: Gradle cache
uses: gradle/gradle-build-action@ac2d340dc04d9e1113182899e983b5400c17cda1 # v3.5.0

- name: Setup Global Xcode Tools
if: ${{ matrix.platform == 'ios' }}
run: which xcbeautify || brew install xcbeautify

- name: Install SDK Dependencies
run: yarn install

- name: Build SDK
run: yarn build

- name: Prebuild apps
if: ${{ matrix.platform == 'android' || matrix.platform == 'ios' }}
working-directory: samples/expo
run: npx expo prebuild

- name: Install App Pods
if: ${{ matrix.platform == 'ios' }}
working-directory: samples/expo/ios
run: |
[[ "${{ matrix.build-type }}" == "production" ]] && ENABLE_PROD=1 || ENABLE_PROD=0
[[ "${{ matrix.ios-use-frameworks }}" == "dynamic-frameworks" ]] && export USE_FRAMEWORKS=dynamic
echo "ENABLE_PROD=$ENABLE_PROD"
PRODUCTION=$ENABLE_PROD pod install
cat Podfile.lock | grep $RN_SENTRY_POD_NAME
- name: Build Android App
if: ${{ matrix.platform == 'android' }}
working-directory: samples/expo/android
run: |
[[ "${{ matrix.build-type }}" == "production" ]] && CONFIG='Release' || CONFIG='Debug'
echo "Building $CONFIG"
./gradlew ":app:assemble$CONFIG" -PreactNativeArchitectures=x86
- name: Build iOS App
if: ${{ matrix.platform == 'ios' }}
working-directory: samples/expo/ios
run: |
[[ "${{ matrix.build-type }}" == "production" ]] && CONFIG='Release' || CONFIG='Debug'
echo "Building $CONFIG"
mkdir -p "DerivedData"
derivedData="$(cd "DerivedData" ; pwd -P)"
set -o pipefail && xcodebuild \
-workspace sentryreactnativeexposample.xcworkspace \
-configuration "$CONFIG" \
-scheme sentryreactnativeexposample \
-sdk 'iphonesimulator' \
-destination 'generic/platform=iOS Simulator' \
ONLY_ACTIVE_ARCH=yes \
-derivedDataPath "$derivedData" \
build \
| tee xcodebuild.log \
| xcbeautify --quieter --is-ci --disable-colored-output
- name: Build Web App
if: ${{ matrix.platform == 'web' }}
working-directory: samples/expo
run: |
npx expo export -p web
- name: Upload logs
if: ${{ always() }}
uses: actions/upload-artifact@v4
with:
name: build-sample-expo-${{ matrix.platform }}-${{ matrix.build-type }}-${{ matrix.ios-use-frameworks}}-logs
path: samples/expo/${{ matrix.platform }}/*.log
28 changes: 12 additions & 16 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,20 +22,13 @@
email: "john@doe.com",
message: "Hello World!",
associatedEventId: eventId, // optional
}, {
captureContext: {
tags: { "tag-key": "tag-value" },
},
attachments: [
{
filename: 'hello.txt',
data: 'Hello, World!',
},
],
});
```

To learn how to attach context data to the feedback visit [the documentation](https://docs.sentry.io/platforms/react-native/user-feedback/).

- Export `Span` type from `@sentry/types` ([#4345](https://github.com/getsentry/sentry-react-native/pull/4345))
- Add RN SDK package to `sdk.packages` on Android ([#4380](https://github.com/getsentry/sentry-react-native/pull/4380))

### Fixes

Expand All @@ -53,12 +46,15 @@
- Bump CLI from v2.38.2 to v2.39.1 ([#4305](https://github.com/getsentry/sentry-react-native/pull/4305), [#4316](https://github.com/getsentry/sentry-react-native/pull/4316))
- [changelog](https://github.com/getsentry/sentry-cli/blob/master/CHANGELOG.md#2391)
- [diff](https://github.com/getsentry/sentry-cli/compare/2.38.2...2.39.1)
- Bump Android SDK from v7.18.0 to v7.18.1 ([#4329](https://github.com/getsentry/sentry-react-native/pull/4329))
- [changelog](https://github.com/getsentry/sentry-java/blob/main/CHANGELOG.md#7181)
- [diff](https://github.com/getsentry/sentry-java/compare/7.18.0...7.18.1)
- Bump JavaScript SDK from v8.40.0 to v8.41.0 ([#4351](https://github.com/getsentry/sentry-react-native/pull/4351))
- [changelog](https://github.com/getsentry/sentry-javascript/blob/develop/CHANGELOG.md#8410)
- [diff](https://github.com/getsentry/sentry-javascript/compare/8.40.0...8.41.0)
- Bump Android SDK from v7.18.0 to v7.19.0 ([#4329](https://github.com/getsentry/sentry-react-native/pull/4329), [#4365](https://github.com/getsentry/sentry-react-native/pull/4365))
- [changelog](https://github.com/getsentry/sentry-java/blob/main/CHANGELOG.md#7190)
- [diff](https://github.com/getsentry/sentry-java/compare/7.18.0...7.19.0)
- Bump JavaScript SDK from v8.40.0 to v8.46.0 ([#4351](https://github.com/getsentry/sentry-react-native/pull/4351), [#4325](https://github.com/getsentry/sentry-react-native/pull/4325), [#4371](https://github.com/getsentry/sentry-react-native/pull/4371), [#4382](https://github.com/getsentry/sentry-react-native/pull/4382), [#4388](https://github.com/getsentry/sentry-react-native/pull/4388))
- [changelog](https://github.com/getsentry/sentry-javascript/blob/develop/CHANGELOG.md#8460)
- [diff](https://github.com/getsentry/sentry-javascript/compare/8.40.0...8.46.0)
- Bump Cocoa SDK from v8.41.0 to v8.42.0 ([#4387](https://github.com/getsentry/sentry-react-native/pull/4387))
- [changelog](https://github.com/getsentry/sentry-cocoa/blob/main/CHANGELOG.md#8420)
- [diff](https://github.com/getsentry/sentry-cocoa/compare/8.41.0...8.42.0)

## 6.4.0

Expand Down
2 changes: 1 addition & 1 deletion dev-packages/e2e-tests/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"devDependencies": {
"@babel/preset-env": "^7.25.3",
"@babel/preset-typescript": "^7.18.6",
"@sentry/core": "8.41.0",
"@sentry/core": "8.46.0",
"@sentry/react-native": "6.4.0",
"@types/node": "^20.9.3",
"@types/react": "^18.2.64",
Expand Down
2 changes: 1 addition & 1 deletion packages/core/RNSentry.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ Pod::Spec.new do |s|

s.compiler_flags = other_cflags

s.dependency 'Sentry/HybridSDK', '8.41.0'
s.dependency 'Sentry/HybridSDK', '8.42.0'

if defined? install_modules_dependencies
# Default React Native dependencies for 0.71 and above (new and legacy architecture)
Expand Down
2 changes: 1 addition & 1 deletion packages/core/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -54,5 +54,5 @@ android {

dependencies {
implementation 'com.facebook.react:react-native:+'
api 'io.sentry:sentry-android:7.18.1'
api 'io.sentry:sentry-android:7.19.0'
}
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,6 @@ public class RNSentryModuleImpl {

public static final String NAME = "RNSentry";

private static final String NATIVE_SDK_NAME = "sentry.native.android.react-native";
private static final String ANDROID_SDK_NAME = "sentry.java.android.react-native";
private static final ILogger logger = new AndroidLogger(NAME);
private static final BuildInfoProvider buildInfo = new BuildInfoProvider(logger);
private static final String modulesPath = "modules.json";
Expand Down Expand Up @@ -191,13 +189,16 @@ protected void getSentryAndroidOptions(
@NotNull SentryAndroidOptions options, @NotNull ReadableMap rnOptions, ILogger logger) {
@Nullable SdkVersion sdkVersion = options.getSdkVersion();
if (sdkVersion == null) {
sdkVersion = new SdkVersion(ANDROID_SDK_NAME, BuildConfig.VERSION_NAME);
sdkVersion = new SdkVersion(RNSentryVersion.ANDROID_SDK_NAME, BuildConfig.VERSION_NAME);
} else {
sdkVersion.setName(ANDROID_SDK_NAME);
sdkVersion.setName(RNSentryVersion.ANDROID_SDK_NAME);
}
sdkVersion.addPackage(
RNSentryVersion.REACT_NATIVE_SDK_PACKAGE_NAME,
RNSentryVersion.REACT_NATIVE_SDK_PACKAGE_VERSION);

options.setSentryClientName(sdkVersion.getName() + "/" + sdkVersion.getVersion());
options.setNativeSdkName(NATIVE_SDK_NAME);
options.setNativeSdkName(RNSentryVersion.NATIVE_SDK_NAME);
options.setSdkVersion(sdkVersion);

if (rnOptions.hasKey("debug") && rnOptions.getBoolean("debug")) {
Expand Down Expand Up @@ -970,10 +971,10 @@ private void setEventOriginTag(SentryEvent event) {
SdkVersion sdk = event.getSdk();
if (sdk != null) {
switch (sdk.getName()) {
case NATIVE_SDK_NAME:
case RNSentryVersion.NATIVE_SDK_NAME:
setEventEnvironmentTag(event, "native");
break;
case ANDROID_SDK_NAME:
case RNSentryVersion.ANDROID_SDK_NAME:
setEventEnvironmentTag(event, "java");
break;
default:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package io.sentry.react;

class RNSentryVersion {
static final String REACT_NATIVE_SDK_PACKAGE_NAME = "npm:@sentry/react-native";
static final String REACT_NATIVE_SDK_PACKAGE_VERSION = "6.4.0";
static final String NATIVE_SDK_NAME = "sentry.native.android.react-native";
static final String ANDROID_SDK_NAME = "sentry.java.android.react-native";
}
16 changes: 8 additions & 8 deletions packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,21 +66,21 @@
},
"dependencies": {
"@sentry/babel-plugin-component-annotate": "2.20.1",
"@sentry/browser": "8.41.0",
"@sentry/browser": "8.46.0",
"@sentry/cli": "2.39.1",
"@sentry/core": "8.41.0",
"@sentry/react": "8.41.0",
"@sentry/types": "8.41.0",
"@sentry/utils": "8.41.0"
"@sentry/core": "8.46.0",
"@sentry/react": "8.46.0",
"@sentry/types": "8.46.0",
"@sentry/utils": "8.46.0"
},
"devDependencies": {
"@babel/core": "^7.25.2",
"@expo/metro-config": "0.19.5",
"@mswjs/interceptors": "^0.25.15",
"@react-native/babel-preset": "0.76.3",
"@sentry-internal/eslint-config-sdk": "8.41.0",
"@sentry-internal/eslint-plugin-sdk": "8.41.0",
"@sentry-internal/typescript": "8.41.0",
"@sentry-internal/eslint-config-sdk": "8.46.0",
"@sentry-internal/eslint-plugin-sdk": "8.46.0",
"@sentry-internal/typescript": "8.46.0",
"@sentry/wizard": "3.36.0",
"@testing-library/react-native": "^12.7.2",
"@types/jest": "^29.5.3",
Expand Down
6 changes: 3 additions & 3 deletions samples/react-native-macos/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@
"@react-navigation/bottom-tabs": "^6.5.12",
"@react-navigation/native": "^6.1.9",
"@react-navigation/stack": "^6.3.20",
"@sentry/core": "8.41.0",
"@sentry/react": "8.41.0",
"@sentry/core": "8.46.0",
"@sentry/react": "8.46.0",
"@sentry/react-native": "6.4.0",
"@sentry/types": "8.41.0",
"@sentry/types": "8.46.0",
"delay": "^6.0.0",
"react": "18.2.0",
"react-native": "0.73.9",
Expand Down
5 changes: 4 additions & 1 deletion scripts/version-bump.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@ const replace = require('replace-in-file');
const pjson = require('../packages/core/package.json');

replace({
files: ['packages/core/src/js/version.ts'],
files: [
'packages/core/src/js/version.ts',
'packages/core/android/src/main/java/io/sentry/react/RNSentryVersion.java',
],
from: /\d+\.\d+.\d+(?:-\w+(?:\.\w+)?)?/g,
to: pjson.version,
})
Expand Down
Loading

0 comments on commit 0c77283

Please sign in to comment.