Skip to content

Commit

Permalink
Merge pull request #16 from WideSpectrumComputing/master
Browse files Browse the repository at this point in the history
fix: resolve #14 - RollbarConfig re-created when creating RollbarLogger, instead of using user-provided options
  • Loading branch information
akornich authored Dec 3, 2020
2 parents 660a7b3 + f9e8c42 commit 0602996
Show file tree
Hide file tree
Showing 286 changed files with 10,318 additions and 19 deletions.
20 changes: 20 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: CI SonarCloud Analysis
on:
push:
branches:
- master
pull_request:
types: [opened, synchronize, reopened]
jobs:
sonarcloud:
name: SonarCloud
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- name: SonarCloud Scan
uses: SonarSource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
7 changes: 5 additions & 2 deletions .github/workflows/masterCI.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Swift
name: CI Build with Unit Tests

on:
push:
Expand All @@ -13,7 +13,10 @@ jobs:

steps:
- uses: actions/checkout@v2


- name: SonarCloud RollbaCommon
run: SonarCloud/build-wrapper-macosx-x86/build-wrapper-macosx-x86 --out-dir sonar_build_wrapper_output xcodebuild -workspace RollbarSDK.xcworkspace -scheme RollbarCommon clean build

- name: Build RollbarCommon
working-directory: RollbarCommon
run: swift build -v
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,5 @@ Dist/
*.swp

build/

build_wrapper_output_directory/
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1220"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "55684F6A2553B4C400F82F34"
BuildableName = "iosAppObjC.app"
BlueprintName = "iosAppObjC"
ReferencedContainer = "container:iosAppObjC.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "55684F6A2553B4C400F82F34"
BuildableName = "iosAppObjC.app"
BlueprintName = "iosAppObjC"
ReferencedContainer = "container:iosAppObjC.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "55684F6A2553B4C400F82F34"
BuildableName = "iosAppObjC.app"
BlueprintName = "iosAppObjC"
ReferencedContainer = "container:iosAppObjC.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,12 @@ This SDK is essentially a reincarnation of our [Rollbar-iOS SDK](https://github.
and will only maintained with fixes to bug or security issues if any.
All the active development will be done within this SDK repository.

## CI Build Status

![CI Build Status](https://github.com/rollbar/rollbar-apple/workflows/Swift/badge.svg)

## Package Distribution Systems Status

[![GitHub all releases downloads total](https://img.shields.io/github/downloads/rollbar/rollbar-apple/total?logo=GitHub)]()

[![SwiftPM compatible](https://img.shields.io/badge/SwiftPM-compatible-brightgreen.svg)](https://swift.org/package-manager)
Expand Down
2 changes: 1 addition & 1 deletion RollbarCommon.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

Pod::Spec.new do |s|

s.version = "2.0.0-alpha26"
s.version = "2.0.0-alpha27"
s.name = "RollbarCommon"
s.summary = "Application or client side SDK for accessing the Rollbar API Server."
s.description = <<-DESC
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1220"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "RollbarCommon"
BuildableName = "RollbarCommon"
BlueprintName = "RollbarCommon"
ReferencedContainer = "container:">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "RollbarCommonTests"
BuildableName = "RollbarCommonTests"
BlueprintName = "RollbarCommonTests"
ReferencedContainer = "container:">
</BuildableReference>
</TestableReference>
</Testables>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "RollbarCommon"
BuildableName = "RollbarCommon"
BlueprintName = "RollbarCommon"
ReferencedContainer = "container:">
</BuildableReference>
</MacroExpansion>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
2 changes: 1 addition & 1 deletion RollbarDeploys.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

Pod::Spec.new do |s|

s.version = "2.0.0-alpha26"
s.version = "2.0.0-alpha27"
s.name = "RollbarDeploys"
s.summary = "Application or client side SDK for accessing the Rollbar API Server."
s.description = <<-DESC
Expand Down
2 changes: 1 addition & 1 deletion RollbarKSCrash.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

Pod::Spec.new do |s|

s.version = "2.0.0-alpha26"
s.version = "2.0.0-alpha27"
s.name = "RollbarKSCrash"
s.summary = "Application or client side SDK for accessing the Rollbar API Server."
s.description = <<-DESC
Expand Down
2 changes: 1 addition & 1 deletion RollbarNotifier.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

Pod::Spec.new do |s|

s.version = "2.0.0-alpha26"
s.version = "2.0.0-alpha27"
s.name = "RollbarNotifier"
s.summary = "Application or client side SDK for accessing the Rollbar API Server."
s.description = <<-DESC
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

#pragma mark - constants

static NSString * const NOTIFIER_VERSION = @"2.0.0-alpha26";
static NSString * const NOTIFIER_VERSION = @"2.0.0-alpha27";

static NSString * const NOTIFIER_NAME = @"rollbar-apple";

Expand Down
8 changes: 8 additions & 0 deletions RollbarNotifier/Sources/RollbarNotifier/Rollbar.m
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#import "RollbarLogger.h"
#import "RollbarConfig.h"
#import "RollbarDestination.h"
#import "RollbarLoggingOptions.h"
#import "RollbarTelemetryOptions.h"
#import "RollbarTelemetryOptionsObserver.h"
#import "RollbarScrubbingOptions.h"
Expand Down Expand Up @@ -92,13 +93,20 @@ + (void)updateConfiguration:(RollbarConfig *)configuration {
// [telemetryOptionsObserver unregisterAsObserverForTelemetryOptions:logger.configuration.telemetry];
// }

NSUInteger oldReportingRate = 0;

if (logger) {
oldReportingRate = logger.configuration.loggingOptions.maximumReportsPerMinute;
[logger updateConfiguration:configuration];
}
else {
logger = [[RollbarLogger alloc] initWithConfiguration:configuration];
}

if (oldReportingRate != configuration.loggingOptions.maximumReportsPerMinute) {
[logger updateReportingRate:configuration.loggingOptions.maximumReportsPerMinute];
}

// if (logger && logger.configuration && logger.configuration.telemetry) {
// [telemetryOptionsObserver registerAsObserverForTelemetryOptions:logger.configuration.telemetry];
// }
Expand Down
25 changes: 14 additions & 11 deletions RollbarNotifier/Tests/RollbarNotifierTests-ObjC/RollbarTests.m
Original file line number Diff line number Diff line change
Expand Up @@ -15,22 +15,25 @@ @interface RollbarTests : XCTestCase
@implementation RollbarTests

- (void)setUp {

[super setUp];

RollbarClearLogFile();

if (!Rollbar.currentConfiguration) {
//[Rollbar initWithAccessToken:@""];
[Rollbar initWithAccessToken:@"2ffc7997ed864dda94f63e7b7daae0f3"];
Rollbar.currentConfiguration.destination.accessToken = @"2ffc7997ed864dda94f63e7b7daae0f3";
Rollbar.currentConfiguration.destination.environment = @"unit-tests";
Rollbar.currentConfiguration.developerOptions.transmit = YES;
Rollbar.currentConfiguration.developerOptions.logPayload = YES;
Rollbar.currentConfiguration.loggingOptions.maximumReportsPerMinute = 5000;

RollbarConfig *config = [[RollbarConfig alloc] init];
config.destination.accessToken = @"2ffc7997ed864dda94f63e7b7daae0f3";
config.destination.environment = @"unit-tests";
config.developerOptions.transmit = YES;
config.developerOptions.logPayload = YES;
config.loggingOptions.maximumReportsPerMinute = 5000;
// for the stress test specifically:
Rollbar.currentConfiguration.telemetry.enabled = YES;
Rollbar.currentConfiguration.loggingOptions.captureIp = RollbarCaptureIpType_Full;

id config = Rollbar.currentConfiguration;
config.telemetry.enabled = YES;
config.loggingOptions.captureIp = RollbarCaptureIpType_Full;
NSLog(@"%@", config)

[Rollbar initWithConfiguration:config];
}
}

Expand Down
2 changes: 1 addition & 1 deletion RollbarSDK.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Pod::Spec.new do |sdk|

# Rollbar SDK:
# ============
sdk.version = "2.0.0-alpha26"
sdk.version = "2.0.0-alpha27"
sdk.name = "RollbarSDK"
sdk.summary = "Application or client side SDK for accessing the Rollbar API Server."
sdk.description = <<-DESC
Expand Down
Binary file not shown.
Binary file not shown.
Loading

0 comments on commit 0602996

Please sign in to comment.