From b7b3b702ac5da49352b8769580b7aaecb0676868 Mon Sep 17 00:00:00 2001 From: Nikolay Edigaryev Date: Tue, 2 Apr 2024 18:31:16 +0400 Subject: [PATCH] Sentry: upgrade and attach command-line arguments (#774) * Sentry: upgrade and attach command-line arguments * Sentry's setContext(): explicitly pass a String --- Package.resolved | 4 ++-- Package.swift | 2 +- Sources/tart/Root.swift | 4 ++++ Sources/tart/VMStorageOCI.swift | 2 +- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/Package.resolved b/Package.resolved index 0273c20..66e0a3a 100644 --- a/Package.resolved +++ b/Package.resolved @@ -23,8 +23,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/getsentry/sentry-cocoa", "state" : { - "revision" : "d277532e1c8af813981ba01f591b15bbdd735615", - "version" : "8.8.0" + "revision" : "bf7bdd75e25556d0f97ad54fb804b4287863e106", + "version" : "8.22.4" } }, { diff --git a/Package.swift b/Package.swift index 4badf15..fad1d18 100644 --- a/Package.swift +++ b/Package.swift @@ -18,7 +18,7 @@ let package = Package( .package(url: "https://github.com/antlr/antlr4", branch: "dev"), .package(url: "https://github.com/apple/swift-atomics.git", .upToNextMajor(from: "1.0.0")), .package(url: "https://github.com/nicklockwood/SwiftFormat", from: "0.50.6"), - .package(url: "https://github.com/getsentry/sentry-cocoa", from: "8.8.0"), + .package(url: "https://github.com/getsentry/sentry-cocoa", from: "8.22.4"), .package(url: "https://github.com/cfilipov/TextTable", branch: "master"), .package(url: "https://github.com/sersoft-gmbh/swift-sysctl.git", from: "1.0.0"), .package(url: "https://github.com/orchetect/SwiftRadix", from: "1.3.0") diff --git a/Sources/tart/Root.swift b/Sources/tart/Root.swift index 1be21f1..3e37831 100644 --- a/Sources/tart/Root.swift +++ b/Sources/tart/Root.swift @@ -50,6 +50,10 @@ struct Root: AsyncParsableCommand { } defer { SentrySDK.flush(timeout: 2.seconds.timeInterval) } + SentrySDK.configureScope { scope in + scope.setExtra(value: ProcessInfo.processInfo.arguments, key: "Command-line arguments") + } + // Enrich future events with Cirrus CI-specific tags if let tags = ProcessInfo.processInfo.environment["CIRRUS_SENTRY_TAGS"] { SentrySDK.configureScope { scope in diff --git a/Sources/tart/VMStorageOCI.swift b/Sources/tart/VMStorageOCI.swift index a2e5831..307e7f0 100644 --- a/Sources/tart/VMStorageOCI.swift +++ b/Sources/tart/VMStorageOCI.swift @@ -134,7 +134,7 @@ class VMStorageOCI: PrunableStorage { func pull(_ name: RemoteName, registry: Registry, concurrency: UInt) async throws { SentrySDK.configureScope { scope in - scope.setContext(value: ["imageName": name], key: "OCI") + scope.setContext(value: ["imageName": name.description], key: "OCI") } defaultLogger.appendNewLine("pulling manifest...")