From 5673ae09854d1eedfa53db2a5479ec958c8edc57 Mon Sep 17 00:00:00 2001 From: Sasikanth Miriyampalli Date: Tue, 13 Feb 2024 15:39:11 +0530 Subject: [PATCH 01/15] Add bugsnag Android dependency --- androidApp/build.gradle.kts | 1 + build.gradle.kts | 1 + gradle/libs.versions.toml | 4 ++++ 3 files changed, 6 insertions(+) diff --git a/androidApp/build.gradle.kts b/androidApp/build.gradle.kts index 2118412c2..e23f3e43a 100644 --- a/androidApp/build.gradle.kts +++ b/androidApp/build.gradle.kts @@ -98,4 +98,5 @@ dependencies { implementation(libs.sentry) coreLibraryDesugaring(libs.desugarJdk) implementation(libs.kotlinx.datetime) + implementation(libs.bugsnag) } diff --git a/build.gradle.kts b/build.gradle.kts index 9ed101074..533d31de7 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -31,6 +31,7 @@ plugins { alias(libs.plugins.sentry.android).apply(false) alias(libs.plugins.kotlin.parcelize).apply(false) alias(libs.plugins.kotlin.serialization).apply(false) + alias(libs.plugins.bugsnag).apply(false) } allprojects { diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 38dc4ff82..d5fe6d44e 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -48,6 +48,8 @@ ktxml = "0.2.3" uri = "0.0.16" webview = "1.8.8" uuid = "0.8.2" +bugsnag-plugin = "8.1.0" +bugsnag = "6.2.0" [libraries] compose_runtime = { module = "org.jetbrains.compose.runtime:runtime", version.ref = "compose" } @@ -113,6 +115,7 @@ ktxml = { module = "org.kobjects.ktxml:core", version.ref = "ktxml" } uri = { module = "com.eygraber:uri-kmp", version.ref = "uri" } webview = { module = "io.github.kevinnzou:compose-webview-multiplatform", version.ref = "webview" } uuid = { module = "com.benasher44:uuid", version.ref = "uuid" } +bugsnag = { module = "com.bugsnag:bugsnag-android", version.ref = "bugsnag" } [plugins] android_application = { id = "com.android.application", version.ref = "android_gradle_plugin" } @@ -128,6 +131,7 @@ spotless = { id = "com.diffplug.spotless", version.ref = "spotless" } ksp = { id = 'com.google.devtools.ksp', version.ref = 'ksp' } buildKonfig = { id = "com.codingfeline.buildkonfig", version.ref = "buildKonfig" } sentry_android = { id = "io.sentry.android.gradle", version.ref = "sentry_android" } +bugsnag = { id = "com.bugsnag.android.gradle", version.ref = "bugsnag-plugin" } [bundles] compose = [ "compose_runtime", "compose_foundation", "compose_material", "compose_material3", "compose_resources", "compose_ui", "compose_ui_util", "compose_material_icons_extended" ] From ff6d5871711c2a07c5535001b65ba7744df589b4 Mon Sep 17 00:00:00 2001 From: Sasikanth Miriyampalli Date: Tue, 13 Feb 2024 15:59:46 +0530 Subject: [PATCH 02/15] Remove Sentry and BuildKonfig usage --- androidApp/build.gradle.kts | 4 --- .../rss/reader/FeedsRefreshWorker.kt | 10 +++--- .../rss/reader/PostsCleanUpWorker.kt | 4 +-- build.gradle.kts | 2 -- core/network/build.gradle.kts | 1 - gradle/libs.versions.toml | 6 ---- iosApp/iosApp.xcodeproj/project.pbxproj | 18 ----------- shared/build.gradle.kts | 12 ------- .../reader/di/SharedApplicationComponent.kt | 8 +---- .../rss/reader/home/HomePresenter.kt | 28 ++++++++++------- .../sasikanth/rss/reader/opml/FeedsOpml.kt | 7 +++-- .../rss/reader/sentry/SentryComponent.kt | 29 ----------------- .../rss/reader/sentry/SentryInitializer.kt | 31 ------------------- 13 files changed, 27 insertions(+), 133 deletions(-) delete mode 100644 shared/src/commonMain/kotlin/dev/sasikanth/rss/reader/sentry/SentryComponent.kt delete mode 100644 shared/src/commonMain/kotlin/dev/sasikanth/rss/reader/sentry/SentryInitializer.kt diff --git a/androidApp/build.gradle.kts b/androidApp/build.gradle.kts index e23f3e43a..91a4995d8 100644 --- a/androidApp/build.gradle.kts +++ b/androidApp/build.gradle.kts @@ -19,11 +19,8 @@ plugins { alias(libs.plugins.android.application) alias(libs.plugins.compose) alias(libs.plugins.ksp) - alias(libs.plugins.sentry.android) } -sentry { tracingInstrumentation { enabled = false } } - kotlin { jvmToolchain(20) @@ -95,7 +92,6 @@ dependencies { implementation(libs.kotlininject.runtime) ksp(libs.kotlininject.compiler) implementation(libs.androidx.work) - implementation(libs.sentry) coreLibraryDesugaring(libs.desugarJdk) implementation(libs.kotlinx.datetime) implementation(libs.bugsnag) diff --git a/androidApp/src/androidMain/kotlin/dev/sasikanth/rss/reader/FeedsRefreshWorker.kt b/androidApp/src/androidMain/kotlin/dev/sasikanth/rss/reader/FeedsRefreshWorker.kt index 179cf0b2b..caab9620b 100644 --- a/androidApp/src/androidMain/kotlin/dev/sasikanth/rss/reader/FeedsRefreshWorker.kt +++ b/androidApp/src/androidMain/kotlin/dev/sasikanth/rss/reader/FeedsRefreshWorker.kt @@ -24,9 +24,6 @@ import androidx.work.PeriodicWorkRequestBuilder import androidx.work.WorkerParameters import dev.sasikanth.rss.reader.refresh.LastUpdatedAt import dev.sasikanth.rss.reader.repository.RssRepository -import io.sentry.kotlin.multiplatform.Sentry -import io.sentry.kotlin.multiplatform.SentryLevel -import io.sentry.kotlin.multiplatform.protocol.Breadcrumb import java.lang.Exception import java.time.Duration import kotlinx.coroutines.CancellationException @@ -64,9 +61,10 @@ class FeedsRefreshWorker( } catch (e: CancellationException) { Result.failure() } catch (e: Exception) { - Sentry.captureException(e) { - it.addBreadcrumb(Breadcrumb(level = SentryLevel.INFO, category = "Background")) - } + // TODO: Report error + // Sentry.captureException(e) { + // it.addBreadcrumb(Breadcrumb(level = SentryLevel.INFO, category = "Background")) + // } Result.failure() } } else { diff --git a/androidApp/src/androidMain/kotlin/dev/sasikanth/rss/reader/PostsCleanUpWorker.kt b/androidApp/src/androidMain/kotlin/dev/sasikanth/rss/reader/PostsCleanUpWorker.kt index 657935439..a93152ad1 100644 --- a/androidApp/src/androidMain/kotlin/dev/sasikanth/rss/reader/PostsCleanUpWorker.kt +++ b/androidApp/src/androidMain/kotlin/dev/sasikanth/rss/reader/PostsCleanUpWorker.kt @@ -26,7 +26,6 @@ import androidx.work.WorkerParameters import dev.sasikanth.rss.reader.repository.RssRepository import dev.sasikanth.rss.reader.repository.SettingsRepository import dev.sasikanth.rss.reader.utils.calculateInstantBeforePeriod -import io.sentry.Sentry import java.time.Duration import kotlin.coroutines.cancellation.CancellationException @@ -67,7 +66,8 @@ class PostsCleanUpWorker( } catch (e: CancellationException) { // no-op } catch (e: Exception) { - Sentry.captureException(e) + // TODO: Report error + // Sentry.captureException(e) } return Result.failure() diff --git a/build.gradle.kts b/build.gradle.kts index 533d31de7..9f83520cb 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -27,8 +27,6 @@ plugins { alias(libs.plugins.android.library).apply(false) alias(libs.plugins.compose).apply(false) alias(libs.plugins.spotless).apply(false) - alias(libs.plugins.buildKonfig).apply(false) - alias(libs.plugins.sentry.android).apply(false) alias(libs.plugins.kotlin.parcelize).apply(false) alias(libs.plugins.kotlin.serialization).apply(false) alias(libs.plugins.bugsnag).apply(false) diff --git a/core/network/build.gradle.kts b/core/network/build.gradle.kts index f89bc0f95..54581cc78 100644 --- a/core/network/build.gradle.kts +++ b/core/network/build.gradle.kts @@ -42,7 +42,6 @@ kotlin { implementation(libs.ksoup) // TODO: Extract logging abstraction into separate module implementation(libs.napier) - implementation(libs.sentry) implementation(libs.ktxml) } commonTest.dependencies { implementation(libs.kotlin.test) } diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index d5fe6d44e..b1d341b60 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -32,9 +32,6 @@ kotlininject = "0.6.3" ksp = "1.9.22-1.0.17" material_color_utilities = "1.0.0-alpha01" ksoup = "0.1.2" -sentry = "0.3.0" -sentry_android = "4.3.0" -buildKonfig = "0.15.1" sqliteAndroid = "3.45.0" windowSizeClass = "0.3.2" desugarJdk = "2.0.4" @@ -98,7 +95,6 @@ kotlininject-compiler = { module = 'me.tatarka.inject:kotlin-inject-compiler-ksp kotlininject-runtime = { module = 'me.tatarka.inject:kotlin-inject-runtime', version.ref = 'kotlininject' } material_color_utilities = { module = "dev.sasikanth:material-color-utilities", version.ref = "material_color_utilities" } ksoup = { module = "com.fleeksoft.ksoup:ksoup", version.ref = "ksoup" } -sentry = { module = "io.sentry:sentry-kotlin-multiplatform", version.ref = "sentry" } sqliteAndroid = { module = "com.github.requery:sqlite-android", version.ref = "sqliteAndroid" } windowSizeClass = { module = "dev.chrisbanes.material3:material3-window-size-class-multiplatform", version.ref = "windowSizeClass" } desugarJdk = { module = "com.android.tools:desugar_jdk_libs", version.ref = "desugarJdk" } @@ -129,8 +125,6 @@ compose = { id = "org.jetbrains.compose", version.ref = "compose" } sqldelight = { id = "app.cash.sqldelight", version.ref = "sqldelight" } spotless = { id = "com.diffplug.spotless", version.ref = "spotless" } ksp = { id = 'com.google.devtools.ksp', version.ref = 'ksp' } -buildKonfig = { id = "com.codingfeline.buildkonfig", version.ref = "buildKonfig" } -sentry_android = { id = "io.sentry.android.gradle", version.ref = "sentry_android" } bugsnag = { id = "com.bugsnag.android.gradle", version.ref = "bugsnag-plugin" } [bundles] diff --git a/iosApp/iosApp.xcodeproj/project.pbxproj b/iosApp/iosApp.xcodeproj/project.pbxproj index bba2314c1..36b76622d 100644 --- a/iosApp/iosApp.xcodeproj/project.pbxproj +++ b/iosApp/iosApp.xcodeproj/project.pbxproj @@ -123,7 +123,6 @@ 7555FF79242A565900829871 /* Resources */, F85CB1118929364A9C6EFABC /* Frameworks */, 2134C13603D0B299603D9F49 /* [CP] Copy Pods Resources */, - 0E668490121D39D1C4498DE3 /* [CP] Embed Pods Frameworks */, ); buildRules = ( ); @@ -180,23 +179,6 @@ /* End PBXResourcesBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */ - 0E668490121D39D1C4498DE3 /* [CP] Embed Pods Frameworks */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-iosApp/Pods-iosApp-frameworks-${CONFIGURATION}-input-files.xcfilelist", - ); - name = "[CP] Embed Pods Frameworks"; - outputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-iosApp/Pods-iosApp-frameworks-${CONFIGURATION}-output-files.xcfilelist", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-iosApp/Pods-iosApp-frameworks.sh\"\n"; - showEnvVarsInLog = 0; - }; 2134C13603D0B299603D9F49 /* [CP] Copy Pods Resources */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; diff --git a/shared/build.gradle.kts b/shared/build.gradle.kts index df21e613c..67256d3b9 100644 --- a/shared/build.gradle.kts +++ b/shared/build.gradle.kts @@ -14,7 +14,6 @@ * limitations under the License. */ import com.android.build.api.dsl.ManagedVirtualDevice -import com.codingfeline.buildkonfig.compiler.FieldSpec.Type.STRING import org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi import org.jetbrains.kotlin.gradle.plugin.KotlinSourceSetTree @@ -26,19 +25,10 @@ plugins { alias(libs.plugins.compose) alias(libs.plugins.sqldelight) alias(libs.plugins.ksp) - alias(libs.plugins.buildKonfig) alias(libs.plugins.kotlin.parcelize) alias(libs.plugins.kotlin.serialization) } -buildkonfig { - packageName = "dev.sasikanth.reader" - defaultConfigs { - val sentryDsn = System.getenv("SENTRY_DSN") - buildConfigField(STRING, "SENTRY_DSN", sentryDsn.orEmpty()) - } -} - @OptIn(ExperimentalKotlinGradlePluginApi::class) kotlin { jvmToolchain(20) @@ -65,7 +55,6 @@ kotlin { homepage = "https://github.com/msasikanth/rss_reader" ios.deploymentTarget = "15.0" podfile = project.file("../iosApp/Podfile") - pod("Sentry", "~> 8.4.0") framework { baseName = "shared" @@ -109,7 +98,6 @@ kotlin { implementation(libs.androidx.collection) implementation(libs.material.color.utilities) implementation(libs.ksoup) - implementation(libs.sentry) implementation(libs.windowSizeClass) api(libs.androidx.datastore.okio) api(libs.androidx.datastore.preferences) diff --git a/shared/src/commonMain/kotlin/dev/sasikanth/rss/reader/di/SharedApplicationComponent.kt b/shared/src/commonMain/kotlin/dev/sasikanth/rss/reader/di/SharedApplicationComponent.kt index 63bc30b90..e744d72cd 100644 --- a/shared/src/commonMain/kotlin/dev/sasikanth/rss/reader/di/SharedApplicationComponent.kt +++ b/shared/src/commonMain/kotlin/dev/sasikanth/rss/reader/di/SharedApplicationComponent.kt @@ -21,18 +21,12 @@ import dev.sasikanth.rss.reader.filemanager.FileManagerComponent import dev.sasikanth.rss.reader.initializers.Initializer import dev.sasikanth.rss.reader.logging.LoggingComponent import dev.sasikanth.rss.reader.refresh.LastUpdatedAt -import dev.sasikanth.rss.reader.sentry.SentryComponent import dev.sasikanth.rss.reader.util.DefaultDispatchersProvider import dev.sasikanth.rss.reader.util.DispatchersProvider import me.tatarka.inject.annotations.Provides abstract class SharedApplicationComponent : - DataComponent, - SentryComponent, - NetworkComponent, - LoggingComponent, - FileManagerComponent, - ImageLoaderComponent { + DataComponent, NetworkComponent, LoggingComponent, FileManagerComponent, ImageLoaderComponent { abstract val initializers: Set diff --git a/shared/src/commonMain/kotlin/dev/sasikanth/rss/reader/home/HomePresenter.kt b/shared/src/commonMain/kotlin/dev/sasikanth/rss/reader/home/HomePresenter.kt index 9cb69efab..fb43002ef 100644 --- a/shared/src/commonMain/kotlin/dev/sasikanth/rss/reader/home/HomePresenter.kt +++ b/shared/src/commonMain/kotlin/dev/sasikanth/rss/reader/home/HomePresenter.kt @@ -45,7 +45,6 @@ import dev.sasikanth.rss.reader.utils.getTodayStartInstant import io.ktor.client.network.sockets.ConnectTimeoutException import io.ktor.client.network.sockets.SocketTimeoutException import io.ktor.http.HttpStatusCode -import io.sentry.kotlin.multiplatform.Sentry import kotlinx.collections.immutable.toImmutableList import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.ExperimentalCoroutinesApi @@ -316,7 +315,8 @@ class HomePresenter( } } } catch (e: Exception) { - Sentry.captureException(e) { scope -> scope.setContext("feed_url", feedLink) } + // TODO: Report error + // Sentry.captureException(e) { scope -> scope.setContext("feed_url", feedLink) } effects.emit(HomeEffect.ShowError(HomeErrorType.Unknown(e))) } finally { _state.update { @@ -335,9 +335,10 @@ class HomePresenter( effects.emit(HomeEffect.ShowError(HomeErrorType.UnknownFeedType)) } is XmlParsingError -> { - Sentry.captureException(feedAddResult.exception) { scope -> - scope.setContext("feed_url", feedLink) - } + // TODO: Report error + // Sentry.captureException(feedAddResult.exception) { scope -> + // scope.setContext("feed_url", feedLink) + // } effects.emit(HomeEffect.ShowError(HomeErrorType.FailedToParseXML)) } is ConnectTimeoutException, @@ -345,9 +346,10 @@ class HomePresenter( effects.emit(HomeEffect.ShowError(HomeErrorType.Timeout)) } else -> { - Sentry.captureException(feedAddResult.exception) { scope -> - scope.setContext("feed_url", feedLink) - } + // TODO: Report error + // Sentry.captureException(feedAddResult.exception) { scope -> + // scope.setContext("feed_url", feedLink) + // } effects.emit(HomeEffect.ShowError(HomeErrorType.Unknown(feedAddResult.exception))) } } @@ -378,9 +380,10 @@ class HomePresenter( } private fun handleDatabaseErrors(databaseError: FeedAddResult.DatabaseError, feedLink: String) { - Sentry.captureException(databaseError.exception) { scope -> - scope.setContext("feed_url", feedLink) - } + // TODO: Report error + // Sentry.captureException(databaseError.exception) { scope -> + // scope.setContext("feed_url", feedLink) + // } } private fun feedsSheetStateChanged(feedsSheetState: BottomSheetValue) { @@ -417,7 +420,8 @@ class HomePresenter( rssRepository.updateFeeds() } } catch (e: Exception) { - Sentry.captureException(e) + // TODO: Report error + // Sentry.captureException(e) } finally { _state.update { it.copy(loadingState = HomeLoadingState.Idle) } } diff --git a/shared/src/commonMain/kotlin/dev/sasikanth/rss/reader/opml/FeedsOpml.kt b/shared/src/commonMain/kotlin/dev/sasikanth/rss/reader/opml/FeedsOpml.kt index eca5d776e..108d4fd9a 100644 --- a/shared/src/commonMain/kotlin/dev/sasikanth/rss/reader/opml/FeedsOpml.kt +++ b/shared/src/commonMain/kotlin/dev/sasikanth/rss/reader/opml/FeedsOpml.kt @@ -17,7 +17,6 @@ package dev.sasikanth.rss.reader.opml import dev.sasikanth.rss.reader.core.model.local.Feed import dev.sasikanth.rss.reader.di.scopes.AppScope -import io.sentry.kotlin.multiplatform.Sentry import kotlinx.serialization.serializer import me.tatarka.inject.annotations.Inject import nl.adaptivity.xmlutil.serialization.XML @@ -51,7 +50,8 @@ class FeedsOpml { .appendLine() .toString() } catch (e: Exception) { - Sentry.captureException(e) + // TODO: Report error + // Sentry.captureException(e) "" } } @@ -73,7 +73,8 @@ class FeedsOpml { opmlFeeds.distinctBy { it.link } } catch (e: Exception) { - Sentry.captureException(e) + // TODO: Report error + // Sentry.captureException(e) emptyList() } } diff --git a/shared/src/commonMain/kotlin/dev/sasikanth/rss/reader/sentry/SentryComponent.kt b/shared/src/commonMain/kotlin/dev/sasikanth/rss/reader/sentry/SentryComponent.kt deleted file mode 100644 index 0ccdd66c6..000000000 --- a/shared/src/commonMain/kotlin/dev/sasikanth/rss/reader/sentry/SentryComponent.kt +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright 2023 Sasikanth Miriyampalli - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package dev.sasikanth.rss.reader.sentry - -import dev.sasikanth.rss.reader.di.scopes.AppScope -import dev.sasikanth.rss.reader.initializers.Initializer -import me.tatarka.inject.annotations.IntoSet -import me.tatarka.inject.annotations.Provides - -internal interface SentryComponent { - - @IntoSet - @Provides - @AppScope - fun providesSentryInitializer(bind: SentryInitializer): Initializer = bind -} diff --git a/shared/src/commonMain/kotlin/dev/sasikanth/rss/reader/sentry/SentryInitializer.kt b/shared/src/commonMain/kotlin/dev/sasikanth/rss/reader/sentry/SentryInitializer.kt deleted file mode 100644 index f809fa977..000000000 --- a/shared/src/commonMain/kotlin/dev/sasikanth/rss/reader/sentry/SentryInitializer.kt +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright 2023 Sasikanth Miriyampalli - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package dev.sasikanth.rss.reader.sentry - -import dev.sasikanth.reader.BuildKonfig -import dev.sasikanth.rss.reader.initializers.Initializer -import io.sentry.kotlin.multiplatform.Sentry -import me.tatarka.inject.annotations.Inject - -@Inject -class SentryInitializer : Initializer { - - override fun initialize() { - if (BuildKonfig.SENTRY_DSN.isNotBlank()) { - Sentry.init { options -> options.dsn = BuildKonfig.SENTRY_DSN } - } - } -} From 58d0601fee9c7824aefe7ce972921b5f38231edc Mon Sep 17 00:00:00 2001 From: Sasikanth Miriyampalli Date: Wed, 14 Feb 2024 06:07:40 +0530 Subject: [PATCH 03/15] Add CrashKiOS bugsnag dependency --- gradle/libs.versions.toml | 2 ++ shared/build.gradle.kts | 2 ++ 2 files changed, 4 insertions(+) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index b1d341b60..d53d45f84 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -47,6 +47,7 @@ webview = "1.8.8" uuid = "0.8.2" bugsnag-plugin = "8.1.0" bugsnag = "6.2.0" +crashkios-bugsnag = "0.8.6" [libraries] compose_runtime = { module = "org.jetbrains.compose.runtime:runtime", version.ref = "compose" } @@ -112,6 +113,7 @@ uri = { module = "com.eygraber:uri-kmp", version.ref = "uri" } webview = { module = "io.github.kevinnzou:compose-webview-multiplatform", version.ref = "webview" } uuid = { module = "com.benasher44:uuid", version.ref = "uuid" } bugsnag = { module = "com.bugsnag:bugsnag-android", version.ref = "bugsnag" } +crashkios-bugsnag = { module = "co.touchlab.crashkios:bugsnag", version.ref = "crashkios-bugsnag" } [plugins] android_application = { id = "com.android.application", version.ref = "android_gradle_plugin" } diff --git a/shared/build.gradle.kts b/shared/build.gradle.kts index 67256d3b9..7530657c2 100644 --- a/shared/build.gradle.kts +++ b/shared/build.gradle.kts @@ -63,6 +63,7 @@ kotlin { export(libs.decompose) export(libs.essenty.lifecycle) export(libs.essenty.backhandler) + export(libs.crashkios.bugsnag) } } @@ -112,6 +113,7 @@ kotlin { api(libs.coil.compose) api(libs.coil.network) api(libs.coil.svg) + api(libs.crashkios.bugsnag) } commonTest.dependencies { implementation(libs.kotlin.test) From 4905ae7fb37d53742d46f9376c5fb87e12fb01c2 Mon Sep 17 00:00:00 2001 From: Sasikanth Miriyampalli Date: Wed, 14 Feb 2024 05:49:18 +0530 Subject: [PATCH 04/15] Remove `sentry.dsn` from `gradle.properties` --- gradle.properties | 3 --- 1 file changed, 3 deletions(-) diff --git a/gradle.properties b/gradle.properties index 0caa21046..07ec5eeb1 100644 --- a/gradle.properties +++ b/gradle.properties @@ -13,6 +13,3 @@ org.jetbrains.compose.experimental.uikit.enabled=true android.useAndroidX=true android.nonTransitiveRClass=true android.nonFinalResIds=false -#Sentry -# do_not_change_here -sentry.dsn= From 3140acf5198469df338c8b2700bce268f1abce50 Mon Sep 17 00:00:00 2001 From: Sasikanth Miriyampalli Date: Wed, 14 Feb 2024 05:49:59 +0530 Subject: [PATCH 05/15] Add BugSnag API key in the Android app manifest using manifest placeholders --- androidApp/build.gradle.kts | 3 +++ androidApp/src/androidMain/AndroidManifest.xml | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/androidApp/build.gradle.kts b/androidApp/build.gradle.kts index 91a4995d8..8f9cd17eb 100644 --- a/androidApp/build.gradle.kts +++ b/androidApp/build.gradle.kts @@ -38,6 +38,9 @@ android { minSdk = libs.versions.android.sdk.min.get().toInt() targetSdk = libs.versions.android.sdk.target.get().toInt() + val keyBugsnagAPIKey = "BUGSNAG_API_KEY" + manifestPlaceholders[keyBugsnagAPIKey] = System.getenv(keyBugsnagAPIKey).orEmpty() + versionCode = if (project.properties["VERSION_CODE"] != null) { (project.properties["VERSION_CODE"] as String).toInt() diff --git a/androidApp/src/androidMain/AndroidManifest.xml b/androidApp/src/androidMain/AndroidManifest.xml index 901092838..a2bff5d94 100644 --- a/androidApp/src/androidMain/AndroidManifest.xml +++ b/androidApp/src/androidMain/AndroidManifest.xml @@ -23,6 +23,10 @@ android:dataExtractionRules="@xml/data_extraction_rules" android:enableOnBackInvokedCallback="true" tools:targetApi="tiramisu"> + + + Date: Wed, 14 Feb 2024 05:50:15 +0530 Subject: [PATCH 06/15] Enable BugSnag for non-debug builds on Android --- .../kotlin/dev/sasikanth/rss/reader/ReaderApplication.kt | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/androidApp/src/androidMain/kotlin/dev/sasikanth/rss/reader/ReaderApplication.kt b/androidApp/src/androidMain/kotlin/dev/sasikanth/rss/reader/ReaderApplication.kt index 19a9f63bf..719ef8e84 100644 --- a/androidApp/src/androidMain/kotlin/dev/sasikanth/rss/reader/ReaderApplication.kt +++ b/androidApp/src/androidMain/kotlin/dev/sasikanth/rss/reader/ReaderApplication.kt @@ -24,6 +24,8 @@ import androidx.work.ListenableWorker import androidx.work.WorkManager import androidx.work.WorkerFactory import androidx.work.WorkerParameters +import co.touchlab.crashkios.bugsnag.enableBugsnag +import com.bugsnag.android.Bugsnag import dev.sasikanth.rss.reader.di.ApplicationComponent import dev.sasikanth.rss.reader.di.create @@ -79,6 +81,12 @@ class ReaderApplication : Application(), Configuration.Provider { override fun onCreate() { super.onCreate() + + if (!BuildConfig.DEBUG) { + Bugsnag.start(this) + enableBugsnag() + } + enqueuePeriodicFeedsRefresh() enqueuePeriodicPostsCleanUp() From 98360df8404673eff3fc00200fa262a29372524b Mon Sep 17 00:00:00 2001 From: Sasikanth Miriyampalli Date: Wed, 14 Feb 2024 05:50:33 +0530 Subject: [PATCH 07/15] Report background worker errors to BugSnag --- .../kotlin/dev/sasikanth/rss/reader/FeedsRefreshWorker.kt | 8 ++++---- .../kotlin/dev/sasikanth/rss/reader/PostsCleanUpWorker.kt | 6 ++++-- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/androidApp/src/androidMain/kotlin/dev/sasikanth/rss/reader/FeedsRefreshWorker.kt b/androidApp/src/androidMain/kotlin/dev/sasikanth/rss/reader/FeedsRefreshWorker.kt index caab9620b..c9a847e5f 100644 --- a/androidApp/src/androidMain/kotlin/dev/sasikanth/rss/reader/FeedsRefreshWorker.kt +++ b/androidApp/src/androidMain/kotlin/dev/sasikanth/rss/reader/FeedsRefreshWorker.kt @@ -22,6 +22,8 @@ import androidx.work.NetworkType import androidx.work.PeriodicWorkRequest import androidx.work.PeriodicWorkRequestBuilder import androidx.work.WorkerParameters +import co.touchlab.crashkios.bugsnag.BugsnagKotlin +import com.bugsnag.android.Bugsnag import dev.sasikanth.rss.reader.refresh.LastUpdatedAt import dev.sasikanth.rss.reader.repository.RssRepository import java.lang.Exception @@ -61,10 +63,8 @@ class FeedsRefreshWorker( } catch (e: CancellationException) { Result.failure() } catch (e: Exception) { - // TODO: Report error - // Sentry.captureException(e) { - // it.addBreadcrumb(Breadcrumb(level = SentryLevel.INFO, category = "Background")) - // } + Bugsnag.leaveBreadcrumb("Background Worker") + BugsnagKotlin.sendFatalException(e) Result.failure() } } else { diff --git a/androidApp/src/androidMain/kotlin/dev/sasikanth/rss/reader/PostsCleanUpWorker.kt b/androidApp/src/androidMain/kotlin/dev/sasikanth/rss/reader/PostsCleanUpWorker.kt index a93152ad1..b233042d5 100644 --- a/androidApp/src/androidMain/kotlin/dev/sasikanth/rss/reader/PostsCleanUpWorker.kt +++ b/androidApp/src/androidMain/kotlin/dev/sasikanth/rss/reader/PostsCleanUpWorker.kt @@ -23,6 +23,8 @@ import androidx.work.NetworkType import androidx.work.PeriodicWorkRequest import androidx.work.PeriodicWorkRequestBuilder import androidx.work.WorkerParameters +import co.touchlab.crashkios.bugsnag.BugsnagKotlin +import com.bugsnag.android.Bugsnag import dev.sasikanth.rss.reader.repository.RssRepository import dev.sasikanth.rss.reader.repository.SettingsRepository import dev.sasikanth.rss.reader.utils.calculateInstantBeforePeriod @@ -66,8 +68,8 @@ class PostsCleanUpWorker( } catch (e: CancellationException) { // no-op } catch (e: Exception) { - // TODO: Report error - // Sentry.captureException(e) + Bugsnag.leaveBreadcrumb("Background Worker") + BugsnagKotlin.sendFatalException(e) } return Result.failure() From 47ccf1a946142ba1580e61f31ab20b086876c110 Mon Sep 17 00:00:00 2001 From: Sasikanth Miriyampalli Date: Wed, 14 Feb 2024 06:56:24 +0530 Subject: [PATCH 08/15] Enable BugSnag for non-debug version on iOS --- iosApp/iosApp/AppDelegate.swift | 30 ++++++++++++------------------ iosApp/iosApp/Info.plist | 5 +++++ 2 files changed, 17 insertions(+), 18 deletions(-) diff --git a/iosApp/iosApp/AppDelegate.swift b/iosApp/iosApp/AppDelegate.swift index bf56422f2..c25794bcc 100644 --- a/iosApp/iosApp/AppDelegate.swift +++ b/iosApp/iosApp/AppDelegate.swift @@ -9,7 +9,7 @@ import UIKit import shared import BackgroundTasks -import Sentry +import Bugsnag class AppDelegate: NSObject, UIApplicationDelegate { let rootHolder: RootHolder = RootHolder() @@ -19,6 +19,11 @@ class AppDelegate: NSObject, UIApplicationDelegate { ) func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool { + #if !DEBUG + Bugsnag.start() + let config = BugsnagConfiguration.loadConfig() + BugsnagConfigKt.startBugsnag(config: config) + #endif applicationComponent.initializers .compactMap { ($0 as! any Initializer) } @@ -49,6 +54,8 @@ class AppDelegate: NSObject, UIApplicationDelegate { } func cleanUpPosts(task: BGProcessingTask) { + Bugsnag.leaveBreadcrumb(withMessage: "Background Processing") + // Schedule next clean up task 24 hours in future scheduleCleanUpPosts(earliest: Date(timeIntervalSinceNow: 60 * 60 * 24)) @@ -63,15 +70,7 @@ class AppDelegate: NSObject, UIApplicationDelegate { } task.setTaskCompleted(success: true) } catch { - let breadcrumb = Breadcrumb() - breadcrumb.level = .info - breadcrumb.category = "Background" - - let scope = Scope() - scope.addBreadcrumb(breadcrumb) - - SentrySDK.capture(error: error, scope: scope) - + Bugsnag.notifyError(error) task.setTaskCompleted(success: false) } } @@ -90,6 +89,8 @@ class AppDelegate: NSObject, UIApplicationDelegate { } func refreshFeeds(task: BGProcessingTask) { + Bugsnag.leaveBreadcrumb(withMessage: "Background Processing") + scheduledRefreshFeeds(earliest: Date(timeIntervalSinceNow: 60 * 60)) // 1 hour Task(priority: .background) { do { @@ -101,14 +102,7 @@ class AppDelegate: NSObject, UIApplicationDelegate { task.setTaskCompleted(success: true) } catch { - let breadcrumb = Breadcrumb() - breadcrumb.level = .info - breadcrumb.category = "Background" - - let scope = Scope() - scope.addBreadcrumb(breadcrumb) - - SentrySDK.capture(error: error, scope: scope) + Bugsnag.notifyError(error) task.setTaskCompleted(success: false) } } diff --git a/iosApp/iosApp/Info.plist b/iosApp/iosApp/Info.plist index f9e21c4db..af8b50250 100644 --- a/iosApp/iosApp/Info.plist +++ b/iosApp/iosApp/Info.plist @@ -2,6 +2,11 @@ + bugsnag + + apiKey + $(BUGSNAG_API_KEY) + BGTaskSchedulerPermittedIdentifiers dev.sasikanth.reader.posts_cleanup From 72712360b9e97e7c67a72b11890a33ba611f4671 Mon Sep 17 00:00:00 2001 From: Sasikanth Miriyampalli Date: Wed, 14 Feb 2024 06:57:01 +0530 Subject: [PATCH 09/15] Upload dSYM to BugSnag instead of Sentry in when making iOS prod release --- .github/workflows/ios_prod_release.yml | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/.github/workflows/ios_prod_release.yml b/.github/workflows/ios_prod_release.yml index 7fde8529d..a7582a4f4 100644 --- a/.github/workflows/ios_prod_release.yml +++ b/.github/workflows/ios_prod_release.yml @@ -13,6 +13,7 @@ jobs: env: TERM: dumb SENTRY_DSN: ${{ secrets.SENTRY_DSN }} + BUGSNAG_API_KEY: ${{ secrets.BUGSNAG_API_KEY }} steps: - name: Configure Tramline id: tramline @@ -70,7 +71,8 @@ jobs: - name: Build Archive run: | - xcodebuild -workspace ./iosApp/iosApp.xcworkspace \ + xcodebuild BUGSNAG_API_KEY=${BUGSNAG_API_KEY} + -workspace ./iosApp/iosApp.xcworkspace \ -scheme iosApp \ -archivePath $RUNNER_TEMP/twine.xcarchive \ -sdk iphoneos \ @@ -89,15 +91,12 @@ jobs: echo -n "$EXPORT_OPTIONS_PLIST" | base64 --decode -o $EXPORT_OPTS_PATH xcodebuild -exportArchive -archivePath $RUNNER_TEMP/twine.xcarchive -exportOptionsPlist $EXPORT_OPTS_PATH -exportPath $RUNNER_TEMP/build - - name: Upload debug symbols to Sentry + - name: Upload debug symbols to Bugsnag run: | - curl -sL https://sentry.io/get-cli/ | SENTRY_CLI_VERSION=2.21.2 bash; - - sentry-cli debug-files upload --auth-token ${{ secrets.SENTRY_AUTH_TOKEN }} \ - --include-sources \ - --org ${{ secrets.SENTRY_ORG }} \ - --project ${{ secrets.SENTRY_PROJECT }} \ - $RUNNER_TEMP/twine.xcarchive/dSYMs + cd $RUNNER_TEMP/twine.xcarchive/dSYMs/; + curl -http1.1 https://upload.bugsnag.com/ \ + -F apiKey=${BUGSNAG_API_KEY} \ + -F dsym=@Twine.app.dSYM/Contents/Resources/DWARF/MyApp \ - name: Clean up keychain and provisioning profile if: ${{ always() }} From e38e9a7149f80afddb0058c25f137796ae7c4bef Mon Sep 17 00:00:00 2001 From: Sasikanth Miriyampalli Date: Wed, 14 Feb 2024 07:04:35 +0530 Subject: [PATCH 10/15] Reporting handled errors in common code using BugSnag --- .../rss/reader/home/HomePresenter.kt | 27 ++++++++----------- .../sasikanth/rss/reader/opml/FeedsOpml.kt | 7 +++-- 2 files changed, 14 insertions(+), 20 deletions(-) diff --git a/shared/src/commonMain/kotlin/dev/sasikanth/rss/reader/home/HomePresenter.kt b/shared/src/commonMain/kotlin/dev/sasikanth/rss/reader/home/HomePresenter.kt index fb43002ef..a100db5cd 100644 --- a/shared/src/commonMain/kotlin/dev/sasikanth/rss/reader/home/HomePresenter.kt +++ b/shared/src/commonMain/kotlin/dev/sasikanth/rss/reader/home/HomePresenter.kt @@ -21,6 +21,7 @@ import androidx.compose.material.ExperimentalMaterialApi import app.cash.paging.cachedIn import app.cash.paging.createPager import app.cash.paging.createPagingConfig +import co.touchlab.crashkios.bugsnag.BugsnagKotlin import com.arkivanov.decompose.ComponentContext import com.arkivanov.decompose.childContext import com.arkivanov.essenty.backhandler.BackCallback @@ -315,8 +316,8 @@ class HomePresenter( } } } catch (e: Exception) { - // TODO: Report error - // Sentry.captureException(e) { scope -> scope.setContext("feed_url", feedLink) } + BugsnagKotlin.setCustomValue(section = "AddingFeed", key = "feed_url", value = feedLink) + BugsnagKotlin.sendHandledException(e) effects.emit(HomeEffect.ShowError(HomeErrorType.Unknown(e))) } finally { _state.update { @@ -335,10 +336,8 @@ class HomePresenter( effects.emit(HomeEffect.ShowError(HomeErrorType.UnknownFeedType)) } is XmlParsingError -> { - // TODO: Report error - // Sentry.captureException(feedAddResult.exception) { scope -> - // scope.setContext("feed_url", feedLink) - // } + BugsnagKotlin.setCustomValue("AddingFeed", key = "feed_url", value = feedLink) + BugsnagKotlin.sendHandledException(feedAddResult.exception) effects.emit(HomeEffect.ShowError(HomeErrorType.FailedToParseXML)) } is ConnectTimeoutException, @@ -346,10 +345,8 @@ class HomePresenter( effects.emit(HomeEffect.ShowError(HomeErrorType.Timeout)) } else -> { - // TODO: Report error - // Sentry.captureException(feedAddResult.exception) { scope -> - // scope.setContext("feed_url", feedLink) - // } + BugsnagKotlin.setCustomValue("AddingFeed", key = "feed_url", value = feedLink) + BugsnagKotlin.sendHandledException(feedAddResult.exception) effects.emit(HomeEffect.ShowError(HomeErrorType.Unknown(feedAddResult.exception))) } } @@ -380,10 +377,8 @@ class HomePresenter( } private fun handleDatabaseErrors(databaseError: FeedAddResult.DatabaseError, feedLink: String) { - // TODO: Report error - // Sentry.captureException(databaseError.exception) { scope -> - // scope.setContext("feed_url", feedLink) - // } + BugsnagKotlin.setCustomValue("AddingFeed", key = "feed_url", value = feedLink) + BugsnagKotlin.sendHandledException(databaseError.exception) } private fun feedsSheetStateChanged(feedsSheetState: BottomSheetValue) { @@ -420,8 +415,8 @@ class HomePresenter( rssRepository.updateFeeds() } } catch (e: Exception) { - // TODO: Report error - // Sentry.captureException(e) + BugsnagKotlin.logMessage("RefreshContent") + BugsnagKotlin.sendHandledException(e) } finally { _state.update { it.copy(loadingState = HomeLoadingState.Idle) } } diff --git a/shared/src/commonMain/kotlin/dev/sasikanth/rss/reader/opml/FeedsOpml.kt b/shared/src/commonMain/kotlin/dev/sasikanth/rss/reader/opml/FeedsOpml.kt index 108d4fd9a..8f61c0c1a 100644 --- a/shared/src/commonMain/kotlin/dev/sasikanth/rss/reader/opml/FeedsOpml.kt +++ b/shared/src/commonMain/kotlin/dev/sasikanth/rss/reader/opml/FeedsOpml.kt @@ -15,6 +15,7 @@ */ package dev.sasikanth.rss.reader.opml +import co.touchlab.crashkios.bugsnag.BugsnagKotlin import dev.sasikanth.rss.reader.core.model.local.Feed import dev.sasikanth.rss.reader.di.scopes.AppScope import kotlinx.serialization.serializer @@ -50,8 +51,7 @@ class FeedsOpml { .appendLine() .toString() } catch (e: Exception) { - // TODO: Report error - // Sentry.captureException(e) + BugsnagKotlin.sendHandledException(e) "" } } @@ -73,8 +73,7 @@ class FeedsOpml { opmlFeeds.distinctBy { it.link } } catch (e: Exception) { - // TODO: Report error - // Sentry.captureException(e) + BugsnagKotlin.sendHandledException(e) emptyList() } } From b2f0e0a5bfe7ae6e07b1386c32d3fdfcced8b466 Mon Sep 17 00:00:00 2001 From: Sasikanth Miriyampalli Date: Wed, 14 Feb 2024 07:04:56 +0530 Subject: [PATCH 11/15] Remove unused Sentry usages --- .github/workflows/android_prod_release.yml | 4 ---- .github/workflows/ios_prod_release.yml | 1 - 2 files changed, 5 deletions(-) diff --git a/.github/workflows/android_prod_release.yml b/.github/workflows/android_prod_release.yml index 139c33d71..572b9100e 100644 --- a/.github/workflows/android_prod_release.yml +++ b/.github/workflows/android_prod_release.yml @@ -14,10 +14,6 @@ jobs: TERM: dumb ORG_GRADLE_PROJECT_READER_KEYSTORE_PASSWORD: ${{ secrets.READER_KEYSTORE_PASSWORD }} ORG_GRADLE_PROJECT_READER_KEY_PASSWORD: ${{ secrets.READER_KEY_PASSWORD }} - SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }} - SENTRY_PROJECT: ${{ secrets.SENTRY_PROJECT }} - SENTRY_ORG: ${{ secrets.SENTRY_ORG }} - SENTRY_DSN: ${{ secrets.SENTRY_DSN }} steps: - name: Configure Tramline id: tramline diff --git a/.github/workflows/ios_prod_release.yml b/.github/workflows/ios_prod_release.yml index a7582a4f4..8bf9ea14d 100644 --- a/.github/workflows/ios_prod_release.yml +++ b/.github/workflows/ios_prod_release.yml @@ -12,7 +12,6 @@ jobs: runs-on: macos-14 env: TERM: dumb - SENTRY_DSN: ${{ secrets.SENTRY_DSN }} BUGSNAG_API_KEY: ${{ secrets.BUGSNAG_API_KEY }} steps: - name: Configure Tramline From 6b9a180aa21d781b6230d59a4054bfb6ca5453b1 Mon Sep 17 00:00:00 2001 From: Sasikanth Miriyampalli Date: Wed, 14 Feb 2024 07:14:32 +0530 Subject: [PATCH 12/15] Add bugsnag as a pod --- iosApp/iosApp.xcodeproj/project.pbxproj | 18 ++++++++++++++++++ shared/build.gradle.kts | 1 + 2 files changed, 19 insertions(+) diff --git a/iosApp/iosApp.xcodeproj/project.pbxproj b/iosApp/iosApp.xcodeproj/project.pbxproj index 36b76622d..9feca9554 100644 --- a/iosApp/iosApp.xcodeproj/project.pbxproj +++ b/iosApp/iosApp.xcodeproj/project.pbxproj @@ -123,6 +123,7 @@ 7555FF79242A565900829871 /* Resources */, F85CB1118929364A9C6EFABC /* Frameworks */, 2134C13603D0B299603D9F49 /* [CP] Copy Pods Resources */, + 599E3F199C42E8E830BDD65E /* [CP] Embed Pods Frameworks */, ); buildRules = ( ); @@ -196,6 +197,23 @@ shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-iosApp/Pods-iosApp-resources.sh\"\n"; showEnvVarsInLog = 0; }; + 599E3F199C42E8E830BDD65E /* [CP] Embed Pods Frameworks */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-iosApp/Pods-iosApp-frameworks-${CONFIGURATION}-input-files.xcfilelist", + ); + name = "[CP] Embed Pods Frameworks"; + outputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-iosApp/Pods-iosApp-frameworks-${CONFIGURATION}-output-files.xcfilelist", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-iosApp/Pods-iosApp-frameworks.sh\"\n"; + showEnvVarsInLog = 0; + }; 98D614C51D2DA07C614CC46E /* [CP] Check Pods Manifest.lock */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; diff --git a/shared/build.gradle.kts b/shared/build.gradle.kts index 7530657c2..87bee26c8 100644 --- a/shared/build.gradle.kts +++ b/shared/build.gradle.kts @@ -55,6 +55,7 @@ kotlin { homepage = "https://github.com/msasikanth/rss_reader" ios.deploymentTarget = "15.0" podfile = project.file("../iosApp/Podfile") + pod("Bugsnag") framework { baseName = "shared" From 52f54ab1ee422b84e56dc822fa974d9c10025e14 Mon Sep 17 00:00:00 2001 From: Sasikanth Miriyampalli Date: Wed, 14 Feb 2024 07:20:33 +0530 Subject: [PATCH 13/15] Update build archive command in iOS prod release workflow --- .github/workflows/ios_prod_release.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ios_prod_release.yml b/.github/workflows/ios_prod_release.yml index 8bf9ea14d..7d9e0ac6c 100644 --- a/.github/workflows/ios_prod_release.yml +++ b/.github/workflows/ios_prod_release.yml @@ -70,8 +70,7 @@ jobs: - name: Build Archive run: | - xcodebuild BUGSNAG_API_KEY=${BUGSNAG_API_KEY} - -workspace ./iosApp/iosApp.xcworkspace \ + xcodebuild -workspace ./iosApp/iosApp.xcworkspace \ -scheme iosApp \ -archivePath $RUNNER_TEMP/twine.xcarchive \ -sdk iphoneos \ @@ -79,6 +78,7 @@ jobs: -destination generic/platform=iOS \ DEVELOPMENT_TEAM=6XCS8KZXDA \ PROVISIONING_PROFILE=${{ secrets.PROVISION_PROFILE_ID }} \ + BUGSNAG_API_KEY=${BUGSNAG_API_KEY} \ clean archive CODE_SIGN_IDENTITY="iPhone Distribution: Sasi Kanth (6XCS8KZXDA)" From dfa6b4cb0071565e14bd036b357548e2a85a1daf Mon Sep 17 00:00:00 2001 From: Sasikanth Miriyampalli Date: Wed, 14 Feb 2024 07:44:46 +0530 Subject: [PATCH 14/15] Fix curl command for upload dSYM to Bugsnag --- .github/workflows/ios_prod_release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ios_prod_release.yml b/.github/workflows/ios_prod_release.yml index 7d9e0ac6c..541c56d9c 100644 --- a/.github/workflows/ios_prod_release.yml +++ b/.github/workflows/ios_prod_release.yml @@ -93,7 +93,7 @@ jobs: - name: Upload debug symbols to Bugsnag run: | cd $RUNNER_TEMP/twine.xcarchive/dSYMs/; - curl -http1.1 https://upload.bugsnag.com/ \ + curl --http1.1 https://upload.bugsnag.com/ \ -F apiKey=${BUGSNAG_API_KEY} \ -F dsym=@Twine.app.dSYM/Contents/Resources/DWARF/MyApp \ From 4ac390420914788f21a60fe7d8588b419e37e97a Mon Sep 17 00:00:00 2001 From: Sasikanth Miriyampalli Date: Wed, 14 Feb 2024 07:45:46 +0530 Subject: [PATCH 15/15] Change dSYM path in upload to Bugsnag step --- .github/workflows/ios_prod_release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ios_prod_release.yml b/.github/workflows/ios_prod_release.yml index 541c56d9c..679746aed 100644 --- a/.github/workflows/ios_prod_release.yml +++ b/.github/workflows/ios_prod_release.yml @@ -95,7 +95,7 @@ jobs: cd $RUNNER_TEMP/twine.xcarchive/dSYMs/; curl --http1.1 https://upload.bugsnag.com/ \ -F apiKey=${BUGSNAG_API_KEY} \ - -F dsym=@Twine.app.dSYM/Contents/Resources/DWARF/MyApp \ + -F dsym=@Twine.app.dSYM/Contents/Resources/DWARF/Twine \ - name: Clean up keychain and provisioning profile if: ${{ always() }}