Skip to content

Commit

Permalink
Merge pull request #811 from bugsnag/next
Browse files Browse the repository at this point in the history
Release v8.0.0
  • Loading branch information
richardelms authored Jun 12, 2024
2 parents 30c6c5b + f71e078 commit c5026d9
Show file tree
Hide file tree
Showing 36 changed files with 403 additions and 320 deletions.
8 changes: 1 addition & 7 deletions .buildkite/pipeline.full.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ aliases:
- &2020 "2020.3.48f1"
- &2021 "2021.3.36f1"
- &2022 "2022.3.22f1"
- &2023 "2023.2.17f1"
- &2023 "2023.2.19f1"


agents:
Expand Down Expand Up @@ -186,8 +186,6 @@ steps:
- label: Run WebGL e2e tests for Unity 2020
timeout_in_minutes: 30
depends_on: "cocoa-webgl-2020-fixtures"
agents:
queue: opensource-mac-cocoa-11
env:
UNITY_VERSION: *2020
plugins:
Expand Down Expand Up @@ -221,8 +219,6 @@ steps:
- label: Run WebGL e2e tests for Unity 2022
timeout_in_minutes: 30
depends_on: 'cocoa-webgl-2022-fixtures'
agents:
queue: opensource-mac-cocoa-11
env:
UNITY_VERSION: *2022
plugins:
Expand All @@ -238,8 +234,6 @@ steps:
- label: Run WebGL e2e tests for Unity 2023
timeout_in_minutes: 30
depends_on: 'cocoa-webgl-2023-fixtures'
agents:
queue: opensource-mac-cocoa-11
env:
UNITY_VERSION: *2023
plugins:
Expand Down
1 change: 0 additions & 1 deletion .buildkite/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,6 @@ steps:
- "--device=ANDROID_10|ANDROID_11|ANDROID_12|ANDROID_13"
- "--no-tunnel"
- "--aws-public-ip"
- "--fail-fast"
concurrency: 25
concurrency_group: "bitbar"
concurrency_method: eager
Expand Down
268 changes: 45 additions & 223 deletions CHANGELOG.md

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -133,15 +133,15 @@ def assemble_android filter_abis=true

# copy unity lib
unity_lib = File.join("bugsnag-android-unity", "build", "outputs", "aar", "bugsnag-android-unity-release.aar")

FileUtils.cp android_core_lib, File.join(android_dir, "bugsnag-android-release.aar")
FileUtils.cp ndk_lib, File.join(android_dir, "bugsnag-android-ndk-release.aar")
FileUtils.cp ndk_lib, File.join(android_dir, "bugsnag-plugin-android-ndk-release.aar")
FileUtils.cp anr_lib, File.join(android_dir, "bugsnag-plugin-android-anr-release.aar")
FileUtils.cp unity_lib, File.join(android_dir, "bugsnag-android-unity-release.aar")
FileUtils.mkdir File.join(android_dir, "Kotlin")
FileUtils.cp kotlin_stdlib, File.join(android_dir, "Kotlin/kotlin-stdlib.jar")
FileUtils.cp kotlin_stdlib_common, File.join(android_dir, "Kotlin/kotlin-stdlib-common.jar")
FileUtils.cp kotlin_annotations, File.join(android_dir, "Kotlin/kotlin-annotations.jar")

end

namespace :plugin do
Expand Down
8 changes: 8 additions & 0 deletions UPGRADING.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
Upgrading
=========

## 7.x to 8.x

`Configuration.DiscardClasses` and `Configuration.RedactedKeys` are now [Regex](https://learn.microsoft.com/en-us/dotnet/api/system.text.regularexpressions.regex?view=net-8.0) collections instead of string collections. This allows developers to have more control over how they perform.

If you are using the `DiscardClasses` and `RedactedKeys` sections of the Bugsnag Unity Configuration Window, you can enter Regex patterns as strings and they will be converted into Regex objects when the Bugsnag SDK is started.

`Event.Unhandled` (accessed via OnError and OnSend callbacks) is now non-nullable.

## 6.x to 7.x

When building using Unity 2019+, the Bugsnag SDK now uses a new method to intercept uncaught C# exceptions. This allows us access to the original exception object, meaning more accurate exception data and full support for inner exceptions.
Expand Down
Binary file not shown.
Binary file not shown.
2 changes: 1 addition & 1 deletion bugsnag-android
Submodule bugsnag-android updated 366 files
2 changes: 1 addition & 1 deletion build.cake
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ var target = Argument("target", "Default");
var solution = File("./BugsnagUnity.sln");
var configuration = Argument("configuration", "Release");
var project = File("./src/BugsnagUnity/BugsnagUnity.csproj");
var version = "7.7.6";
var version = "8.0.0";

Task("Restore-NuGet-Packages")
.Does(() => NuGetRestore(solution));
Expand Down
2 changes: 1 addition & 1 deletion features/csharp/csharp_config.feature
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ Feature: csharp events
And the event "breadcrumbs.1.metaData.dictionary.stringArray.0" equals "12345678901234567890***80 CHARS TRUNCATED***"
And the event "breadcrumbs.1.metaData.stringDictionary.testKey" equals "12345678901234567890***80 CHARS TRUNCATED***"

@skip_cocoa @skip_android #not supported on these platforms
@skip_cocoa #not supported on these platforms
Scenario: GenerateAnonymousId
When I run the game in the "GenerateAnonymousId" state
And I wait to receive an error
Expand Down
4 changes: 4 additions & 0 deletions features/fixtures/maze_runner/Assets/Scripts/Scenario.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ public virtual void PrepareConfig(string apiKey, string host)
Configuration.DotnetScriptingRuntime = FindDotnetScriptingRuntime();
Configuration.DotnetApiCompatibility = FindDotnetApiCompatibility();
Configuration.AutoTrackSessions = false;
if (Application.platform == RuntimePlatform.IPhonePlayer)
{
Configuration.EnabledErrorTypes.OOMs = false;
}
}

public void AddSwitchConfigValues(SwitchCacheType switchCacheType, int switchCacheIndex, string switchMountName)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
using BugsnagUnity;
using System.Collections.Generic;
using System.Text.RegularExpressions;
using BugsnagUnity;

public class DiscardErrorClass : Scenario
{
public override void PrepareConfig(string apiKey, string host)
{
base.PrepareConfig(apiKey, host);
Configuration.DiscardClasses = new string[] { "IndexOutOfRangeException" };
Configuration.DiscardClasses = new List<Regex> { new Regex("IndexOutOfRangeException") };
}

public override void Run()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
public class RedactedKeys : Scenario
using System.Collections.Generic;
using System.Text.RegularExpressions;

public class RedactedKeys : Scenario
{
public override void PrepareConfig(string apiKey, string host)
{
base.PrepareConfig(apiKey, host);
Configuration.RedactedKeys = new string[] { "testKey" };
Configuration.RedactedKeys = new List<Regex> { new Regex("testKey") };
Configuration.AddMetadata("testSection","testKey","testValue");
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,6 @@ public class CorruptedCacheFile : Scenario
public override void PrepareConfig(string apiKey, string host)
{
base.PrepareConfig(apiKey, host);
if (Application.platform == RuntimePlatform.IPhonePlayer)
{
Configuration.EnabledErrorTypes.OOMs = false;
}
}

public override void Run()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,6 @@ public override void PrepareConfig(string apiKey, string host)
{
base.PrepareConfig(apiKey, host);
Configuration.MaxPersistedEvents = 3;
if (Application.platform == RuntimePlatform.IPhonePlayer)
{
Configuration.EnabledErrorTypes.OOMs = false;
}
}

public override void Run()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,6 @@ public class PersistDeviceId : Scenario
public override void PrepareConfig(string apiKey, string host)
{
base.PrepareConfig(apiKey, host);
if (Application.platform == RuntimePlatform.IPhonePlayer)
{
Configuration.EnabledErrorTypes.OOMs = false;
}
}

public override void Run()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,6 @@ public override void PrepareConfig(string apiKey, string host)
{
base.PrepareConfig(apiKey, host);
Configuration.Context = "Error 1";
if (Application.platform == RuntimePlatform.IPhonePlayer)
{
Configuration.EnabledErrorTypes.OOMs = false;
}
}

public override void Run()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,6 @@ public override void PrepareConfig(string apiKey, string host)
{
base.PrepareConfig(apiKey, host);
Configuration.Context = "Error 2";
if (Application.platform == RuntimePlatform.IPhonePlayer)
{
Configuration.EnabledErrorTypes.OOMs = false;
}
}

public override void Run()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,6 @@ public override void PrepareConfig(string apiKey, string host)

return true;
});
if (Application.platform == RuntimePlatform.IPhonePlayer)
{
Configuration.EnabledErrorTypes.OOMs = false;
}
}

public override void Run()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,6 @@ public override void PrepareConfig(string apiKey, string host)
{
_eventsCorrect = CheckForEvents();
base.PrepareConfig(apiKey, host);
if (Application.platform == RuntimePlatform.IPhonePlayer)
{
Configuration.EnabledErrorTypes.OOMs = false;
}
}

private bool CheckForEvents()
Expand Down
3 changes: 1 addition & 2 deletions features/ios/ios_native_errors.feature
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ Feature: iOS Native Errors
And I wait for 2 seconds
And On Mobile I relaunch the app
And I run the game in the "StartSDKDefault" state
And I wait to receive an error
And the exception "message" equals "The app was likely terminated by the operating system while in the foreground"
And I should receive no errors

Scenario: Last Run Info
When I run the game in the "IosNativeException" state
Expand Down
10 changes: 8 additions & 2 deletions features/support/env.rb
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,6 @@

BeforeAll do
$api_key = 'a35a2a72bd230ac0aa0f52715bbdc6aa'
Maze.config.enforce_bugsnag_integrity = false

if Maze.config.os&.downcase == 'macos'
# The default macOS Crash Reporter "#{app_name} quit unexpectedly" alert grabs focus which can cause tests to flake.
# This option, which appears to have been introduced in macOS 10.11, displays a notification instead of the alert.
Expand Down Expand Up @@ -113,6 +111,14 @@
end
end

Before do |scenario|
# Detect if we're running the webgl tests
if Maze.config.farm.to_s.eql?('local')
# Allows each scenario to auto retry once due to instability in the local browser
scenario.tags << Cucumber::Core::Test::Tag.new(nil, '@retry')
end
end

After do |scenario|
next if scenario.status == :skipped

Expand Down
1 change: 1 addition & 0 deletions src/Assets/Bugsnag/Editor/BugsnagEditor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@ private void DrawAdvancedSettings(SerializedObject so, BugsnagSettingsObject set
}
EditorGUILayout.PropertyField(so.FindProperty("AutoDetectErrors"));
EditorGUILayout.PropertyField(so.FindProperty("AutoTrackSessions"));
EditorGUILayout.PropertyField(so.FindProperty("GenerateAnonymousId"));
EditorGUILayout.PropertyField(so.FindProperty("BreadcrumbLogLevel"));
EditorGUILayout.PropertyField(so.FindProperty("Context"));
EditorGUILayout.PropertyField(so.FindProperty("DiscardClasses"));
Expand Down
28 changes: 24 additions & 4 deletions src/Assets/Bugsnag/Scripts/BugsnagSettingsObject.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,15 @@ public class BugsnagSettingsObject : ScriptableObject
public bool PersistUser = true;
public string SessionEndpoint = "https://sessions.bugsnag.com";
public ThreadSendPolicy SendThreads = ThreadSendPolicy.UnhandledOnly;
public string[] RedactedKeys = new string[] { "password" };
public string[] RedactedKeys = new string[] { ".*password.*" };
public string ReleaseStage;
public bool ReportExceptionLogsAsHandled = true;
public bool SendLaunchCrashesSynchronously = true;
public double SecondsPerUniqueLog = 5;
public List<TelemetryType> Telemetry = new List<TelemetryType> { TelemetryType.InternalErrors, TelemetryType.Usage };
public int VersionCode = -1;

public bool GenerateAnonymousId = true;
public SwitchCacheType SwitchCacheType = SwitchCacheType.R;
public string SwitchCacheMountName = "BugsnagCache";
public int SwitchCacheIndex = 0;
Expand Down Expand Up @@ -79,7 +80,16 @@ public Configuration GetConfig()

config.BreadcrumbLogLevel = GetLogTypeFromLogLevel( BreadcrumbLogLevel );
config.Context = Context;
config.DiscardClasses = DiscardClasses;
foreach(string discardedClass in DiscardClasses){
try
{
config.DiscardClasses.Add(new System.Text.RegularExpressions.Regex(discardedClass));
}
catch (ArgumentException e)
{
Debug.LogError("Invalid Regex pattern for discard class: " + e.Message);
}
}
if (EnabledReleaseStages != null && EnabledReleaseStages.Length > 0)
{
config.EnabledReleaseStages = EnabledReleaseStages;
Expand All @@ -98,7 +108,17 @@ public Configuration GetConfig()
{
config.Endpoints = new EndpointConfiguration(NotifyEndpoint, SessionEndpoint);
}
config.RedactedKeys = RedactedKeys;
foreach(string key in RedactedKeys)
{
try
{
config.RedactedKeys.Add(new System.Text.RegularExpressions.Regex(key));
}
catch (ArgumentException e)
{
Debug.LogError("Invalid Regex pattern for redacted key: " + e.Message);
}
}
if (string.IsNullOrEmpty(ReleaseStage))
{
config.ReleaseStage = Debug.isDebugBuild ? "development" : "production";
Expand All @@ -113,7 +133,7 @@ public Configuration GetConfig()
config.SecondsPerUniqueLog = TimeSpan.FromSeconds(SecondsPerUniqueLog);
config.Telemetry = Telemetry;
config.VersionCode = VersionCode;

config.GenerateAnonymousId = GenerateAnonymousId;
config.SwitchCacheType = SwitchCacheType;
config.SwitchCacheIndex = SwitchCacheIndex;
config.SwitchCacheMaxSize = SwitchCacheMaxSize;
Expand Down
8 changes: 7 additions & 1 deletion src/BugsnagUnity/Bugsnag.cs
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,13 @@ public static bool IsStarted()
/// the tracking of in foreground time for the application.
/// </summary>
/// <param name="inFocus"></param>
public static void SetApplicationState(bool inFocus) => Client.SetApplicationState(inFocus);
public static void SetApplicationState(bool inFocus)
{
if(Client != null)
{
Client.SetApplicationState(inFocus);
}
}

/// <summary>
/// Bugsnag uses the concept of contexts to help display and group your errors.
Expand Down
Loading

0 comments on commit c5026d9

Please sign in to comment.