Skip to content

Commit

Permalink
Merge branch 'main' into sam/wire-up-error-ui
Browse files Browse the repository at this point in the history
* main:
  Release 7.118.0-1 (#2812)
  [Release PR] Update VPN metadata reporter (#2808)
  fix address bar weirdness (#2810)
  Fix RMF button styling for "big_two_action" format (#2811)
  Existing experiment disabled, the new Settings experiment activated (#2801)
  Create Asana Subtask on PR requested (#2803)
  Remove ATB from default params (#2430)
  Fix Kingfisher deprecation warnings (#2799)
  VPN server failure detection recovery (#2779)
  Disable the feedback send button when there’s no text (#2800)
  • Loading branch information
samsymons committed May 1, 2024
2 parents b24332f + 90bcdb2 commit 13dc922
Show file tree
Hide file tree
Showing 28 changed files with 227 additions and 156 deletions.
20 changes: 19 additions & 1 deletion .github/workflows/pr-task-url.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Asana PR Task URL

on:
pull_request:
types: [opened, edited, closed, unlabeled, synchronize]
types: [opened, edited, closed, unlabeled, synchronize, review_requested]

jobs:

Expand Down Expand Up @@ -112,6 +112,24 @@ jobs:
if: ${{ needs.assert-project-membership.outputs.task_id }}
run: exit ${{ needs.assert-project-membership.outputs.failure }}

# When reviewer is assigned create a subtask in Asana if not existing already
create-asana-pr-subtask-if-needed:

name: "Create the PR subtask in Asana"

runs-on: ubuntu-latest
if: github.event.action == 'review_requested'

needs: [assert-project-membership]

steps:
- name: Create or Update PR Subtask
uses: duckduckgo/apple-toolbox/actions/asana-create-pr-subtask@main
with:
access-token: ${{ secrets.ASANA_ACCESS_TOKEN }}
asana-task-id: ${{ needs.assert-project-membership.outputs.task_id }}
github-reviewer-user: ${{ github.event.requested_reviewer.login }}

# When a PR is merged, move the task to the Waiting for Release section of the App Board.
mark-waiting-for-release:

Expand Down
4 changes: 2 additions & 2 deletions Core/DailyPixel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public final class DailyPixel {
public static func fire(pixel: Pixel.Event,
error: Swift.Error? = nil,
withAdditionalParameters params: [String: String] = [:],
includedParameters: [Pixel.QueryParameters] = [.atb, .appVersion],
includedParameters: [Pixel.QueryParameters] = [.appVersion],
onComplete: @escaping (Swift.Error?) -> Void = { _ in }) {
var key: String = pixel.name

Expand Down Expand Up @@ -79,7 +79,7 @@ public final class DailyPixel {
public static func fireDailyAndCount(pixel: Pixel.Event,
error: Swift.Error? = nil,
withAdditionalParameters params: [String: String] = [:],
includedParameters: [Pixel.QueryParameters] = [.atb, .appVersion],
includedParameters: [Pixel.QueryParameters] = [.appVersion],
onDailyComplete: @escaping (Swift.Error?) -> Void = { _ in },
onCountComplete: @escaping (Swift.Error?) -> Void = { _ in }) {
let key: String = pixel.name
Expand Down
5 changes: 2 additions & 3 deletions Core/DefaultVariantManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,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: "mc", weight: 1, isIncluded: When.inEnglish, features: [.newSuggestionLogic]),
VariantIOS(name: "md", weight: 1, isIncluded: When.inEnglish, features: [.history]),
VariantIOS(name: "mc", weight: doNotAllocate, isIncluded: When.inEnglish, features: [.newSuggestionLogic]),
VariantIOS(name: "md", weight: doNotAllocate, isIncluded: When.inEnglish, features: [.history]),

returningUser
]
Expand Down
4 changes: 2 additions & 2 deletions Core/FaviconsHelper.swift
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ struct FaviconsHelper {

// this function is now static and outside of Favicons, otherwise there is a circular dependency between
// Favicons and NotFoundCachingDownloader
public static func defaultResource(forDomain domain: String?, sourcesProvider: FaviconSourcesProvider) -> Kingfisher.ImageResource? {
public static func defaultResource(forDomain domain: String?, sourcesProvider: FaviconSourcesProvider) -> KF.ImageResource? {
guard let domain = domain,
let source = sourcesProvider.mainSource(forDomain: domain) else { return nil }

let key = Favicons.createHash(ofDomain: domain)
return ImageResource(downloadURL: source, cacheKey: key)
return KF.ImageResource(downloadURL: source, cacheKey: key)
}
}
4 changes: 2 additions & 2 deletions Core/Pixel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ public class Pixel {
withAdditionalParameters params: [String: String] = [:],
allowedQueryReservedCharacters: CharacterSet? = nil,
withHeaders headers: APIRequest.Headers = APIRequest.Headers(),
includedParameters: [QueryParameters] = [.atb, .appVersion],
includedParameters: [QueryParameters] = [.appVersion],
onComplete: @escaping (Error?) -> Void = { _ in },
debounce: Int = 0) {

Expand Down Expand Up @@ -209,7 +209,7 @@ public class Pixel {
withAdditionalParameters params: [String: String] = [:],
allowedQueryReservedCharacters: CharacterSet? = nil,
withHeaders headers: APIRequest.Headers = APIRequest.Headers(),
includedParameters: [QueryParameters] = [.atb, .appVersion],
includedParameters: [QueryParameters] = [.appVersion],
onComplete: @escaping (Error?) -> Void = { _ in }) {
var newParams = params
if includedParameters.contains(.appVersion) {
Expand Down
11 changes: 10 additions & 1 deletion Core/PixelEvent.swift
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,12 @@ extension Pixel {
case networkProtectionGeoswitchingSetNearest
case networkProtectionGeoswitchingSetCustom
case networkProtectionGeoswitchingNoLocations


case networkProtectionFailureRecoveryStarted
case networkProtectionFailureRecoveryFailed
case networkProtectionFailureRecoveryCompletedHealthy
case networkProtectionFailureRecoveryCompletedUnhealthy

// MARK: remote messaging pixels

case remoteMessageShown
Expand Down Expand Up @@ -1328,6 +1333,10 @@ extension Pixel.Event {
case .privacyProOfferYearlyPriceClick: return "m_privacy-pro_offer_yearly-price_click"
case .privacyProAddEmailSuccess: return "m_privacy-pro_app_add-email_success_u"
case .privacyProWelcomeFAQClick: return "m_privacy-pro_welcome_faq_click_u"
case .networkProtectionFailureRecoveryStarted: return "m_netp_ev_failure_recovery_started"
case .networkProtectionFailureRecoveryFailed: return "m_netp_ev_failure_recovery_failed"
case .networkProtectionFailureRecoveryCompletedHealthy: return "m_netp_ev_failure_recovery_completed_server_healthy"
case .networkProtectionFailureRecoveryCompletedUnhealthy: return "m_netp_ev_failure_recovery_completed_server_unhealthy"

// MARK: Secure Vault
case .secureVaultL1KeyMigration: return "m_secure-vault_keystore_event_l1-key-migration"
Expand Down
7 changes: 2 additions & 5 deletions Core/PixelExperiment.swift
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ public enum PixelExperiment: String, CaseIterable {

/// Enables this experiment for new users when called from the new installation path.
public static func install() {
// Disable the experiment until all other experiments are finished
logic.install()
}

Expand Down Expand Up @@ -101,12 +100,10 @@ final internal class PixelExperimentLogic {

// Allocate user to a cohort based on the random number
let cohort: PixelExperiment
if randomNumber < 5 {
if randomNumber < 50 {
cohort = .control
} else if randomNumber < 10 {
cohort = .newSettings
} else {
cohort = .noVariant
cohort = .newSettings
}

// Store and use the selected cohort
Expand Down
3 changes: 2 additions & 1 deletion Core/UniquePixel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,15 @@ public final class UniquePixel {
/// This requires the pixel name to end with `_u`
public static func fire(pixel: Pixel.Event,
withAdditionalParameters params: [String: String] = [:],
includedParameters: [Pixel.QueryParameters] = [.appVersion],
onComplete: @escaping (Swift.Error?) -> Void = { _ in }) {
guard pixel.name.hasSuffix("_u") else {
assertionFailure("Unique pixel: must end with _u")
return
}

if !pixel.hasBeenFiredEver(uniquePixelStorage: storage) {
Pixel.fire(pixel: pixel, withAdditionalParameters: params, onComplete: onComplete)
Pixel.fire(pixel: pixel, withAdditionalParameters: params, includedParameters: includedParameters, onComplete: onComplete)
storage.set(Date(), forKey: pixel.name)
} else {
onComplete(Error.alreadyFired)
Expand Down
Loading

0 comments on commit 13dc922

Please sign in to comment.