Skip to content

Commit

Permalink
Merge branch 'develop' into graeme/fix-code-signing
Browse files Browse the repository at this point in the history
  • Loading branch information
graeme authored Nov 14, 2023
2 parents 86eb131 + e88ee7f commit e7e211b
Show file tree
Hide file tree
Showing 19 changed files with 304 additions and 56 deletions.
19 changes: 19 additions & 0 deletions .github/workflows/sync-end-to-end.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,4 +60,23 @@ jobs:
env: |
CODE=${{ steps.sync-recovery-code.outputs.recovery-code }}
- name: Create Asana task when workflow failed
if: ${{ failure() }}
run: |
curl -s "https://app.asana.com/api/1.0/tasks" \
--header "Accept: application/json" \
--header "Authorization: Bearer ${{ secrets.ASANA_ACCESS_TOKEN }}" \
--header "Content-Type: application/json" \
--data ' { "data": { "name": "GH Workflow Failure - Sync End to end tests", "workspace": "${{ vars.GH_ASANA_WORKSPACE_ID }}", "projects": [ "${{ vars.GH_ASANA_IOS_APP_PROJECT_ID }}" ], "notes" : "The end to end workflow has failed. See https://github.com/duckduckgo/iOS/actions/runs/${{ github.run_id }}" } }'
- name: Upload logs when workflow failed
uses: actions/upload-artifact@v3
if: failure()
with:
name: BuildLogs
path: |
xcodebuild.log
DerivedData/Logs/Test/*.xcresult
retention-days: 7


16 changes: 7 additions & 9 deletions .maestro/shared/sync_create.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
appId: com.duckduckgo.mobile.ios
---

- assertVisible: Sync
- tapOn: Sync
- assertVisible: Sync
- tapOn: "0"
- assertVisible: Turn on Sync?
- tapOn: Turn on Sync
- tapOn: Sync Another Device
- tapOn: Show QR Code
- assertVisible: "Go to Settings > Sync in the DuckDuckGo App on a different device and scan this QR code to sync."
- assertVisible: Sync & Back Up
- tapOn: Sync & Back Up
- assertVisible: Sync & Back Up
- tapOn: Start Sync & Back Up
- assertVisible: All Set!
- tapOn: Next
- assertVisible: Save Recovery Code?
2 changes: 1 addition & 1 deletion .maestro/shared/sync_delete.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
appId: com.duckduckgo.mobile.ios
---

- assertVisible: Sync
- assertVisible: Sync & Back Up
- scroll
- tapOn:
point: 50%,91% # TODO: Revisit after new setup flow has been implemented.
Expand Down
6 changes: 2 additions & 4 deletions .maestro/sync_tests/01_create_account.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,7 @@ tags:


# Clean up
- tapOn: Back
- tapOn: Cancel
- tapOn: Not Now
- assertVisible: Sync
- assertVisible: Sync & Back Up
- runFlow:
file: ../shared/sync_delete.yaml
file: ../shared/sync_delete.yaml
17 changes: 7 additions & 10 deletions .maestro/sync_tests/02_login_account.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,25 +21,22 @@ tags:
file: ../shared/sync_create.yaml

# Copy Sync Code and Log Out
- tapOn: Back
- tapOn: Cancel
- assertVisible: Save Recovery Key
- tapOn: Copy Key
- tapOn: Copy Code
- tapOn: Not Now
- tapOn: "1"
- assertVisible: Sync & Back Up
- tapOn: Turn Off Sync & Back Up
- assertVisible: Turn Off Sync?
- tapOn: Remove

# Login
- tapOn: "0"
- tapOn: Recover Your Synced Data
- tapOn: Manually Enter Code
- assertVisible: Sync & Back Up
- tapOn: Enter Text Code
- tapOn: Paste
- assertVisible: Device Synced!
- tapOn: Next
- tapOn: Not Now

# Clean up
- assertVisible: Sync
- assertVisible: Sync & Back Up
- runFlow:
file: ../shared/sync_delete.yaml
file: ../shared/sync_delete.yaml
21 changes: 11 additions & 10 deletions .maestro/sync_tests/03_recover_account.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,12 @@ tags:
- tapOn:
id: searchEntry
- inputText: ${CODE}
- longPressOn:
id: searchEntry
- repeat:
while:
notVisible: "Select All"
commands:
- tapOn:
id: searchEntry
- tapOn: Select All
- tapOn: Cut
- tapOn:
Expand All @@ -35,14 +39,11 @@ tags:
- tapOn: Settings
- runFlow:
file: ../shared/set_internal_user.yaml
- assertVisible: Sync
- tapOn: Sync
- assertVisible: Sync
- tapOn: "0"
- assertVisible: Turn on Sync?
- tapOn: Recover Your Synced Data
- assertVisible: Scan QR Code
- tapOn: Manually Enter Code
- assertVisible: Sync & Back Up
- tapOn: Sync & Back Up
- assertVisible: Sync & Back up
- tapOn: Recover Your Data
- tapOn: Enter Text Code
- tapOn: Paste
- assertVisible: Device Synced!
- tapOn: Next
Expand Down
25 changes: 10 additions & 15 deletions .maestro/sync_tests/04_sync_data.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,14 +56,12 @@ tags:
- tapOn:
id: searchEntry
- inputText: ${CODE}
- longPressOn:
id: searchEntry
- runFlow:
when:
visible:
text: searchEntry
- repeat:
while:
notVisible: "Select All"
commands:
- tapOn: searchEntry
- tapOn:
id: searchEntry
- tapOn: Select All
- tapOn: Cut
- tapOn:
Expand All @@ -86,14 +84,11 @@ tags:
- tapOn: Settings
- runFlow:
file: ../shared/set_internal_user.yaml
- assertVisible: Sync
- tapOn: Sync
- assertVisible: Sync
- tapOn: "0"
- assertVisible: Turn on Sync?
- tapOn: Recover Your Synced Data
- assertVisible: Scan QR Code
- tapOn: Manually Enter Code
- assertVisible: Sync & Back Up
- tapOn: Sync & Back Up
- assertVisible: Sync & Back up
- tapOn: Recover Your Data
- tapOn: Enter Text Code
- tapOn: Paste
- assertVisible: Device Synced!
- tapOn: Next
Expand Down
5 changes: 5 additions & 0 deletions Core/PixelEvent.swift
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,8 @@ extension Pixel {
case networkProtectionClientFailedToEncodeRegisterKeyRequest
case networkProtectionClientFailedToFetchRegisteredServers
case networkProtectionClientFailedToParseRegisteredServersResponse
case networkProtectionClientFailedToFetchLocations
case networkProtectionClientFailedToParseLocationsResponse
case networkProtectionClientFailedToEncodeRedeemRequest
case networkProtectionClientInvalidInviteCode
case networkProtectionClientFailedToRedeemInviteCode
Expand Down Expand Up @@ -810,6 +812,9 @@ extension Pixel.Event {
case .networkProtectionClientFailedToFetchRegisteredServers: return "m_netp_backend_api_error_failed_to_fetch_registered_servers"
case .networkProtectionClientFailedToParseRegisteredServersResponse:
return "m_netp_backend_api_error_parsing_device_registration_response_failed"
case .networkProtectionClientFailedToFetchLocations: return "m_netp_backend_api_error_failed_to_fetch_locations"
case .networkProtectionClientFailedToParseLocationsResponse:
return "m_netp_backend_api_error_parsing_locations_response_failed"
case .networkProtectionClientFailedToEncodeRedeemRequest: return "m_netp_backend_api_error_encoding_redeem_request_body_failed"
case .networkProtectionClientInvalidInviteCode: return "m_netp_backend_api_error_invalid_invite_code"
case .networkProtectionClientFailedToRedeemInviteCode: return "m_netp_backend_api_error_failed_to_redeem_invite_code"
Expand Down
18 changes: 17 additions & 1 deletion DuckDuckGo.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -758,6 +758,8 @@
EE0153EB2A6FF970002A8B26 /* NetworkProtectionRootViewModelTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = EE0153EA2A6FF970002A8B26 /* NetworkProtectionRootViewModelTests.swift */; };
EE0153ED2A6FF9E6002A8B26 /* NetworkProtectionRootView.swift in Sources */ = {isa = PBXBuildFile; fileRef = EE0153EC2A6FF9E6002A8B26 /* NetworkProtectionRootView.swift */; };
EE0153EF2A70021E002A8B26 /* NetworkProtectionInviteView.swift in Sources */ = {isa = PBXBuildFile; fileRef = EE0153EE2A70021E002A8B26 /* NetworkProtectionInviteView.swift */; };
EE01EB402AFBD0000096AAC9 /* NetworkProtectionVPNSettingsViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = EE01EB3F2AFBD0000096AAC9 /* NetworkProtectionVPNSettingsViewModel.swift */; };
EE01EB432AFC1E0A0096AAC9 /* NetworkProtectionVPNLocationView.swift in Sources */ = {isa = PBXBuildFile; fileRef = EE01EB422AFC1E0A0096AAC9 /* NetworkProtectionVPNLocationView.swift */; };
EE276BEA2A77F823009167B6 /* NetworkProtectionRootViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = EE276BE92A77F823009167B6 /* NetworkProtectionRootViewController.swift */; };
EE3766DE2AC5945500AAB575 /* NetworkProtectionUNNotificationPresenter.swift in Sources */ = {isa = PBXBuildFile; fileRef = EE3766DD2AC5945500AAB575 /* NetworkProtectionUNNotificationPresenter.swift */; };
EE3B226B29DE0F110082298A /* MockInternalUserStoring.swift in Sources */ = {isa = PBXBuildFile; fileRef = EE3B226A29DE0F110082298A /* MockInternalUserStoring.swift */; };
Expand Down Expand Up @@ -2361,6 +2363,8 @@
EE0153EA2A6FF970002A8B26 /* NetworkProtectionRootViewModelTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NetworkProtectionRootViewModelTests.swift; sourceTree = "<group>"; };
EE0153EC2A6FF9E6002A8B26 /* NetworkProtectionRootView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NetworkProtectionRootView.swift; sourceTree = "<group>"; };
EE0153EE2A70021E002A8B26 /* NetworkProtectionInviteView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NetworkProtectionInviteView.swift; sourceTree = "<group>"; };
EE01EB3F2AFBD0000096AAC9 /* NetworkProtectionVPNSettingsViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NetworkProtectionVPNSettingsViewModel.swift; sourceTree = "<group>"; };
EE01EB422AFC1E0A0096AAC9 /* NetworkProtectionVPNLocationView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NetworkProtectionVPNLocationView.swift; sourceTree = "<group>"; };
EE276BE92A77F823009167B6 /* NetworkProtectionRootViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NetworkProtectionRootViewController.swift; sourceTree = "<group>"; };
EE3766DD2AC5945500AAB575 /* NetworkProtectionUNNotificationPresenter.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NetworkProtectionUNNotificationPresenter.swift; sourceTree = "<group>"; };
EE3B226A29DE0F110082298A /* MockInternalUserStoring.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MockInternalUserStoring.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -4441,6 +4445,14 @@
name = Root;
sourceTree = "<group>";
};
EE01EB412AFC1DE10096AAC9 /* PreferredLocation */ = {
isa = PBXGroup;
children = (
EE01EB422AFC1E0A0096AAC9 /* NetworkProtectionVPNLocationView.swift */,
);
name = PreferredLocation;
sourceTree = "<group>";
};
EE3766DC2AC5940A00AAB575 /* NetworkProtection */ = {
isa = PBXGroup;
children = (
Expand Down Expand Up @@ -4499,6 +4511,7 @@
isa = PBXGroup;
children = (
EE9D68D02AE00CF300B55EF4 /* NetworkProtectionVPNSettingsView.swift */,
EE01EB3F2AFBD0000096AAC9 /* NetworkProtectionVPNSettingsViewModel.swift */,
);
name = VPNSettings;
sourceTree = "<group>";
Expand All @@ -4515,6 +4528,7 @@
EECD94B22A28B8580085C66E /* NetworkProtection */ = {
isa = PBXGroup;
children = (
EE01EB412AFC1DE10096AAC9 /* PreferredLocation */,
EE9D68D62AE1527F00B55EF4 /* VPNNotifications */,
EE9D68CF2AE00CE000B55EF4 /* VPNSettings */,
EE458D122ABB651500FC651A /* Debug */,
Expand Down Expand Up @@ -6444,6 +6458,7 @@
F1D796F01E7B07610019D451 /* BookmarksViewControllerCells.swift in Sources */,
85058369219F424500ED4EDB /* UIColorExtension.swift in Sources */,
85058368219C49E000ED4EDB /* HomeViewSectionRenderers.swift in Sources */,
EE01EB432AFC1E0A0096AAC9 /* NetworkProtectionVPNLocationView.swift in Sources */,
F456B3B525810BB900B79B90 /* FireButtonAnimationSettingsViewController.swift in Sources */,
9820EAF522613CD30089094D /* WebProgressWorker.swift in Sources */,
B6CB93E5286445AB0090FEB4 /* Base64DownloadSession.swift in Sources */,
Expand Down Expand Up @@ -6514,6 +6529,7 @@
31EF52E1281B3BDC0034796E /* AutofillLoginListItemViewModel.swift in Sources */,
1E4FAA6627D8DFC800ADC5B3 /* CompleteDownloadRowViewModel.swift in Sources */,
83004E862193E5ED00DA013C /* TabViewControllerBrowsingMenuExtension.swift in Sources */,
EE01EB402AFBD0000096AAC9 /* NetworkProtectionVPNSettingsViewModel.swift in Sources */,
EE72CA852A862D000043B5B3 /* NetworkProtectionDebugViewController.swift in Sources */,
C18ED43A2AB6F77600BF3805 /* AutofillSettingsEnableFooterView.swift in Sources */,
CB84C7BD29A3EF530088A5B8 /* AppConfigurationURLProvider.swift in Sources */,
Expand Down Expand Up @@ -9115,7 +9131,7 @@
repositoryURL = "https://github.com/DuckDuckGo/BrowserServicesKit";
requirement = {
kind = exactVersion;
version = 83.0.0;
version = 84.0.0;
};
};
C14882EB27F211A000D59F0C /* XCRemoteSwiftPackageReference "SwiftSoup" */ = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
"repositoryURL": "https://github.com/DuckDuckGo/BrowserServicesKit",
"state": {
"branch": null,
"revision": "f7e20cd37bbc0d25ae3c3f25ef52d319366613e7",
"version": "83.0.0"
"revision": "9c2c7f39679a1f4441fec95fda86f4c089724e2e",
"version": "84.0.0"
}
},
{
Expand Down
1 change: 0 additions & 1 deletion DuckDuckGo/BrokenSiteInfo.swift
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,6 @@ public struct BrokenSiteInfo {
Keys.tds: tdsETag?.trimmingCharacters(in: CharacterSet(charactersIn: "\"")) ?? "",
Keys.blockedTrackers: blockedTrackerDomains.joined(separator: ","),
Keys.surrogates: installedSurrogates.joined(separator: ","),
Keys.atb: StatisticsUserDefaults().atb ?? "",
Keys.os: systemVersion,
Keys.manufacturer: manufacturer,
Keys.model: model,
Expand Down
7 changes: 6 additions & 1 deletion DuckDuckGo/EventMapping+NetworkProtectionError.swift
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,12 @@ extension EventMapping where Event == NetworkProtectionError {
var params: [String: String] = [:]

switch event {
case .failedToFetchLocationList(let error):
pixelEvent = .networkProtectionClientFailedToFetchLocations
pixelError = error
case .failedToParseLocationListResponse(let error):
pixelEvent = .networkProtectionClientFailedToParseLocationsResponse
pixelError = error
case .failedToEncodeRedeemRequest:
pixelEvent = .networkProtectionClientFailedToEncodeRedeemRequest
case .invalidInviteCode:
Expand Down Expand Up @@ -89,7 +95,6 @@ extension EventMapping where Event == NetworkProtectionError {
// Should never be sent from from the app
case .unhandledError(function: let function, line: let line, error: let error):
pixelEvent = .networkProtectionUnhandledError

}

DailyPixel.fireDailyAndCount(pixel: pixelEvent, error: pixelError, withAdditionalParameters: params)
Expand Down
29 changes: 28 additions & 1 deletion DuckDuckGo/NetworkProtectionConvenienceInitialisers.swift
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,12 @@ extension NetworkProtectionKeychainTokenStore {

extension NetworkProtectionCodeRedemptionCoordinator {
convenience init() {
self.init(tokenStore: NetworkProtectionKeychainTokenStore(), errorEvents: .networkProtectionAppDebugEvents)
let tunnelSettings = TunnelSettings(defaults: .networkProtectionGroupDefaults)
self.init(
environment: tunnelSettings.selectedEnvironment,
tokenStore: NetworkProtectionKeychainTokenStore(),
errorEvents: .networkProtectionAppDebugEvents
)
}
}

Expand All @@ -68,4 +73,26 @@ extension NetworkProtectionVPNNotificationsViewModel {
}
}

extension NetworkProtectionVPNSettingsViewModel {
convenience init() {
self.init(
tunnelSettings: TunnelSettings(defaults: .networkProtectionGroupDefaults)
)
}
}

extension NetworkProtectionVPNLocationViewModel {
convenience init() {
let tunnelSettings = TunnelSettings(defaults: .networkProtectionGroupDefaults)
let locationListRepository = NetworkProtectionLocationListCompositeRepository(
environment: tunnelSettings.selectedEnvironment,
tokenStore: NetworkProtectionKeychainTokenStore()
)
self.init(
locationListRepository: locationListRepository,
tunnelSettings: TunnelSettings(defaults: .networkProtectionGroupDefaults)
)
}
}

#endif
Loading

0 comments on commit e7e211b

Please sign in to comment.