Skip to content

Commit

Permalink
add fake experiment (#3637)
Browse files Browse the repository at this point in the history
Task/Issue URL:
https://app.asana.com/0/72649045549333/1208905776162821/f
Tech Design URL:
CC:

**Description**: Used Fake Test feature to generate a cohort and do and
A/A test run of the New experiment framework. We want to make sure
cohort is assigned and pixels are fired as expected.
  • Loading branch information
SabrinaTardio authored Dec 6, 2024
1 parent bdcbdbf commit 8ab4e31
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 7 deletions.
2 changes: 1 addition & 1 deletion DuckDuckGo.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -15371,7 +15371,7 @@
repositoryURL = "https://github.com/duckduckgo/BrowserServicesKit";
requirement = {
kind = exactVersion;
version = 218.0.0;
version = 218.0.1;
};
};
9FF521422BAA8FF300B9819B /* XCRemoteSwiftPackageReference "lottie-spm" */ = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/duckduckgo/BrowserServicesKit",
"state" : {
"revision" : "e5d390c8559fbe7b1ca67fd3982c91bcc0437d60",
"version" : "218.0.0"
"revision" : "bbcb41c87c5788718a43883b5b10eb3b4f54aff3",
"version" : "218.0.1"
}
},
{
Expand Down
19 changes: 19 additions & 0 deletions DuckDuckGo/HomePage/Model/HomePageContinueSetUpModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,9 @@ extension HomePage.Models {
// HTML NTP doesn't refresh on appear so we have to connect to the appear signal
// (the notification in this case) to trigger a refresh.
NotificationCenter.default.addObserver(self, selector: #selector(refreshFeaturesForHTMLNewTabPage(_:)), name: .newTabPageWebViewDidAppear, object: nil)

// This is just temporarily here to run an A/A test to check the new experiment framework works as expected
_ = Application.appDelegate.featureFlagger.getCohortIfEnabled(for: CredentialsSavingFlag())
}

@MainActor func performAction(for featureType: FeatureType) {
Expand Down Expand Up @@ -445,3 +448,19 @@ extension AppVersion {
return "\(components[0]).\(components[1])"
}
}

// This is just temporarily here to run an A/A test to check the new experiment framework works as expected
public struct CredentialsSavingFlag: FeatureFlagExperimentDescribing {
public init() {}

public typealias CohortType = Cohort

public var rawValue = "credentialSaving"

public var source: FeatureFlagSource = .remoteReleasable(.subfeature(ExperimentTestSubfeatures.experimentTestAA))

public enum Cohort: String, FlagCohort {
case control
case blue
}
}
2 changes: 1 addition & 1 deletion LocalPackages/DataBrokerProtection/Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ let package = Package(
targets: ["DataBrokerProtection"])
],
dependencies: [
.package(url: "https://github.com/duckduckgo/BrowserServicesKit", exact: "218.0.0"),
.package(url: "https://github.com/duckduckgo/BrowserServicesKit", exact: "218.0.1"),
.package(path: "../SwiftUIExtensions"),
.package(path: "../AppKitExtensions"),
.package(path: "../XPCHelper"),
Expand Down
2 changes: 1 addition & 1 deletion LocalPackages/FeatureFlags/Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ let package = Package(
targets: ["FeatureFlags"]),
],
dependencies: [
.package(url: "https://github.com/duckduckgo/BrowserServicesKit", exact: "218.0.0"),
.package(url: "https://github.com/duckduckgo/BrowserServicesKit", exact: "218.0.1"),
],
targets: [
// Targets are the basic building blocks of a package, defining a module or a test suite.
Expand Down
2 changes: 1 addition & 1 deletion LocalPackages/NetworkProtectionMac/Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ let package = Package(
.library(name: "VPNAppLauncher", targets: ["VPNAppLauncher"]),
],
dependencies: [
.package(url: "https://github.com/duckduckgo/BrowserServicesKit", exact: "218.0.0"),
.package(url: "https://github.com/duckduckgo/BrowserServicesKit", exact: "218.0.1"),
.package(url: "https://github.com/airbnb/lottie-spm", exact: "4.4.3"),
.package(path: "../AppLauncher"),
.package(path: "../UDSHelper"),
Expand Down
2 changes: 1 addition & 1 deletion LocalPackages/SubscriptionUI/Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ let package = Package(
targets: ["SubscriptionUI"]),
],
dependencies: [
.package(url: "https://github.com/duckduckgo/BrowserServicesKit", exact: "218.0.0"),
.package(url: "https://github.com/duckduckgo/BrowserServicesKit", exact: "218.0.1"),
.package(path: "../SwiftUIExtensions"),
.package(path: "../FeatureFlags")
],
Expand Down

0 comments on commit 8ab4e31

Please sign in to comment.