Skip to content

Commit

Permalink
Merge pull request #1758 from bugsnag/release/v5.27.0
Browse files Browse the repository at this point in the history
Release v5.27.0
  • Loading branch information
lemnik authored Oct 6, 2022
2 parents 99ecf57 + e3bb215 commit a84cfda
Show file tree
Hide file tree
Showing 80 changed files with 2,616 additions and 193 deletions.
54 changes: 52 additions & 2 deletions .buildkite/pipeline.full.yml
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ steps:
- "--exclude=features/full_tests/[^a-k].*.feature"
- "--app=/app/build/fixture-r19.apk"
- "--farm=bs"
- "--device=ANDROID_7_1_SAMSUNG_GALAXY_NOTE_8"
- "--device=ANDROID_7_1"
- "--fail-fast"
env:
TEST_FIXTURE_SYMBOL_DIR: "build/fixture-r19"
Expand All @@ -176,7 +176,7 @@ steps:
- "--exclude=features/full_tests/[^l-z].*.feature"
- "--app=/app/build/fixture-r19.apk"
- "--farm=bs"
- "--device=ANDROID_7_1_SAMSUNG_GALAXY_NOTE_8"
- "--device=ANDROID_7_1"
- "--fail-fast"
env:
TEST_FIXTURE_SYMBOL_DIR: "build/fixture-r19"
Expand Down Expand Up @@ -388,6 +388,56 @@ steps:
concurrency_group: 'browserstack-app'
concurrency_method: eager

- label: ':android: Android 13 Beta NDK r21 end-to-end tests - batch 1'
depends_on: "fixture-r21"
timeout_in_minutes: 60
plugins:
artifacts#v1.2.0:
download:
- "build/fixture-r21.apk"
- "build/fixture-r21/*"
upload: "maze_output/failed/**/*"
docker-compose#v3.7.0:
pull: android-maze-runner
run: android-maze-runner
command:
- "features/full_tests"
- "--exclude=features/full_tests/[^a-k].*.feature"
- "--app=/app/build/fixture-r21.apk"
- "--farm=bs"
- "--device=ANDROID_13_0_BETA"
- "--fail-fast"
env:
TEST_FIXTURE_SYMBOL_DIR: "build/fixture-r21"
concurrency: 24
concurrency_group: 'browserstack-app'
concurrency_method: eager

- label: ':android: Android 13 Beta NDK r21 end-to-end tests - batch 2'
depends_on: "fixture-r21"
timeout_in_minutes: 60
plugins:
artifacts#v1.2.0:
download:
- "build/fixture-r21.apk"
- "build/fixture-r21/*"
upload: "maze_output/failed/**/*"
docker-compose#v3.7.0:
pull: android-maze-runner
run: android-maze-runner
command:
- "features/full_tests"
- "--exclude=features/full_tests/[^l-z].*.feature"
- "--app=/app/build/fixture-r21.apk"
- "--farm=bs"
- "--device=ANDROID_13_0_BETA"
- "--fail-fast"
env:
TEST_FIXTURE_SYMBOL_DIR: "build/fixture-r21"
concurrency: 24
concurrency_group: 'browserstack-app'
concurrency_method: eager

# If there is a tag present activate a manual publishing step

- block: 'Trigger package publish'
Expand Down
2 changes: 1 addition & 1 deletion .buildkite/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ steps:
- "features/smoke_tests"
- "--app=/app/build/fixture-r19.apk"
- "--farm=bs"
- "--device=ANDROID_7_1_SAMSUNG_GALAXY_NOTE_8"
- "--device=ANDROID_7_1"
- "--fail-fast"
concurrency: 24
concurrency_group: 'browserstack-app'
Expand Down
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changelog

## 5.27.0 (2022-10-06)

### Enhancements

* Setting `Configuration.attemptDeliveryOnCrash` will cause Bugsnag to attempt error delivery during some crashes.
Use of this feature is discouraged, see the method JavaDoc for more information.
[#1749](https://github.com/bugsnag/bugsnag-android/pull/1749)

## 5.26.0 (2022-08-18)

### Enhancements
Expand Down
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ source "https://rubygems.org"
#gem 'bugsnag-maze-runner', path: '../maze-runner'

# Or a specific release:
gem 'bugsnag-maze-runner', git: 'https://github.com/bugsnag/maze-runner', tag: 'v6.15.0'
gem 'bugsnag-maze-runner', git: 'https://github.com/bugsnag/maze-runner', tag: 'v6.26.1'

# Or follow master:
# gem 'bugsnag-maze-runner', git: 'https://github.com/bugsnag/maze-runner'
Expand Down
8 changes: 4 additions & 4 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
GIT
remote: https://github.com/bugsnag/maze-runner
revision: d71ba8a1b770e86800b4e9f6782a63fef019a989
tag: v6.15.0
revision: 8cbfd525f4534afa4560bc8e4fbb80e92718cd80
tag: v6.26.1
specs:
bugsnag-maze-runner (6.15.0)
bugsnag-maze-runner (6.26.1)
appium_lib (~> 11.2.0)
bugsnag (~> 6.24)
cucumber (~> 7.1)
Expand Down Expand Up @@ -81,7 +81,7 @@ GEM
mime-types-data (~> 3.2015)
mime-types-data (3.2022.0105)
multi_test (0.1.2)
nokogiri (1.13.6-x86_64-darwin)
nokogiri (1.13.8-x86_64-darwin)
racc (~> 1.4)
optimist (3.0.1)
os (1.0.1)
Expand Down
2 changes: 2 additions & 0 deletions bugsnag-android-core/detekt-baseline.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<SmellBaseline>
<ManuallySuppressedIssues/>
<CurrentIssues>
<ID>ComplexMethod:ConfigInternal.kt$ConfigInternal$fun getConfigDifferences(): Map&lt;String, Any></ID>
<ID>ImplicitDefaultLocale:DeliveryHeaders.kt$String.format("%02x", byte)</ID>
<ID>LongParameterList:App.kt$App$( /** * The architecture of the running application binary */ var binaryArch: String?, /** * The package name of the application */ var id: String?, /** * The release stage set in [Configuration.releaseStage] */ var releaseStage: String?, /** * The version of the application set in [Configuration.version] */ var version: String?, /** The revision ID from the manifest (React Native apps only) */ var codeBundleId: String?, /** * The unique identifier for the build of the application set in [Configuration.buildUuid] */ var buildUuid: String?, /** * The application type set in [Configuration#version] */ var type: String?, /** * The version code of the application set in [Configuration.versionCode] */ var versionCode: Number? )</ID>
<ID>LongParameterList:AppDataCollector.kt$AppDataCollector$( appContext: Context, private val packageManager: PackageManager?, private val config: ImmutableConfig, private val sessionTracker: SessionTracker, private val activityManager: ActivityManager?, private val launchCrashTracker: LaunchCrashTracker, private val memoryTrimState: MemoryTrimState )</ID>
Expand Down Expand Up @@ -47,6 +48,7 @@
<ID>SwallowedException:DeviceDataCollector.kt$DeviceDataCollector$catch (exception: Exception) { logger.w("Could not get battery status") }</ID>
<ID>SwallowedException:DeviceDataCollector.kt$DeviceDataCollector$catch (exception: Exception) { logger.w("Could not get locationStatus") }</ID>
<ID>SwallowedException:DeviceIdFilePersistence.kt$DeviceIdFilePersistence$catch (exc: OverlappingFileLockException) { Thread.sleep(FILE_LOCK_WAIT_MS) }</ID>
<ID>SwallowedException:InternalMetrics.kt$InternalMetrics$catch (exc: Exception) { null }</ID>
<ID>SwallowedException:JsonHelperTest.kt$JsonHelperTest$catch (e: IllegalArgumentException) { didThrow = true }</ID>
<ID>SwallowedException:PluginClient.kt$PluginClient$catch (exc: ClassNotFoundException) { logger.d("Plugin '$clz' is not on the classpath - functionality will not be enabled.") null }</ID>
<ID>ThrowsCount:JsonHelper.kt$JsonHelper$ fun jsonToLong(value: Any?): Long?</ID>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ class ManifestConfigLoaderTest {
putBoolean("com.bugsnag.android.SEND_LAUNCH_CRASHES_SYNCHRONOUSLY", false)
putString("com.bugsnag.android.APP_TYPE", "react-native")
putString("com.bugsnag.android.CODE_BUNDLE_ID", "123")
putBoolean("com.bugsnag.android.ATTEMPT_DELIVERY_ON_CRASH", true)
}

val config = configLoader.load(data, null)
Expand Down Expand Up @@ -128,6 +129,7 @@ class ManifestConfigLoaderTest {
assertEquals(launchDurationMillis, 7000)
assertFalse(sendLaunchCrashesSynchronously)
assertEquals("react-native", appType)
assertTrue(isAttemptDeliveryOnCrash)
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,22 +1,20 @@
package com.bugsnag.android

import com.bugsnag.android.internal.dag.ConfigModule
import com.bugsnag.android.internal.ImmutableConfig
import com.bugsnag.android.internal.dag.DependencyModule

/**
* A dependency module which constructs the objects that track state in Bugsnag. For example, this
* class is responsible for creating classes which track the current breadcrumb/metadata state.
*/
internal class BugsnagStateModule(
configModule: ConfigModule,
cfg: ImmutableConfig,
configuration: Configuration
) : DependencyModule() {

private val cfg = configModule.config

val clientObservable = ClientObservable()

val callbackState = configuration.impl.callbackState.copy()
val callbackState = configuration.impl.callbackState

val contextState = ContextState().apply {
if (configuration.context != null) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package com.bugsnag.android

import com.bugsnag.android.internal.InternalMetrics
import com.bugsnag.android.internal.InternalMetricsNoop
import java.util.concurrent.CopyOnWriteArrayList

internal data class CallbackState(
Expand All @@ -9,36 +11,66 @@ internal data class CallbackState(
val onSendTasks: MutableCollection<OnSendCallback> = CopyOnWriteArrayList()
) : CallbackAware {

private var internalMetrics: InternalMetrics = InternalMetricsNoop()

companion object {
private const val onBreadcrumbName = "onBreadcrumb"
private const val onErrorName = "onError"
private const val onSendName = "onSendError"
private const val onSessionName = "onSession"
}

fun setInternalMetrics(metrics: InternalMetrics) {
internalMetrics = metrics
internalMetrics.setCallbackCounts(getCallbackCounts())
}

override fun addOnError(onError: OnErrorCallback) {
onErrorTasks.add(onError)
if (onErrorTasks.add(onError)) {
internalMetrics.notifyAddCallback(onErrorName)
}
}

override fun removeOnError(onError: OnErrorCallback) {
onErrorTasks.remove(onError)
if (onErrorTasks.remove(onError)) {
internalMetrics.notifyRemoveCallback(onErrorName)
}
}

override fun addOnBreadcrumb(onBreadcrumb: OnBreadcrumbCallback) {
onBreadcrumbTasks.add(onBreadcrumb)
if (onBreadcrumbTasks.add(onBreadcrumb)) {
internalMetrics.notifyAddCallback(onBreadcrumbName)
}
}

override fun removeOnBreadcrumb(onBreadcrumb: OnBreadcrumbCallback) {
onBreadcrumbTasks.remove(onBreadcrumb)
if (onBreadcrumbTasks.remove(onBreadcrumb)) {
internalMetrics.notifyRemoveCallback(onBreadcrumbName)
}
}

override fun addOnSession(onSession: OnSessionCallback) {
onSessionTasks.add(onSession)
if (onSessionTasks.add(onSession)) {
internalMetrics.notifyAddCallback(onSessionName)
}
}

override fun removeOnSession(onSession: OnSessionCallback) {
onSessionTasks.remove(onSession)
if (onSessionTasks.remove(onSession)) {
internalMetrics.notifyRemoveCallback(onSessionName)
}
}

fun addOnSend(onSend: OnSendCallback) {
onSendTasks.add(onSend)
if (onSendTasks.add(onSend)) {
internalMetrics.notifyAddCallback(onSendName)
}
}

fun removeOnSend(onSend: OnSendCallback) {
onSendTasks.remove(onSend)
if (onSendTasks.remove(onSend)) {
internalMetrics.notifyRemoveCallback(onSendName)
}
}

fun runOnErrorTasks(event: Event, logger: Logger): Boolean {
Expand Down Expand Up @@ -120,4 +152,13 @@ internal data class CallbackState(
onSessionTasks = onSessionTasks,
onSendTasks = onSendTasks
)

private fun getCallbackCounts(): Map<String, Int> {
return hashMapOf<String, Int>().also { map ->
if (onBreadcrumbTasks.count() > 0) map[onBreadcrumbName] = onBreadcrumbTasks.count()
if (onErrorTasks.count() > 0) map[onErrorName] = onErrorTasks.count()
if (onSendTasks.count() > 0) map[onSendName] = onSendTasks.count()
if (onSessionTasks.count() > 0) map[onSessionName] = onSessionTasks.count()
}
}
}
Loading

0 comments on commit a84cfda

Please sign in to comment.