From 1e1873b53bf0bd1eefaa1ae985b7aedbb457527b Mon Sep 17 00:00:00 2001 From: Sabrina Tardio Date: Fri, 6 Dec 2024 10:09:15 +0100 Subject: [PATCH] add test experiment and start it --- DuckDuckGo.xcodeproj/project.pbxproj | 4 ++-- .../xcshareddata/swiftpm/Package.resolved | 4 ++-- DuckDuckGo/NewTabPageViewModel.swift | 21 +++++++++++++++++++ 3 files changed, 25 insertions(+), 4 deletions(-) diff --git a/DuckDuckGo.xcodeproj/project.pbxproj b/DuckDuckGo.xcodeproj/project.pbxproj index c8cfaf060a..e6085c5008 100644 --- a/DuckDuckGo.xcodeproj/project.pbxproj +++ b/DuckDuckGo.xcodeproj/project.pbxproj @@ -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" */ = { diff --git a/DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved index 7d8e4affb7..f35b84d2e6 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" : "e5d390c8559fbe7b1ca67fd3982c91bcc0437d60", - "version" : "218.0.0" + "branch" : "sabrina/setup-experiment-test", + "revision" : "a294718068171e3517d7a1b2351f6ba53ff61d44" } }, { diff --git a/DuckDuckGo/NewTabPageViewModel.swift b/DuckDuckGo/NewTabPageViewModel.swift index 6cb387b402..c2a71bcb3c 100644 --- a/DuckDuckGo/NewTabPageViewModel.swift +++ b/DuckDuckGo/NewTabPageViewModel.swift @@ -19,6 +19,7 @@ import Foundation import Core +import BrowserServicesKit final class NewTabPageViewModel: ObservableObject { @@ -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() { @@ -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 + } +}