Skip to content

Commit

Permalink
add facke experiment
Browse files Browse the repository at this point in the history
  • Loading branch information
SabrinaTardio committed Dec 6, 2024
1 parent 786ca2d commit 911fec7
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 4 deletions.
4 changes: 2 additions & 2 deletions DuckDuckGo.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -15370,8 +15370,8 @@
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/duckduckgo/BrowserServicesKit";
requirement = {
kind = exactVersion;
version = 218.0.0;
branch = "sabrina/setup-experiment-test";
kind = branch;
};
};
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"
"branch" : "sabrina/setup-experiment-test",
"revision" : "a294718068171e3517d7a1b2351f6ba53ff61d44"
}
},
{
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
}
}

0 comments on commit 911fec7

Please sign in to comment.