Skip to content

Commit

Permalink
Merge branch 'release/7.93.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
graeme committed Oct 10, 2023
2 parents 199e701 + 116234d commit c9afbea
Show file tree
Hide file tree
Showing 87 changed files with 1,638 additions and 543 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:

name: Unit Tests

runs-on: macos-13
runs-on: macos-13-xlarge
timeout-minutes: 30

outputs:
Expand Down Expand Up @@ -127,7 +127,7 @@ jobs:

name: Make Release Build

runs-on: macos-13
runs-on: macos-13-xlarge
timeout-minutes: 30

steps:
Expand Down
2 changes: 1 addition & 1 deletion Configuration/Version.xcconfig
Original file line number Diff line number Diff line change
@@ -1 +1 @@
MARKETING_VERSION = 7.92.0
MARKETING_VERSION = 7.93.0
4 changes: 4 additions & 0 deletions Core/DefaultVariantManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ import BrowserServicesKit
extension FeatureName {
// Define your feature e.g.:
// public static let experimentalFeature = FeatureName(rawValue: "experimentalFeature")

public static let fixedUserAgent = FeatureName(rawValue: "fixedUserAgent")
}

public struct VariantIOS: Variant {
Expand Down Expand Up @@ -59,6 +61,8 @@ public struct VariantIOS: Variant {
VariantIOS(name: "sc", weight: doNotAllocate, isIncluded: When.always, features: []),
VariantIOS(name: "sd", weight: doNotAllocate, isIncluded: When.always, features: []),
VariantIOS(name: "se", weight: doNotAllocate, isIncluded: When.always, features: []),
VariantIOS(name: "me", weight: 1, isIncluded: When.always, features: []),
VariantIOS(name: "mf", weight: 1, isIncluded: When.always, features: [.fixedUserAgent]),
returningUser
]

Expand Down
3 changes: 3 additions & 0 deletions Core/FeatureFlag.swift
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ public enum FeatureFlag: String {
case autofillInlineIconCredentials
case autofillAccessCredentialManagement
case autofillPasswordGeneration
case autofillOnByDefault
case incontextSignup
case appTrackingProtection
case networkProtection
Expand All @@ -48,6 +49,8 @@ extension FeatureFlag: FeatureFlagSourceProviding {
return .remoteReleasable(.subfeature(AutofillSubfeature.accessCredentialManagement))
case .autofillPasswordGeneration:
return .remoteReleasable(.subfeature(AutofillSubfeature.autofillPasswordGeneration))
case .autofillOnByDefault:
return .remoteReleasable(.subfeature(AutofillSubfeature.onByDefault))
case .incontextSignup:
return .remoteReleasable(.feature(.incontextSignup))
}
Expand Down
4 changes: 1 addition & 3 deletions Core/NetworkProtectionNotificationIdentifier.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,7 @@
import Foundation

public enum NetworkProtectionNotificationIdentifier: String {
case reconnecting = "network-protection.notification.reconnecting"
case reconnected = "network-protection.notification.reconnected"
case connectionFailure = "network-protection.notification.connection-failure"
case connection = "network-protection.notification.connection"
case superseded = "network-protection.notification.superseded"
case test = "network-protection.notification.test"
}
2 changes: 2 additions & 0 deletions Core/Pixel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,8 @@ public struct PixelParameters {
public static let returnUserErrorCode = "error_code"
public static let returnUserOldATB = "old_atb"
public static let returnUserNewATB = "new_atb"

public static let autofillDefaultState = "default_state"
}

public struct PixelValues {
Expand Down
3 changes: 0 additions & 3 deletions Core/PixelEvent.swift
Original file line number Diff line number Diff line change
Expand Up @@ -502,7 +502,6 @@ extension Pixel {
case emailIncontextModalExitEarlyContinue

case compilationFailed
case incrementalRolloutTest
}

}
Expand Down Expand Up @@ -985,8 +984,6 @@ extension Pixel.Event {
case .debugReturnUserAddATB: return "m_debug_return_user_add_atb"
case .debugReturnUserReadATB: return "m_debug_return_user_read_atb"
case .debugReturnUserUpdateATB: return "m_debug_return_user_update_atb"

case .incrementalRolloutTest: return "m_autofill_incremental_rollout_test"
}

}
Expand Down
7 changes: 6 additions & 1 deletion Core/UserAgentManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ struct UserAgent {
private let applicationComponent = "DuckDuckGo/\(AppVersion.shared.majorVersionNumber)"
private let statistics: StatisticsStore
private let isTesting: Bool = ProcessInfo().arguments.contains("testing")

init(defaultAgent: String = Constants.fallbackDefaultAgent, statistics: StatisticsStore = StatisticsUserDefaults()) {
versionComponent = UserAgent.createVersionComponent(fromAgent: defaultAgent)
baseAgent = UserAgent.createBaseAgent(fromAgent: defaultAgent, versionComponent: versionComponent)
Expand Down Expand Up @@ -181,6 +181,7 @@ struct UserAgent {
return versions
}

// swiftlint:disable:next cyclomatic_complexity
public func agent(forUrl url: URL?,
isDesktop: Bool,
privacyConfig: PrivacyConfiguration = ContentBlocking.shared.privacyConfigurationManager.privacyConfig) -> String {
Expand Down Expand Up @@ -209,6 +210,10 @@ struct UserAgent {
return ddgFixedLogic(forUrl: url, isDesktop: isDesktop, privacyConfig: privacyConfig)
}

if DefaultVariantManager().isSupported(feature: .fixedUserAgent) {
return ddgFixedLogic(forUrl: url, isDesktop: isDesktop, privacyConfig: privacyConfig)
}

switch defaultPolicy(forConfig: privacyConfig) {
case .ddg: return oldLogic(forUrl: url, isDesktop: isDesktop, privacyConfig: privacyConfig)
case .ddgFixed: return ddgFixedLogic(forUrl: url, isDesktop: isDesktop, privacyConfig: privacyConfig)
Expand Down
Loading

0 comments on commit c9afbea

Please sign in to comment.