Skip to content

Commit

Permalink
add test experiment and start it
Browse files Browse the repository at this point in the history
  • Loading branch information
SabrinaTardio committed Dec 6, 2024
1 parent b32409d commit 1e1873b
Show file tree
Hide file tree
Showing 3 changed files with 25 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 @@ -11379,8 +11379,8 @@
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/DuckDuckGo/BrowserServicesKit";
requirement = {
kind = exactVersion;
version = 218.0.0;
branch = "sabrina/setup-experiment-test";
kind = branch;
};
};
9F8FE9472BAE50E50071E372 /* 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
21 changes: 21 additions & 0 deletions DuckDuckGo/NewTabPageViewModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

import Foundation
import Core
import BrowserServicesKit

final class NewTabPageViewModel: ObservableObject {

Expand All @@ -39,6 +40,9 @@ final class NewTabPageViewModel: ObservableObject {
isIntroMessageVisible = introDataStorage.newTabPageIntroMessageEnabled ?? false
isOnboarding = false
isShowingSettings = false

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

func introMessageDisplayed() {
Expand Down Expand Up @@ -78,3 +82,20 @@ final class NewTabPageViewModel: ObservableObject {
isDragging = false
}
}


// 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 1e1873b

Please sign in to comment.