Skip to content

Commit

Permalink
Merge pull request #313 from bugsnag/release-v1.8.1
Browse files Browse the repository at this point in the history
Release v1.8.1
  • Loading branch information
kstenerud authored Sep 3, 2024
2 parents 6b3561f + 487361b commit c62a0d1
Show file tree
Hide file tree
Showing 15 changed files with 59 additions and 62 deletions.
3 changes: 1 addition & 2 deletions .buildkite/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ steps:
- make build_xcframework
plugins:
- artifacts#v1.9.3:
upload: "build/xcframeworks/products/BugsnagPerformance.xcframework"
compressed: xcframework.zip
upload: "BugsnagPerformance.xcframework.zip"

- label: "Carthage"
commands:
Expand Down
4 changes: 2 additions & 2 deletions .jazzy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ author_url: "https://www.bugsnag.com"
author: "Bugsnag Inc"
clean: false # avoid deleting docs/.git
framework_root: "BugsnagPerformance"
github_file_prefix: "https://github.com/bugsnag/bugsnag-cocoa-performance/tree/v1.8.0/Bugsnag"
github_file_prefix: "https://github.com/bugsnag/bugsnag-cocoa-performance/tree/v1.8.1/Bugsnag"
github_url: "https://github.com/bugsnag/bugsnag-cocoa-performance"
hide_documentation_coverage: true
module: "BugsnagPerformance"
module_version: "1.8.0"
module_version: "1.8.1"
objc: true
output: "docs"
readme: "README.md"
Expand Down
6 changes: 3 additions & 3 deletions BugsnagPerformance.podspec.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "BugsnagPerformance",
"version": "1.8.0",
"version": "1.8.1",
"summary": "The Bugsnag performance monitoring framework for iOS.",
"homepage": "https://github.com/bugsnag/bugsnag-cocoa-performance",
"license": {
Expand All @@ -12,13 +12,13 @@
},
"source": {
"git": "https://github.com/bugsnag/bugsnag-cocoa-performance.git",
"tag": "v1.8.0"
"tag": "v1.8.1"
},
"platforms": {
"ios": "13.0"
},
"requires_arc": true,
"source_files": "Sources/BugsnagPerformance/**/*",
"source_files": "Sources/BugsnagPerformance/{**/,}*.{m,h,mm,c,swift}",
"resource_bundles": {
"BugsnagPerformance": ["Sources/BugsnagPerformance/resources/PrivacyInfo.xcprivacy"]
},
Expand Down
4 changes: 0 additions & 4 deletions BugsnagPerformance.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@
01A414D22913C238003152A4 /* Reachability.mm in Sources */ = {isa = PBXBuildFile; fileRef = 01A414D02913C238003152A4 /* Reachability.mm */; };
01A414D42913CAE7003152A4 /* SystemConfiguration.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 01A414D32913CAE7003152A4 /* SystemConfiguration.framework */; };
01A58C0E29092D25006E4DF7 /* Sampler.h in Headers */ = {isa = PBXBuildFile; fileRef = 01A58C0C29092D25006E4DF7 /* Sampler.h */; };
01A58C0F29092D25006E4DF7 /* Sampler.mm in Sources */ = {isa = PBXBuildFile; fileRef = 01A58C0D29092D25006E4DF7 /* Sampler.mm */; };
01A58C11290931A5006E4DF7 /* SamplerTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = 01A58C10290931A5006E4DF7 /* SamplerTests.mm */; };
01EAF980291AAF19007AC627 /* Utils.h in Headers */ = {isa = PBXBuildFile; fileRef = 01EAF97F291AAF19007AC627 /* Utils.h */; };
0921F02B2A67CBD600C764EB /* BugsnagPerformanceNetworkRequestInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = 0921F0292A67CBD600C764EB /* BugsnagPerformanceNetworkRequestInfo.h */; settings = {ATTRIBUTES = (Public, ); }; };
Expand Down Expand Up @@ -276,7 +275,6 @@
01A414D02913C238003152A4 /* Reachability.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = Reachability.mm; sourceTree = "<group>"; };
01A414D32913CAE7003152A4 /* SystemConfiguration.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SystemConfiguration.framework; path = System/Library/Frameworks/SystemConfiguration.framework; sourceTree = SDKROOT; };
01A58C0C29092D25006E4DF7 /* Sampler.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Sampler.h; sourceTree = "<group>"; };
01A58C0D29092D25006E4DF7 /* Sampler.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = Sampler.mm; sourceTree = "<group>"; };
01A58C10290931A5006E4DF7 /* SamplerTests.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = SamplerTests.mm; sourceTree = "<group>"; };
01EAF97F291AAF19007AC627 /* Utils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Utils.h; sourceTree = "<group>"; };
01EF4A3E29067786003CC5A5 /* BugsnagPerformance.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = BugsnagPerformance.xcconfig; sourceTree = "<group>"; };
Expand Down Expand Up @@ -568,7 +566,6 @@
CBEC51DA2976F1F9009C0CE3 /* RetryQueue.h */,
CBEC51DB2976F1F9009C0CE3 /* RetryQueue.mm */,
01A58C0C29092D25006E4DF7 /* Sampler.h */,
01A58C0D29092D25006E4DF7 /* Sampler.mm */,
96D55C822A1EBA35006D1F29 /* SpanActivityState.h */,
01A414CB2913C0F0003152A4 /* SpanAttributes.h */,
01A414CC2913C0F0003152A4 /* SpanAttributes.mm */,
Expand Down Expand Up @@ -1187,7 +1184,6 @@
CB78819C29E587CE00A58906 /* BugsnagPerformanceLibrary.mm in Sources */,
0122C23C29019770002D243C /* BugsnagPerformanceConfiguration.mm in Sources */,
CBEBE59229F2783C00BF0B4F /* Swizzle.mm in Sources */,
01A58C0F29092D25006E4DF7 /* Sampler.mm in Sources */,
CBA22C972A0137230066A2C1 /* EarlyConfiguration.mm in Sources */,
09FFD4412BEE3DE2009B0E04 /* BugsnagPerformanceCrossTalkAPI.mm in Sources */,
CBEC51C1296DB312009C0CE3 /* JSON.mm in Sources */,
Expand Down
8 changes: 4 additions & 4 deletions BugsnagPerformanceSwift.podspec.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "BugsnagPerformanceSwift",
"version": "1.5.0",
"version": "1.8.1",
"summary": "The Bugsnag performance monitoring framework for Swift-only functionality in iOS.",
"homepage": "https://github.com/bugsnag/bugsnag-cocoa-performance",
"license": {
Expand All @@ -13,17 +13,17 @@
"swift_version": "4.2",
"source": {
"git": "https://github.com/bugsnag/bugsnag-cocoa-performance.git",
"tag": "v1.5.0"
"tag": "v1.8.1"
},
"platforms": {
"ios": "13.0"
},
"requires_arc": true,
"source_files": "Sources/BugsnagPerformanceSwift/**/*",
"source_files": "Sources/BugsnagPerformanceSwift/{**/,}*.{m,h,mm,c,swift}",
"frameworks": [
"SwiftUI"
],
"dependencies": {
"BugsnagPerformance": "1.5.0"
"BugsnagPerformance": "1.8.1"
}
}
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,22 @@
Changelog
=========

## 1.8.1 (2024-09-03)

### Bug fixes

* Stop podspec from trying to compile xcprivacy files (which generates warnings).
[311](https://github.com/bugsnag/bugsnag-cocoa-performance/pull/311)

* Early spans (ended before Bugsnag starts) now get their sampling probability value properly updated.
[310](https://github.com/bugsnag/bugsnag-cocoa-performance/pull/310)

* Release process now updates BugsnagPerformanceSwift podspec rather than BugsnagPerformanceSwiftUI (which has been deprecated)
[308](https://github.com/bugsnag/bugsnag-cocoa-performance/pull/308)

* Use API key subdomain as default Performance endpoint
[313](https://github.com/bugsnag/bugsnag-cocoa-performance/pull/313)

## 1.8.0 (2024-08-29)

### Enhancements
Expand Down
10 changes: 5 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ endif
@open 'https://github.com/bugsnag/bugsnag-cocoa-performance/releases/new?title=v$(PRESET_VERSION)&tag=v$(PRESET_VERSION)&body='$$(awk 'start && /^## /{exit;};/^## /{start=1;next};start' CHANGELOG.md | hexdump -v -e '/1 "%02x"' | sed 's/\(..\)/%\1/g')
# Workaround for CocoaPods/CocoaPods#8000
@EXPANDED_CODE_SIGN_IDENTITY="" EXPANDED_CODE_SIGN_IDENTITY_NAME="" EXPANDED_PROVISIONING_PROFILE="" pod trunk push --allow-warnings BugsnagPerformance.podspec.json
@EXPANDED_CODE_SIGN_IDENTITY="" EXPANDED_CODE_SIGN_IDENTITY_NAME="" EXPANDED_PROVISIONING_PROFILE="" pod trunk push --allow-warnings BugsnagPerformanceSwiftUI.podspec.json
@EXPANDED_CODE_SIGN_IDENTITY="" EXPANDED_CODE_SIGN_IDENTITY_NAME="" EXPANDED_PROVISIONING_PROFILE="" pod trunk push --allow-warnings BugsnagPerformanceSwift.podspec.json

bump: ## Bump the version numbers to $VERSION
ifeq ($(VERSION),)
Expand All @@ -199,9 +199,9 @@ endif
@echo $(VERSION) > VERSION
@sed -i '' "s/\"version\": .*,/\"version\": \"$(VERSION)\",/" BugsnagPerformance.podspec.json
@sed -i '' "s/\"tag\": .*/\"tag\": \"v$(VERSION)\"/" BugsnagPerformance.podspec.json
@sed -i '' "s/\"version\": .*,/\"version\": \"$(VERSION)\",/" BugsnagPerformanceSwiftUI.podspec.json
@sed -i '' "s/\"tag\": .*/\"tag\": \"v$(VERSION)\"/" BugsnagPerformanceSwiftUI.podspec.json
@sed -i '' "s/\"BugsnagPerformance\": .*/\"BugsnagPerformance\": \"$(VERSION)\"/" BugsnagPerformanceSwiftUI.podspec.json
@sed -i '' "s/\"version\": .*,/\"version\": \"$(VERSION)\",/" BugsnagPerformanceSwift.podspec.json
@sed -i '' "s/\"tag\": .*/\"tag\": \"v$(VERSION)\"/" BugsnagPerformanceSwift.podspec.json
@sed -i '' "s/\"BugsnagPerformance\": .*/\"BugsnagPerformance\": \"$(VERSION)\"/" BugsnagPerformanceSwift.podspec.json
@sed -i '' "s/## TBD/## $(VERSION) ($(shell date '+%Y-%m-%d'))/" CHANGELOG.md
@sed -i '' -E "s/[0-9]+\.[0-9]+\.[0-9]+/$(VERSION)/g" .jazzy.yaml
@sed -i '' -E "s/[0-9]+\.[0-9]+\.[0-9]+/$(VERSION)/g" Sources/BugsnagPerformance/Private/Version.h
Expand All @@ -212,7 +212,7 @@ ifeq ($(VERSION),)
@$(error VERSION is not defined. Run with `make VERSION=number prerelease`)
endif
@git checkout -b release-v$(VERSION)
@git add BugsnagPerformance.podspec.json VERSION CHANGELOG.md .jazzy.yaml Sources/BugsnagPerformance/Private/Version.h BugsnagPerformanceSwiftUI.podspec.json
@git add BugsnagPerformance.podspec.json VERSION CHANGELOG.md .jazzy.yaml Sources/BugsnagPerformance/Private/Version.h BugsnagPerformanceSwift.podspec.json
@git diff --exit-code || (echo "you have unstaged changes - Makefile may need updating to `git add` some more files"; exit 1)
@git commit -m "Release v$(VERSION)"
@git push origin release-v$(VERSION)
Expand Down
18 changes: 16 additions & 2 deletions Sources/BugsnagPerformance/Private/Sampler.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,23 @@ class Sampler {

/**
* Samples the given span data, returning true if the span is to be kept.
* Also updates the span's sampling probability value if it is to be kept.
*/
bool sampled(BugsnagPerformanceSpan *span) noexcept;
bool sampled(BugsnagPerformanceSpan *span) noexcept {
if (span == nil) {
return false;
}

auto p = getProbability();
uint64_t idUpperBound;
if (p <= 0.0) {
idUpperBound = 0;
} else if (p >= 1.0) {
idUpperBound = UINT64_MAX;
} else {
idUpperBound = uint64_t(p * double(UINT64_MAX));
}
return span.traceId.hi <= idUpperBound;
}

private:
double probability_{1};
Expand Down
35 changes: 0 additions & 35 deletions Sources/BugsnagPerformance/Private/Sampler.mm

This file was deleted.

3 changes: 3 additions & 0 deletions Sources/BugsnagPerformance/Private/Tracer.mm
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
continue;
}
span.isMutable = true;
[span updateSamplingProbability:sampler_->getProbability()];
callOnSpanEndCallbacks(span);
span.isMutable = false;
if (span.state == SpanStateAborted) {
Expand Down Expand Up @@ -139,6 +140,8 @@
return;
}

[span updateSamplingProbability:sampler_->getProbability()];

if (span != nil && span.state == SpanStateEnded) {
callOnSpanEndCallbacks(span);
if (span.state == SpanStateAborted) {
Expand Down
2 changes: 1 addition & 1 deletion Sources/BugsnagPerformance/Private/Version.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@
#pragma once

#define TELEMETRY_SDK_NAME "bugsnag.performance.cocoa"
#define TELEMETRY_SDK_VERSION "1.8.0"
#define TELEMETRY_SDK_VERSION "1.8.1"
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,13 @@

using namespace bugsnag;

static NSString *defaultEndpoint = @"https://otlp.bugsnag.com/v1/traces";

@implementation BugsnagPerformanceConfiguration

- (instancetype)initWithApiKey:(NSString *)apiKey {
if ((self = [super init])) {
_internal = [BSGInternalConfiguration new];
_apiKey = [apiKey copy];
_endpoint = nsurlWithString(defaultEndpoint, nil);
_endpoint = nsurlWithString([NSString stringWithFormat: @"https://%@.otlp.bugsnag.com/v1/traces", apiKey], nil);
_autoInstrumentAppStarts = YES;
_autoInstrumentViewControllers = YES;
_autoInstrumentNetworkRequests = YES;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,4 +180,9 @@ - (void)testLoadConfigDoesTakeValuesFromBugsnagWhenSomeValuesAreMissingInPerform
XCTAssertTrue(config.autoInstrumentNetworkRequests);
}

- (void)testShouldSetIncludeApiKeyInTheDefaultEndpoint {
auto config = [[BugsnagPerformanceConfiguration alloc] initWithApiKey:@"0123456789abcdef0123456789abcdef"];
XCTAssertEqualObjects(config.endpoint.absoluteString, @"https://0123456789abcdef0123456789abcdef.otlp.bugsnag.com/v1/traces");
}

@end
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.8.0
1.8.1
1 change: 1 addition & 0 deletions scripts/build-xcframework.sh
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ build_frameworks() {
fixup_xcframework $framework
pushd "${PRODUCTS_DIR}"
zip --symlinks -rq "${framework}.xcframework.zip" "${framework}.xcframework"
cp -r "${framework}.xcframework.zip" "${PROJECT_DIR}/${framework}.xcframework.zip"
popd
done
}
Expand Down

0 comments on commit c62a0d1

Please sign in to comment.