From fb6f4243cfafdd94f682a8cb35bccf9b5ae3183d Mon Sep 17 00:00:00 2001 From: Shilpa Modi Date: Wed, 27 Nov 2024 12:46:39 -0800 Subject: [PATCH] Adding pixels for tracking content blocking rules fetch/lookup (#3589) Task/Issue URL: https://app.asana.com/0/1208613456171888/1208801514911204/f Tech Design URL: https://app.asana.com/0/1208613456171888/1208730499188670/f CC: **Description**: **Optional E2E tests**: - [ ] Run PIR E2E tests Check this to run the Personal Information Removal end to end tests. If updating CCF, or any PIR related code, tick this. **Steps to test this PR**: 1. **Definition of Done**: * [ ] Does this PR satisfy our [Definition of Done](https://app.asana.com/0/1202500774821704/1207634633537039/f)? --- ###### Internal references: [Pull Request Review Checklist](https://app.asana.com/0/1202500774821704/1203764234894239/f) [Software Engineering Expectations](https://app.asana.com/0/59792373528535/199064865822552) [Technical Design Template](https://app.asana.com/0/59792373528535/184709971311943) [Pull Request Documentation](https://app.asana.com/0/1202500774821704/1204012835277482/f) --- DuckDuckGo.xcodeproj/project.pbxproj | 2 +- .../xcshareddata/swiftpm/Package.resolved | 4 ++-- DuckDuckGo/ContentBlocker/ContentBlocking.swift | 11 +++++++++++ DuckDuckGo/Statistics/GeneralPixel.swift | 13 +++++++++++++ LocalPackages/DataBrokerProtection/Package.swift | 2 +- LocalPackages/FeatureFlags/Package.swift | 2 +- LocalPackages/NetworkProtectionMac/Package.swift | 2 +- LocalPackages/SubscriptionUI/Package.swift | 2 +- 8 files changed, 31 insertions(+), 7 deletions(-) diff --git a/DuckDuckGo.xcodeproj/project.pbxproj b/DuckDuckGo.xcodeproj/project.pbxproj index 095cbdddce..85f2f10605 100644 --- a/DuckDuckGo.xcodeproj/project.pbxproj +++ b/DuckDuckGo.xcodeproj/project.pbxproj @@ -15205,7 +15205,7 @@ repositoryURL = "https://github.com/duckduckgo/BrowserServicesKit"; requirement = { kind = exactVersion; - version = 211.1.3; + version = 212.0.0; }; }; 9FF521422BAA8FF300B9819B /* XCRemoteSwiftPackageReference "lottie-spm" */ = { diff --git a/DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved index ea1c934f56..ea5f5ad5fc 100644 --- a/DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -32,8 +32,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/duckduckgo/BrowserServicesKit", "state" : { - "revision" : "f83b1f5ebd328bc2447d1a3793149bb21037d685", - "version" : "211.1.3" + "revision" : "5a24a885425dcb5626353bf5a8ca6af79c44c1cb", + "version" : "212.0.0" } }, { diff --git a/DuckDuckGo/ContentBlocker/ContentBlocking.swift b/DuckDuckGo/ContentBlocker/ContentBlocking.swift index ca8389d3f4..9505a8ecb7 100644 --- a/DuckDuckGo/ContentBlocker/ContentBlocking.swift +++ b/DuckDuckGo/ContentBlocker/ContentBlocking.swift @@ -137,6 +137,17 @@ final class AppContentBlocking { domainEvent = .contentBlockingCompilationFailed(listType: listType, component: component) + case .contentBlockingLookupRulesSucceeded: + domainEvent = .contentBlockingLookupRulesSucceeded + + case .contentBlockingFetchLRCSucceeded: + domainEvent = .contentBlockingFetchLRCSucceeded + + case .contentBlockingNoMatchInLRC: + domainEvent = .contentBlockingNoMatchInLRC + + case .contentBlockingLRCMissing: + domainEvent = .contentBlockingLRCMissing case .contentBlockingCompilationTime: // Temporarily avoid firing this pixel. This can be re-enabled if it's determined to be necessary later. // domainEvent = .contentBlockingCompilationTime diff --git a/DuckDuckGo/Statistics/GeneralPixel.swift b/DuckDuckGo/Statistics/GeneralPixel.swift index 48de9d9fb0..050dbb53e7 100644 --- a/DuckDuckGo/Statistics/GeneralPixel.swift +++ b/DuckDuckGo/Statistics/GeneralPixel.swift @@ -314,6 +314,10 @@ enum GeneralPixel: PixelKitEventV2 { case contentBlockingCompilationFailed(listType: CompileRulesListType, component: ContentBlockerDebugEvents.Component) case contentBlockingCompilationTime + case contentBlockingLookupRulesSucceeded + case contentBlockingFetchLRCSucceeded + case contentBlockingNoMatchInLRC + case contentBlockingLRCMissing case secureVaultInitError(error: Error) case secureVaultError(error: Error) @@ -930,6 +934,15 @@ enum GeneralPixel: PixelKitEventV2 { case .contentBlockingCompilationTime: return "content_blocking_compilation_time" + case .contentBlockingLookupRulesSucceeded: + return "content_blocking_lookup_rules_succeeded" + case .contentBlockingFetchLRCSucceeded: + return "content_blocking_fetch_lrc_succeeded" + case .contentBlockingNoMatchInLRC: + return "content_blocking_no_match_in_lrc" + case .contentBlockingLRCMissing: + return "content_blocking_lrc_missing" + case .secureVaultInitError: return "secure_vault_init_error" case .secureVaultError: diff --git a/LocalPackages/DataBrokerProtection/Package.swift b/LocalPackages/DataBrokerProtection/Package.swift index 9287fcc214..9a52a8b2fa 100644 --- a/LocalPackages/DataBrokerProtection/Package.swift +++ b/LocalPackages/DataBrokerProtection/Package.swift @@ -29,7 +29,7 @@ let package = Package( targets: ["DataBrokerProtection"]) ], dependencies: [ - .package(url: "https://github.com/duckduckgo/BrowserServicesKit", exact: "211.1.3"), + .package(url: "https://github.com/duckduckgo/BrowserServicesKit", exact: "212.0.0"), .package(path: "../SwiftUIExtensions"), .package(path: "../AppKitExtensions"), .package(path: "../XPCHelper"), diff --git a/LocalPackages/FeatureFlags/Package.swift b/LocalPackages/FeatureFlags/Package.swift index 9863c2db89..a040c1e9d2 100644 --- a/LocalPackages/FeatureFlags/Package.swift +++ b/LocalPackages/FeatureFlags/Package.swift @@ -32,7 +32,7 @@ let package = Package( targets: ["FeatureFlags"]), ], dependencies: [ - .package(url: "https://github.com/duckduckgo/BrowserServicesKit", exact: "211.1.3"), + .package(url: "https://github.com/duckduckgo/BrowserServicesKit", exact: "212.0.0"), ], targets: [ // Targets are the basic building blocks of a package, defining a module or a test suite. diff --git a/LocalPackages/NetworkProtectionMac/Package.swift b/LocalPackages/NetworkProtectionMac/Package.swift index 6174e604bd..dbf5e149a7 100644 --- a/LocalPackages/NetworkProtectionMac/Package.swift +++ b/LocalPackages/NetworkProtectionMac/Package.swift @@ -32,7 +32,7 @@ let package = Package( .library(name: "VPNAppLauncher", targets: ["VPNAppLauncher"]), ], dependencies: [ - .package(url: "https://github.com/duckduckgo/BrowserServicesKit", exact: "211.1.3"), + .package(url: "https://github.com/duckduckgo/BrowserServicesKit", exact: "212.0.0"), .package(url: "https://github.com/airbnb/lottie-spm", exact: "4.4.3"), .package(path: "../AppLauncher"), .package(path: "../UDSHelper"), diff --git a/LocalPackages/SubscriptionUI/Package.swift b/LocalPackages/SubscriptionUI/Package.swift index c4dfcded5b..9fe331a2e4 100644 --- a/LocalPackages/SubscriptionUI/Package.swift +++ b/LocalPackages/SubscriptionUI/Package.swift @@ -12,7 +12,7 @@ let package = Package( targets: ["SubscriptionUI"]), ], dependencies: [ - .package(url: "https://github.com/duckduckgo/BrowserServicesKit", exact: "211.1.3"), + .package(url: "https://github.com/duckduckgo/BrowserServicesKit", exact: "212.0.0"), .package(path: "../SwiftUIExtensions") ], targets: [