Skip to content

Commit

Permalink
Merge pull request #128 from bugsnag/release-v1.1.0
Browse files Browse the repository at this point in the history
Release v1.1.0
  • Loading branch information
nickdowell authored Feb 2, 2022
2 parents cf9874a + 75a4adf commit 85f530d
Show file tree
Hide file tree
Showing 35 changed files with 521 additions and 32 deletions.
62 changes: 46 additions & 16 deletions .buildkite/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,6 @@ env:

steps:

- name: 'Lint'
agents:
queue: opensource-mac-cocoa-11
command: make lint
timeout_in_minutes: 10

##############################################################################
#
# Build Plugin
Expand All @@ -22,7 +16,13 @@ steps:
env:
UE_VERSION: "4.23"
NDKROOT: /Users/administrator/Library/Android/sdk/ndk/16.1.4479499
command: make package
commands:
- rm -rf "/Users/administrator/Library/Logs/Unreal Engine/LocalBuildLogs/*"
- make package
plugins:
artifacts#v1.5.0:
upload:
- "/Users/administrator/Library/Logs/Unreal Engine/LocalBuildLogs/*"
artifact_paths: [Build/Plugin/*.zip]
timeout_in_minutes: 30

Expand All @@ -31,7 +31,13 @@ steps:
queue: opensource-mac-unreal-4.25
env:
UE_VERSION: "4.25"
command: make package
commands:
- rm -rf "/Users/administrator/Library/Logs/Unreal Engine/LocalBuildLogs/*"
- make package
plugins:
artifacts#v1.5.0:
upload:
- "/Users/administrator/Library/Logs/Unreal Engine/LocalBuildLogs/*"
artifact_paths: [Build/Plugin/*.zip]
timeout_in_minutes: 30

Expand All @@ -40,7 +46,13 @@ steps:
queue: opensource-mac-unreal-4.26
env:
UE_VERSION: "4.26"
command: make package
commands:
- rm -rf "/Users/administrator/Library/Logs/Unreal Engine/LocalBuildLogs/*"
- make package
plugins:
artifacts#v1.5.0:
upload:
- "/Users/administrator/Library/Logs/Unreal Engine/LocalBuildLogs/*"
artifact_paths: [Build/Plugin/*.zip]
timeout_in_minutes: 30

Expand All @@ -49,7 +61,13 @@ steps:
queue: opensource-mac-unreal-4.27
env:
UE_VERSION: "4.27"
command: make package
commands:
- rm -rf "/Users/administrator/Library/Logs/Unreal Engine/LocalBuildLogs/*"
- make package
plugins:
artifacts#v1.5.0:
upload:
- "/Users/administrator/Library/Logs/Unreal Engine/LocalBuildLogs/*"
artifact_paths: [Build/Plugin/*.zip]
timeout_in_minutes: 30

Expand All @@ -58,7 +76,13 @@ steps:
queue: opensource-mac-unreal-5
env:
UE_VERSION: "5.0EA"
command: make package
commands:
- rm -rf "/Users/administrator/Library/Logs/Unreal Engine/LocalBuildLogs/*"
- make package
plugins:
artifacts#v1.5.0:
upload:
- "/Users/administrator/Library/Logs/Unreal Engine/LocalBuildLogs/*"
artifact_paths: [Build/Plugin/*.zip]
timeout_in_minutes: 30

Expand Down Expand Up @@ -87,7 +111,10 @@ steps:
upload:
- features/fixtures/mobile/Binaries/Android/TestFixture-Android-Shipping-arm64.apk
- features/fixtures/mobile/Binaries/Android/TestFixture-Android-Shipping-armv7.apk
command: make features/fixtures/mobile/Binaries/Android/TestFixture-Android-Shipping-arm64.apk
- "/Users/administrator/Library/Logs/Unreal Engine/LocalBuildLogs/*"
commands:
- rm -rf "/Users/administrator/Library/Logs/Unreal Engine/LocalBuildLogs/*"
- make features/fixtures/mobile/Binaries/Android/TestFixture-Android-Shipping-arm64.apk
timeout_in_minutes: 60
key: android_fixture

Expand All @@ -101,7 +128,10 @@ steps:
upload:
- features/fixtures/mobile/Binaries/IOS/TestFixture-IOS-Shipping.dSYM
- features/fixtures/mobile/Binaries/IOS/TestFixture-IOS-Shipping.ipa
command: make features/fixtures/mobile/Binaries/IOS/TestFixture-IOS-Shipping.ipa
- "/Users/administrator/Library/Logs/Unreal Engine/LocalBuildLogs/*"
commands:
- rm -rf "/Users/administrator/Library/Logs/Unreal Engine/LocalBuildLogs/*"
- make features/fixtures/mobile/Binaries/IOS/TestFixture-IOS-Shipping.ipa
timeout_in_minutes: 60
key: ios_fixture

Expand All @@ -118,7 +148,7 @@ steps:
agents:
queue: opensource
plugins:
artifacts#v1.3.0:
artifacts#v1.5.0:
download:
- from: "features/fixtures/mobile/Binaries/Android/TestFixture-Android-Shipping-arm64.apk"
to: "build/TestFixture-Android-Shipping-arm64.apk"
Expand Down Expand Up @@ -146,7 +176,7 @@ steps:
agents:
queue: opensource
plugins:
artifacts#v1.3.0:
artifacts#v1.5.0:
download:
- from: "features/fixtures/mobile/Binaries/Android/TestFixture-Android-Shipping-armv7.apk"
to: "build/TestFixture-Android-Shipping-armv7.apk"
Expand Down Expand Up @@ -174,7 +204,7 @@ steps:
agents:
queue: opensource
plugins:
artifacts#v1.3.0:
artifacts#v1.5.0:
download:
- from: "features/fixtures/mobile/Binaries/IOS/TestFixture-IOS-Shipping.ipa"
to: "build/TestFixture-IOS-Shipping.ipa"
Expand Down
1 change: 1 addition & 0 deletions .cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
"UFUNCTION",
"UPROPERTY",
"USTRUCT",
"checkf",
"clazz",
"cronut",
"jboolean",
Expand Down
13 changes: 13 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: "Lint"
on: [push]

jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: clang-format
run: find Source Plugins/Bugsnag/Source/Bugsnag features/fixtures/mobile/Source -name '*.h' -o -name '*.cpp' | xargs /usr/bin/clang-format-12 --dry-run --Werror
- name: cspell
run: npm install -g cspell && cspell **/*.{cpp,h}
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
Changelog
=========

## 1.1.0 (2022-02-02)

* New APIs to support forthcoming feature flag and experiment functionality.
For more information, please see https://docs.bugsnag.com/product/features-experiments
[#123](https://github.com/bugsnag/bugsnag-unreal/pull/123)

* Updates the bugsnag-android dependency from v5.16.0 to [v5.19.2](https://github.com/bugsnag/bugsnag-android/blob/master/CHANGELOG.md#5192-2022-01-31)
* Updates the bugsnag-cocoa dependency from v6.14.3 to [v6.16.1](https://github.com/bugsnag/bugsnag-cocoa/blob/master/CHANGELOG.md#6161-2022-01-19)

## 1.0.1 (2022-01-04)

* Plugin is no longer flagged as "beta"
Expand Down
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
source 'https://rubygems.org'

gem 'bugsnag-maze-runner', git: 'https://github.com/bugsnag/maze-runner', tag: 'v6.1.0'
gem 'bugsnag-maze-runner', git: 'https://github.com/bugsnag/maze-runner', tag: 'v6.9.2'
4 changes: 2 additions & 2 deletions Plugins/Bugsnag/Bugsnag.uplugin
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"FileVersion": 3,
"Version": 3,
"VersionName": "1.0.1",
"Version": 4,
"VersionName": "1.1.0",
"FriendlyName": "Bugsnag",
"Description": "Bugsnag is an error monitoring and application stability management solution.",
"Category": "Developer",
Expand Down
4 changes: 2 additions & 2 deletions Plugins/Bugsnag/Source/Bugsnag/Bugsnag_UPL.xml
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@
<insertValue value="repository $S(PluginDir)/../ThirdParty/Android/lib"/>
<insertNewline/>
<insert>
com.bugsnag,bugsnag-plugin-android-unreal,1.0.1
com.bugsnag,bugsnag-android,5.16.0
com.bugsnag,bugsnag-plugin-android-unreal,1.1.0
com.bugsnag,bugsnag-android,5.19.2
</insert>
<insertNewline/>
</AARImports>
Expand Down
37 changes: 37 additions & 0 deletions Plugins/Bugsnag/Source/Bugsnag/Private/Android/AndroidEvent.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,49 @@
#include "BugsnagEvent.h"
#include "BugsnagUser.h"
#include "JavaObjectWrapper.h"
#include "LogBugsnag.h"

class FAndroidEvent : public IBugsnagEvent, FJavaObjectWrapper
{
public:
using FJavaObjectWrapper::FJavaObjectWrapper;

void AddFeatureFlag(const FString& Name, const TOptional<FString>& Variant = TOptional<FString>()) override
{
jstring jName = FAndroidPlatformJNI::ParseFString(Env, Name);
ReturnVoidIf(!jName);
jstring jVariant = FAndroidPlatformJNI::ParseFStringOptional(Env, Variant);
if (!jVariant && Variant.IsSet())
{
UE_LOG(LogBugsnag, Error, TEXT("Failed to create Java string with \"%s\""), *Variant.GetValue());
return;
}
(*Env).CallVoidMethod(JavaObject, Cache->EventAddFeatureFlag, jName, jVariant);
FAndroidPlatformJNI::CheckAndClearException(Env);
}

void AddFeatureFlags(const TArray<FBugsnagFeatureFlag>& FeatureFlags) override
{
for (const FBugsnagFeatureFlag& Flag : FeatureFlags)
{
AddFeatureFlag(Flag.GetName(), Flag.GetVariant());
}
}

void ClearFeatureFlag(const FString& Name) override
{
jstring jName = FAndroidPlatformJNI::ParseFString(Env, Name);
ReturnVoidIf(!jName);
(*Env).CallVoidMethod(JavaObject, Cache->EventClearFeatureFlag, jName);
FAndroidPlatformJNI::CheckAndClearException(Env);
}

void ClearFeatureFlags() override
{
(*Env).CallVoidMethod(JavaObject, Cache->EventClearFeatureFlags);
FAndroidPlatformJNI::CheckAndClearException(Env);
}

void AddMetadata(const FString& Section, const TSharedRef<FJsonObject>& Metadata) override
{
jstring jSection = FAndroidPlatformJNI::ParseFString(Env, Section);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#include "BugsnagConstants.h"
#include "BugsnagUtils.h"
#include "JNIUtilities.h"
#include "LogBugsnag.h"
#include "Shorthand.h"

DEFINE_PLATFORM_BUGSNAG(FAndroidPlatformBugsnag);
Expand Down Expand Up @@ -169,6 +170,45 @@ void FAndroidPlatformBugsnag::SetUser(const FString& Id, const FString& Email, c
FAndroidPlatformJNI::CheckAndClearException(Env);
}

void FAndroidPlatformBugsnag::AddFeatureFlag(const FString& Name, const TOptional<FString>& Variant)
{
JNIEnv* Env = AndroidJavaEnv::GetJavaEnv(true);
jstring jName = FAndroidPlatformJNI::ParseFString(Env, Name);
ReturnVoidIf(!jName);
jstring jVariant = FAndroidPlatformJNI::ParseFStringOptional(Env, Variant);
if (!jVariant && Variant.IsSet())
{
UE_LOG(LogBugsnag, Error, TEXT("Failed to create Java string with \"%s\""), *Variant.GetValue());
return;
}
(*Env).CallStaticVoidMethod(JNICache.BugsnagClass, JNICache.BugsnagAddFeatureFlag, jName, jVariant);
FAndroidPlatformJNI::CheckAndClearException(Env);
}

void FAndroidPlatformBugsnag::AddFeatureFlags(const TArray<FBugsnagFeatureFlag>& FeatureFlags)
{
for (const FBugsnagFeatureFlag& Flag : FeatureFlags)
{
FAndroidPlatformBugsnag::AddFeatureFlag(Flag.GetName(), Flag.GetVariant());
}
}

void FAndroidPlatformBugsnag::ClearFeatureFlag(const FString& Name)
{
JNIEnv* Env = AndroidJavaEnv::GetJavaEnv(true);
jstring jName = FAndroidPlatformJNI::ParseFString(Env, Name);
ReturnVoidIf(!jName);
(*Env).CallStaticVoidMethod(JNICache.BugsnagClass, JNICache.BugsnagClearFeatureFlag, jName);
FAndroidPlatformJNI::CheckAndClearException(Env);
}

void FAndroidPlatformBugsnag::ClearFeatureFlags()
{
JNIEnv* Env = AndroidJavaEnv::GetJavaEnv(true);
(*Env).CallStaticVoidMethod(JNICache.BugsnagClass, JNICache.BugsnagClearFeatureFlags);
FAndroidPlatformJNI::CheckAndClearException(Env);
}

void FAndroidPlatformBugsnag::AddMetadata(const FString& Section, const TSharedRef<FJsonObject>& Metadata)
{
JNIEnv* Env = AndroidJavaEnv::GetJavaEnv(true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,14 @@ class FAndroidPlatformBugsnag : public IPlatformBugsnag

void SetUser(const FString& Id, const FString& Email, const FString& Name) override;

void AddFeatureFlag(const FString& Name, const TOptional<FString>& Variant = TOptional<FString>()) override;

void AddFeatureFlags(const TArray<FBugsnagFeatureFlag>& FeatureFlags) override;

void ClearFeatureFlag(const FString& Name) override;

void ClearFeatureFlags() override;

void AddMetadata(const FString& Section, const TSharedRef<FJsonObject>& Metadata) override;

void AddMetadata(const FString& Section, const FString& Key, const TSharedPtr<FJsonValue>& Value) override;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,17 @@ jobject FAndroidPlatformConfiguration::Parse(JNIEnv* Env,
}
}

for (const TPair<FString, TOptional<FString>>& Elem : Config->FeatureFlags)
{
jstring jName = FAndroidPlatformJNI::ParseFString(Env, Elem.Key);
if (!jName)
{
continue;
}
jstring jVariant = FAndroidPlatformJNI::ParseFStringOptional(Env, Elem.Value);
jniCallWithObjects(Env, jConfig, Cache->ConfigAddFeatureFlag, jName, jVariant);
}

for (auto& Item : Config->GetMetadataValues())
{
jstring jSection = FAndroidPlatformJNI::ParseFString(Env, Item.Key);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,11 @@ bool FAndroidPlatformJNI::LoadReferenceCache(JNIEnv* env, JNIReferenceCache* cac

CacheStaticJavaMethod(env, cache->BugsnagClearMetadataSection, cache->BugsnagClass, "clearMetadata", "(Ljava/lang/String;)V");
CacheStaticJavaMethod(env, cache->BugsnagClearMetadataValue, cache->BugsnagClass, "clearMetadata", "(Ljava/lang/String;Ljava/lang/String;)V");
CacheStaticJavaMethod(env, cache->BugsnagAddFeatureFlag, cache->BugsnagClass, "addFeatureFlag", "(Ljava/lang/String;Ljava/lang/String;)V");
CacheStaticJavaMethod(env, cache->BugsnagAddMetadataToSection, cache->BugsnagClass, "addMetadata", "(Ljava/lang/String;Ljava/util/Map;)V");
CacheStaticJavaMethod(env, cache->BugsnagAddMetadataValue, cache->BugsnagClass, "addMetadata", "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Object;)V");
CacheStaticJavaMethod(env, cache->BugsnagClearFeatureFlag, cache->BugsnagClass, "clearFeatureFlag", "(Ljava/lang/String;)V");
CacheStaticJavaMethod(env, cache->BugsnagClearFeatureFlags, cache->BugsnagClass, "clearFeatureFlags", "()V");
CacheStaticJavaMethod(env, cache->BugsnagGetBreadcrumbs, cache->BugsnagClass, "getBreadcrumbs", "()Ljava/util/List;");
CacheStaticJavaMethod(env, cache->BugsnagGetContext, cache->BugsnagClass, "getContext", "()Ljava/lang/String;");
CacheStaticJavaMethod(env, cache->BugsnagGetLastRunInfo, cache->BugsnagClass, "getLastRunInfo", "()Lcom/bugsnag/android/LastRunInfo;");
Expand Down Expand Up @@ -169,9 +172,12 @@ bool FAndroidPlatformJNI::LoadReferenceCache(JNIEnv* env, JNIReferenceCache* cac

CacheInstanceJavaMethod(env, cache->ConfigConstructor, cache->ConfigClass, "<init>", "(Ljava/lang/String;)V");

CacheInstanceJavaMethod(env, cache->ConfigAddFeatureFlag, cache->ConfigClass, "addFeatureFlag", "(Ljava/lang/String;Ljava/lang/String;)V");
CacheInstanceJavaMethod(env, cache->ConfigAddMetadata, cache->ConfigClass, "addMetadata", "(Ljava/lang/String;Ljava/util/Map;)V");
CacheInstanceJavaMethod(env, cache->ConfigGetNotifier, cache->ConfigClass, "getNotifier", "()Lcom/bugsnag/android/Notifier;");
CacheInstanceJavaMethod(env, cache->ConfigAddPlugin, cache->ConfigClass, "addPlugin", "(Lcom/bugsnag/android/Plugin;)V");
CacheInstanceJavaMethod(env, cache->ConfigClearFeatureFlag, cache->ConfigClass, "clearFeatureFlag", "(Ljava/lang/String;)V");
CacheInstanceJavaMethod(env, cache->ConfigClearFeatureFlags, cache->ConfigClass, "clearFeatureFlags", "()V");
CacheInstanceJavaMethod(env, cache->ConfigSetAppType, cache->ConfigClass, "setAppType", "(Ljava/lang/String;)V");
CacheInstanceJavaMethod(env, cache->ConfigSetAppVersion, cache->ConfigClass, "setAppVersion", "(Ljava/lang/String;)V");
CacheInstanceJavaMethod(env, cache->ConfigSetAutoDetectErrors, cache->ConfigClass, "setAutoDetectErrors", "(Z)V");
Expand Down Expand Up @@ -245,8 +251,11 @@ bool FAndroidPlatformJNI::LoadReferenceCache(JNIEnv* env, JNIReferenceCache* cac

CacheInstanceJavaMethod(env, cache->ErrorTypesConstructor, cache->ErrorTypesClass, "<init>", "(ZZZZ)V");

CacheInstanceJavaMethod(env, cache->EventAddFeatureFlag, cache->EventClass, "addFeatureFlag", "(Ljava/lang/String;Ljava/lang/String;)V");
CacheInstanceJavaMethod(env, cache->EventAddMetadataToSection, cache->EventClass, "addMetadata", "(Ljava/lang/String;Ljava/util/Map;)V");
CacheInstanceJavaMethod(env, cache->EventAddMetadataValue, cache->EventClass, "addMetadata", "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Object;)V");
CacheInstanceJavaMethod(env, cache->EventClearFeatureFlag, cache->EventClass, "clearFeatureFlag", "(Ljava/lang/String;)V");
CacheInstanceJavaMethod(env, cache->EventClearFeatureFlags, cache->EventClass, "clearFeatureFlags", "()V");
CacheInstanceJavaMethod(env, cache->EventClearMetadataSection, cache->EventClass, "clearMetadata", "(Ljava/lang/String;)V");
CacheInstanceJavaMethod(env, cache->EventClearMetadataValue, cache->EventClass, "clearMetadata", "(Ljava/lang/String;Ljava/lang/String;)V");
CacheInstanceJavaMethod(env, cache->EventGetApiKey, cache->EventClass, "getApiKey", "()Ljava/lang/String;");
Expand Down
Loading

0 comments on commit 85f530d

Please sign in to comment.