Skip to content

Commit

Permalink
Merge branch 'develop' into PersistentStore
Browse files Browse the repository at this point in the history
  • Loading branch information
mbruin-NR authored Feb 1, 2024
2 parents 35876e3 + b22af29 commit 1863135
Show file tree
Hide file tree
Showing 53 changed files with 3,452 additions and 55 deletions.
20 changes: 10 additions & 10 deletions .github/workflows/productionDeploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,19 +66,19 @@ jobs:
- name: Print XCFramework name
run: echo "${{ env.version }}"

# - name: Create Prod Podspec for XCFramework version
# run: |
# cd main
- name: Create Prod Podspec for XCFramework version
run: |
cd main
# cp cocoapods/NewRelicAgent.podspec.template NewRelicAgent.podspec
# REPLACE=X.XX
# sed -i bak "s/$REPLACE/${{ env.version }}/g" NewRelicAgent.podspec
cp cocoapods/NewRelicAgent.podspec.template NewRelicAgent.podspec
REPLACE=X.XX
sed -i bak "s/$REPLACE/${{ env.version }}/g" NewRelicAgent.podspec
# rm NewRelicAgent.podspecbak
rm NewRelicAgent.podspecbak
# pod trunk push --allow-warnings NewRelicAgent.podspec
# env:
# COCOAPODS_TRUNK_TOKEN: ${{ secrets.COCOAPODS_TRUNK_TOKEN }}
pod trunk push --allow-warnings NewRelicAgent.podspec
env:
COCOAPODS_TRUNK_TOKEN: ${{ secrets.COCOAPODS_TRUNK_TOKEN }}

- name: Create Prod Package.swift for XCFramework version
run: |
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ CMakeFiles/
Makefile
Testing/
build/
examples/cocoapods/CocoapodsExample/Pods/

# idea project files
# Xcode
Expand Down Expand Up @@ -87,4 +88,3 @@ fastlane/test_output

iOSInjectionProject/
.DS_Store

56 changes: 28 additions & 28 deletions Agent.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -4976,9 +4976,9 @@
CLANG_CXX_LANGUAGE_STANDARD = "c++14";
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 7.4.7;
CURRENT_PROJECT_VERSION = 7.4.9;
DEVELOPMENT_TEAM = RQZ9D969HD;
DYLIB_CURRENT_VERSION = 7.4.7;
DYLIB_CURRENT_VERSION = 7.4.9;
FRAMEWORK_SEARCH_PATHS = "$(inherited)";
GCC_C_LANGUAGE_STANDARD = "compiler-default";
GCC_INSTRUMENT_PROGRAM_FLOW_ARCS = YES;
Expand Down Expand Up @@ -5029,9 +5029,9 @@
CLANG_CXX_LANGUAGE_STANDARD = "c++14";
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 7.4.7;
CURRENT_PROJECT_VERSION = 7.4.9;
DEVELOPMENT_TEAM = SU7SUNGZJP;
DYLIB_CURRENT_VERSION = 7.4.7;
DYLIB_CURRENT_VERSION = 7.4.9;
FRAMEWORK_SEARCH_PATHS = "$(inherited)";
GCC_C_LANGUAGE_STANDARD = "compiler-default";
GCC_INSTRUMENT_PROGRAM_FLOW_ARCS = YES;
Expand Down Expand Up @@ -5104,10 +5104,10 @@
CODE_SIGN_IDENTITY = "Apple Development: [email protected] (3ZGR4484Y2)";
CODE_SIGN_STYLE = Manual;
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 7.4.7;
CURRENT_PROJECT_VERSION = 7.4.9;
DEBUG_INFORMATION_FORMAT = dwarf;
DISABLE_MANUAL_TARGET_ORDER_BUILD_WARNING = YES;
DYLIB_CURRENT_VERSION = 7.4.7;
DYLIB_CURRENT_VERSION = 7.4.9;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
GCC_C_LANGUAGE_STANDARD = c99;
Expand Down Expand Up @@ -5179,10 +5179,10 @@
CODE_SIGN_IDENTITY = "Apple Development: [email protected] (3ZGR4484Y2)";
CODE_SIGN_STYLE = Manual;
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 7.4.7;
CURRENT_PROJECT_VERSION = 7.4.9;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DISABLE_MANUAL_TARGET_ORDER_BUILD_WARNING = YES;
DYLIB_CURRENT_VERSION = 7.4.7;
DYLIB_CURRENT_VERSION = 7.4.9;
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_C_LANGUAGE_STANDARD = c99;
Expand Down Expand Up @@ -5223,12 +5223,12 @@
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "Apple Development";
CODE_SIGN_STYLE = Manual;
COPY_PHASE_STRIP = YES;
CURRENT_PROJECT_VERSION = 7.4.8;
CURRENT_PROJECT_VERSION = 7.4.9;
DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = SU7SUNGZJP;
"DEVELOPMENT_TEAM[sdk=macosx*]" = SU7SUNGZJP;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 7.4.8;
DYLIB_CURRENT_VERSION = 7.4.9;
DYLIB_INSTALL_NAME_BASE = "@rpath";
ENABLE_BITCODE = NO;
FRAMEWORK_SEARCH_PATHS = (
Expand All @@ -5252,7 +5252,7 @@
"@executable_path/Frameworks",
"@loader_path/Frameworks",
);
MARKETING_VERSION = 7.4.8;
MARKETING_VERSION = 7.4.9;
MODULEMAP_FILE = agent.modulemap;
OTHER_CFLAGS = "$(inherited";
OTHER_LDFLAGS = "";
Expand Down Expand Up @@ -5283,11 +5283,11 @@
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "Apple Distribution: New Relic Inc (SU7SUNGZJP)";
CODE_SIGN_STYLE = Manual;
COPY_PHASE_STRIP = YES;
CURRENT_PROJECT_VERSION = 7.4.8;
CURRENT_PROJECT_VERSION = 7.4.9;
DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = SU7SUNGZJP;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 7.4.8;
DYLIB_CURRENT_VERSION = 7.4.9;
DYLIB_INSTALL_NAME_BASE = "@rpath";
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
Expand All @@ -5309,7 +5309,7 @@
"@executable_path/Frameworks",
"@loader_path/Frameworks",
);
MARKETING_VERSION = 7.4.8;
MARKETING_VERSION = 7.4.9;
MODULEMAP_FILE = agent.modulemap;
OTHER_CFLAGS = "$(inherited";
OTHER_LDFLAGS = "";
Expand All @@ -5334,9 +5334,9 @@
CLANG_CXX_LANGUAGE_STANDARD = "c++14";
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 7.4.7;
CURRENT_PROJECT_VERSION = 7.4.9;
DEVELOPMENT_TEAM = RQZ9D969HD;
DYLIB_CURRENT_VERSION = 7.4.7;
DYLIB_CURRENT_VERSION = 7.4.9;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)/Frameworks",
Expand Down Expand Up @@ -5391,9 +5391,9 @@
CLANG_CXX_LANGUAGE_STANDARD = "c++14";
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 7.4.7;
CURRENT_PROJECT_VERSION = 7.4.9;
DEVELOPMENT_TEAM = SU7SUNGZJP;
DYLIB_CURRENT_VERSION = 7.4.7;
DYLIB_CURRENT_VERSION = 7.4.9;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)/Frameworks",
Expand Down Expand Up @@ -5440,9 +5440,9 @@
CLANG_ENABLE_CODE_COVERAGE = YES;
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "-";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 7.4.7;
CURRENT_PROJECT_VERSION = 7.4.9;
DEVELOPMENT_TEAM = SU7SUNGZJP;
DYLIB_CURRENT_VERSION = 7.4.7;
DYLIB_CURRENT_VERSION = 7.4.9;
HEADER_SEARCH_PATHS = (
"${PROJECT_DIR}/UnitTests/",
"${SRCROOT}/**",
Expand Down Expand Up @@ -5479,9 +5479,9 @@
CLANG_ENABLE_CODE_COVERAGE = YES;
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "-";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 7.4.7;
CURRENT_PROJECT_VERSION = 7.4.9;
DEVELOPMENT_TEAM = SU7SUNGZJP;
DYLIB_CURRENT_VERSION = 7.4.7;
DYLIB_CURRENT_VERSION = 7.4.9;
HEADER_SEARCH_PATHS = (
"${PROJECT_DIR}/UnitTests/",
"${SRCROOT}/**",
Expand Down Expand Up @@ -5519,12 +5519,12 @@
"CODE_SIGN_IDENTITY[sdk=appletvos*]" = "Apple Development";
CODE_SIGN_STYLE = Manual;
COPY_PHASE_STRIP = YES;
CURRENT_PROJECT_VERSION = 7.4.8;
CURRENT_PROJECT_VERSION = 7.4.9;
DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = SU7SUNGZJP;
"DEVELOPMENT_TEAM[sdk=appletvos*]" = SU7SUNGZJP;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 7.4.8;
DYLIB_CURRENT_VERSION = 7.4.9;
DYLIB_INSTALL_NAME_BASE = "@rpath";
ENABLE_BITCODE = NO;
FRAMEWORK_SEARCH_PATHS = (
Expand All @@ -5546,7 +5546,7 @@
"@executable_path/Frameworks",
"@loader_path/Frameworks",
);
MARKETING_VERSION = 7.4.8;
MARKETING_VERSION = 7.4.9;
MODULEMAP_FILE = agent.modulemap;
OTHER_LDFLAGS = "";
PRODUCT_BUNDLE_IDENTIFIER = com.newrelic.Agent;
Expand All @@ -5572,11 +5572,11 @@
CODE_SIGN_IDENTITY = "Apple Distribution: New Relic Inc (SU7SUNGZJP)";
CODE_SIGN_STYLE = Manual;
COPY_PHASE_STRIP = YES;
CURRENT_PROJECT_VERSION = 7.4.8;
CURRENT_PROJECT_VERSION = 7.4.9;
DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = SU7SUNGZJP;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 7.4.8;
DYLIB_CURRENT_VERSION = 7.4.9;
DYLIB_INSTALL_NAME_BASE = "@rpath";
ENABLE_BITCODE = NO;
FRAMEWORK_SEARCH_PATHS = (
Expand All @@ -5597,7 +5597,7 @@
"@executable_path/Frameworks",
"@loader_path/Frameworks",
);
MARKETING_VERSION = 7.4.8;
MARKETING_VERSION = 7.4.9;
MODULEMAP_FILE = agent.modulemap;
OTHER_LDFLAGS = "";
PRODUCT_BUNDLE_IDENTIFIER = com.newrelic.Agent;
Expand Down
71 changes: 62 additions & 9 deletions Agent/Harvester/DataStore/NRMAHarvesterConfiguration.m
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,70 @@ - (id) initWithDictionary:(NSDictionary*)dict
self = [super init];
if (self) {
self.application_token = [dict valueForKey:kNRMA_LICENSE_KEY];
self.collect_network_errors = [[dict valueForKey:kNRMA_COLLECT_NETWORK_ERRORS] boolValue];

if ([dict objectForKey:kNRMA_COLLECT_NETWORK_ERRORS]) {
self.collect_network_errors = [[dict valueForKey:kNRMA_COLLECT_NETWORK_ERRORS] boolValue];
}
else {
self.collect_network_errors = NRMA_DEFAULT_COLLECT_NETWORK_ERRORS;
}

self.cross_process_id = [dict valueForKey:kNRMA_CROSS_PROCESS_ID];
self.data_report_period = [[dict valueForKey:kNRMA_DATA_REPORT_PERIOD] intValue];

if ([dict objectForKey:kNRMA_DATA_REPORT_PERIOD]) {
self.data_report_period = [[dict valueForKey:kNRMA_DATA_REPORT_PERIOD] intValue];
}
else {
self.data_report_period = NRMA_DEFAULT_REPORT_PERIOD;
}

self.data_token = [[NRMADataToken alloc] init];
self.data_token.clusterAgentId = [[[dict valueForKey:kNRMA_DATA_TOKEN] objectAtIndex:0] longLongValue];
self.data_token.realAgentId = [[[dict valueForKey:kNRMA_DATA_TOKEN] objectAtIndex:1] longLongValue];
self.error_limit = [[dict valueForKey:kNRMA_ERROR_LIMIT] intValue];
self.report_max_transaction_age = [[dict valueForKey:kNRMA_REPORT_MAX_TRANSACTION_AGE] intValue];
self.report_max_transaction_count = [[dict valueForKey:kNRMA_REPORT_MAX_TRANSACTION_COUNT]intValue];
self.response_body_limit = [[dict valueForKey:kNRMA_RESPONSE_BODY_LIMIT] intValue];

if ([dict objectForKey:kNRMA_ERROR_LIMIT]) {
self.error_limit = [[dict valueForKey:kNRMA_ERROR_LIMIT] intValue];
}
else {
self.error_limit = NRMA_DEFAULT_ERROR_LIMIT;
}

if ([dict objectForKey:kNRMA_REPORT_MAX_TRANSACTION_AGE]) {

self.report_max_transaction_age = [[dict valueForKey:kNRMA_REPORT_MAX_TRANSACTION_AGE] intValue];
}
else {
self.report_max_transaction_age = NRMA_DEFAULT_MAX_TRANSACTION_AGE;
}
if ([dict objectForKey:kNRMA_REPORT_MAX_TRANSACTION_COUNT]) {
self.report_max_transaction_count = [[dict valueForKey:kNRMA_REPORT_MAX_TRANSACTION_COUNT]intValue];
}
else {
self.report_max_transaction_count = NRMA_DEFAULT_MAX_TRANSACTION_COUNT;
}

if ([dict objectForKey:kNRMA_RESPONSE_BODY_LIMIT]) {
self.response_body_limit = [[dict valueForKey:kNRMA_RESPONSE_BODY_LIMIT] intValue];
}
else {
self.response_body_limit = NRMA_DEFAULT_RESPONSE_BODY_LIMIT;
}

self.server_timestamp = [[dict valueForKey:kNRMA_SERVER_TIMESTAMP] longLongValue];
self.stack_trace_limit = [[dict valueForKey:kNRMA_STACK_TRACE_LIMIT] intValue];
self.activity_trace_max_size =[[dict valueForKey:kNRMA_AT_MAX_SIZE] intValue];

if ([dict objectForKey:kNRMA_STACK_TRACE_LIMIT]) {
self.stack_trace_limit = [[dict valueForKey:kNRMA_STACK_TRACE_LIMIT] intValue];
}
else {
self.stack_trace_limit = NRMA_DEFAULT_STACK_TRACE_LIMIT;
}
if ([dict objectForKey:kNRMA_AT_MAX_SIZE]) {
self.activity_trace_max_size =[[dict valueForKey:kNRMA_AT_MAX_SIZE] intValue];
}
else {
self.activity_trace_max_size = NRMA_DEFAULT_ACTIVITY_TRACE_MAX_SIZE;
}

self.at_capture = [[NRMATraceConfigurations alloc] initWithArray:[dict valueForKey:kNRMA_AT_CAPTURE]];
self.activity_trace_min_utilization = [[dict valueForKey:KNRMA_AT_MIN_UTILIZATION] doubleValue];
self.encoding_key = [dict valueForKey:kNRMA_ENCODING_KEY];
Expand Down Expand Up @@ -145,7 +196,9 @@ - (NSUInteger) hash
result = 31 * result + (unsigned int)self.account_id;
result = 31 * result + (unsigned int)self.application_id;
result = 31 * result + self.encoding_key.hash;

// Is this a chill addition?
result = 31 * result + self.trusted_account_key.hash;

return result;
}
@end
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 "fastlane"
gem "fastlane", '2.216.0'
4 changes: 2 additions & 2 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ PLATFORMS
universal-darwin-22

DEPENDENCIES
fastlane
fastlane (= 2.216.0)

BUNDLED WITH
2.4.19
2.4.22
4 changes: 2 additions & 2 deletions NewRelicAgent.podspec
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@

Pod::Spec.new do |s|
s.name = "NewRelicAgent"
s.version = "7.4.7-rc.589"
s.version = "7.4.8"
s.summary = "Real-time performance data with your next iOS app release."
s.homepage = "http://newrelic.com/mobile-monitoring"
s.license = { :type => "Commercial", :file => "LICENSE" }
s.author = { "New Relic, Inc." => "[email protected]" }
s.source = { :http => "https://download.newrelic.com/ios-v5/NewRelic_XCFramework_Agent_7.4.7-rc.589.zip" }
s.source = { :http => "https://download.newrelic.com/ios_agent/NewRelic_XCFramework_Agent_7.4.8.zip" }
s.ios.deployment_target = '9.0'
s.tvos.deployment_target = '9.0'
s.vendored_frameworks = "NewRelic.xcframework"
Expand Down
4 changes: 2 additions & 2 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ let package = Package(
name: "NewRelicPackage",
dependencies: []),
.binaryTarget(name: "NewRelic",
url: "https://download.newrelic.com/ios-v5/NewRelic_XCFramework_Agent_7.4.7-rc.589.zip",
checksum: "4d5b8b8415d7e4d98fc12f1bf78347fe4f52c85bea0660be96c17d2a1a705752")
url: "https://download.newrelic.com/ios_agent/NewRelic_XCFramework_Agent_7.4.8.zip",
checksum: "96af08369f21b7c4b6b9ca5ea20d78752445f02d0223c44694012ad19530eba6")
]
)

Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,28 @@ - (void) testHarvestConfiguration
XCTAssertTrue([config isEqual:[[NRMAHarvesterConfiguration alloc] initWithDictionary:[config asDictionary]]], @"test asDictionary and initWithDictionary is correct");
}

- (void) testBadHarvestConfiguration {

// Test what happens if any value is missing from passed dictionary

NRMAHarvesterConfiguration* config = [[NRMAHarvesterConfiguration alloc] initWithDictionary:[NSDictionary dictionary]];
XCTAssertEqual(NRMA_DEFAULT_REPORT_PERIOD, config.data_report_period, @"A bad dictionary should parse default report period to its default.");
// if kNRMA_COLLECT_NETWORK_ERRORS is missing.
XCTAssertEqual(true, config.collect_network_errors, @"A bad dictionary should parse default report period to its default.");
// if kNRMA_ERROR_LIMIT is missing
XCTAssertEqual(NRMA_DEFAULT_ERROR_LIMIT, config.error_limit, @"A bad dictionary should parse default error limit to its default.");
// if kNRMA_REPORT_MAX_TRANSACTION_AGE is missing
XCTAssertEqual(NRMA_DEFAULT_MAX_TRANSACTION_AGE, config.report_max_transaction_age, @"A bad dictionary should parse default max transaction aget limit to its default.");
// if kNRMA_REPORT_MAX_TRANSACTION_COUNT is missing
XCTAssertEqual(NRMA_DEFAULT_MAX_TRANSACTION_COUNT, config.report_max_transaction_count, @"A bad dictionary should parse max transactions to its default.");
// if kNRMA_RESPONSE_BODY_LIMIT is missing
XCTAssertEqual(NRMA_DEFAULT_RESPONSE_BODY_LIMIT, config.response_body_limit, @"A bad dictionary should parse response body limit to its default.");
// if kNRMA_STACK_TRACE_LIMIT is missing
XCTAssertEqual(NRMA_DEFAULT_STACK_TRACE_LIMIT, config.stack_trace_limit, @"A bad dictionary should parse response body limit to its default.");
// if kNRMA_AT_MAX_SIZE is missing
XCTAssertEqual(NRMA_DEFAULT_ACTIVITY_TRACE_MAX_SIZE, config.activity_trace_max_size, @"A bad dictionary should parse activity trace max size limit to its default.");
}

- (void) testActivityTraceConfiguration
{
NSArray* at_capture;
Expand Down
Loading

0 comments on commit 1863135

Please sign in to comment.