Skip to content

Commit

Permalink
Merge branch 'main' into jacek/xcode15
Browse files Browse the repository at this point in the history
* main: (35 commits)
  Add Sync feature flags (#2279)
  Add Sync Success Rate pixel  (#2277)
  add test 5 and fix test 4 (#2276)
  Fix: "SwiftLintPlugin" must be enabled before it can be used (#2274)
  Send WG invalid state reason (#2275)
  Typo
  Fix: "SwiftLintPlugin" must be enabled before it can be used
  Release 7.102.0 (#2273)
  Add search retention pixel for NetP (#2267)
  Run sync tests in matrix (#2263)
  SwiftLint build plugin (#2233)
  Update VPN active user check and debug options (#2269)
  Update Autofill Logins copy (#2246)
  Remove the reconnect/disconnect logic from the connection tester (#2272)
  Remove the Fastlane notes file temporarily (#2270)
  remove QR code from save recovery PDF view (#2271)
  Show dev environment indicator in Sync Settings (#2265)
  Release 7.101.0.1 (#2262)
  Sync Flow Error Handling (#2264)
  Fix fingerprinting UI tests (#2252)
  ...
  • Loading branch information
samsymons committed Dec 21, 2023
2 parents c23d095 + 4240dd5 commit 6a812a2
Show file tree
Hide file tree
Showing 87 changed files with 2,295 additions and 912 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/adhoc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,13 @@ jobs:
echo "dsyms_path=${{ github.workspace }}/${{ env.dsyms_filename }}" >> $GITHUB_ENV
- name: Upload IPA artifact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: ${{ env.ipa_filename }}
path: ${{ env.ipa_path }}

- name: Upload dSYMs artifact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: ${{ env.dsyms_filename }}
path: ${{ env.dsyms_path }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/alpha.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ jobs:

- name: Set cache key hash
run: |
has_only_tags=$(jq '[ .object.pins[].state | has("version") ] | all' DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved)
has_only_tags=$(jq '[ .pins[].state | has("version") ] | all' DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved)
if [[ "$has_only_tags" == "true" ]]; then
echo "cache_key_hash=${{ hashFiles('DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved') }}" >> $GITHUB_ENV
else
Expand Down Expand Up @@ -97,7 +97,7 @@ jobs:
echo "build_version=${build_version}" >> $GITHUB_ENV
- name: Upload dSYMs artifact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: DuckDuckGo-Alpha-dSYM-${{ env.app_version }}
path: ${{ env.dsyms_path }}
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ jobs:
-target "DuckDuckGo" \
-scheme "DuckDuckGo" \
-destination "platform=iOS Simulator,name=iPhone 14,OS=16.4"
-skipPackagePluginValidation \
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/end-to-end.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:

- name: Set cache key hash
run: |
has_only_tags=$(jq '[ .object.pins[].state | has("version") ] | all' DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved)
has_only_tags=$(jq '[ .pins[].state | has("version") ] | all' DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved)
if [[ "$has_only_tags" == "true" ]]; then
echo "cache_key_hash=${{ hashFiles('DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved') }}" >> $GITHUB_ENV
else
Expand All @@ -42,6 +42,7 @@ jobs:
-scheme "DuckDuckGo" \
-destination "platform=iOS Simulator,name=iPhone 14,OS=16.4" \
-derivedDataPath "DerivedData" \
-skipPackagePluginValidation \
| tee xcodebuild.log
- name: Release tests
Expand Down Expand Up @@ -78,7 +79,7 @@ jobs:
--data ' { "data": { "name": "GH Workflow Failure - 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
uses: actions/upload-artifact@v4
if: failure()
with:
name: BuildLogs
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:

- name: Set cache key hash
run: |
has_only_tags=$(jq '[ .object.pins[].state | has("version") ] | all' DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved)
has_only_tags=$(jq '[ .pins[].state | has("version") ] | all' DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved)
if [[ "$has_only_tags" == "true" ]]; then
echo "cache_key_hash=${{ hashFiles('DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved') }}" >> $GITHUB_ENV
else
Expand Down Expand Up @@ -46,11 +46,12 @@ jobs:
-scheme "AtbUITests" \
-destination "platform=iOS Simulator,name=iPhone 14,OS=16.4" \
-derivedDataPath "DerivedData" \
-skipPackagePluginValidation \
| tee xcodebuild.log \
| xcbeautify --report junit --report-path . --junit-report-filename unittests.xml
- name: Upload logs if workflow failed
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
if: failure()
with:
name: BuildLogs
Expand Down Expand Up @@ -87,6 +88,7 @@ jobs:
-scheme "FingerprintingUITests" \
-destination "platform=iOS Simulator,name=iPhone 14,OS=16.4" \
-derivedDataPath "DerivedData" \
-skipPackagePluginValidation \
| xcbeautify --report junit --report-path . --junit-report-filename unittests.xml
- name: Publish unit tests report
Expand Down
10 changes: 6 additions & 4 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
steps:
- uses: actions/checkout@v3
- name: SwiftLint
uses: docker://norionomura/swiftlint:0.53.0
uses: docker://norionomura/swiftlint:0.54.0_swift-5.9.0
with:
args: swiftlint --reporter github-actions-logging --strict

Expand Down Expand Up @@ -53,7 +53,7 @@ jobs:

- name: Set cache key hash
run: |
has_only_tags=$(jq '[ .object.pins[].state | has("version") ] | all' DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved)
has_only_tags=$(jq '[ .pins[].state | has("version") ] | all' DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved)
if [[ "$has_only_tags" == "true" ]]; then
echo "cache_key_hash=${{ hashFiles('DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved') }}" >> $GITHUB_ENV
else
Expand Down Expand Up @@ -81,12 +81,13 @@ jobs:
-scheme "DuckDuckGo" \
-destination "platform=iOS Simulator,name=iPhone 15,OS=17.2" \
-derivedDataPath "DerivedData" \
-skipPackagePluginValidation \
DDG_SLOW_COMPILE_CHECK_THRESHOLD=250 \
| tee xcodebuild.log \
| xcbeautify --report junit --report-path . --junit-report-filename unittests.xml
- name: Upload logs if workflow failed
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
if: failure()
with:
name: BuildLogs
Expand Down Expand Up @@ -144,7 +145,7 @@ jobs:

- name: Set cache key hash
run: |
has_only_tags=$(jq '[ .object.pins[].state | has("version") ] | all' DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved)
has_only_tags=$(jq '[ .pins[].state | has("version") ] | all' DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved)
if [[ "$has_only_tags" == "true" ]]; then
echo "cache_key_hash=${{ hashFiles('DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved') }}" >> $GITHUB_ENV
else
Expand Down Expand Up @@ -183,6 +184,7 @@ jobs:
-destination "platform=iOS Simulator,name=iPhone 14" \
-derivedDataPath "DerivedData" \
-configuration "Release" \
-skipPackagePluginValidation \
| xcbeautify
create-asana-task:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ jobs:
- name: Upload dSYMs artifact
if: always()
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: DuckDuckGo-${{ steps.destination.outputs.destination }}-dSYM-${{ env.app_version }}
path: ${{ env.dsyms_path }}
Expand Down
84 changes: 61 additions & 23 deletions .github/workflows/sync-end-to-end.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@ on:
- cron: '0 5 * * *' # run at 5 AM UTC

jobs:
sync-end-to-end-tests:
name: Sync End to end Tests
build-for-sync-end-to-end-tests:
name: Build for Sync End To End Tests
runs-on: macos-13
timeout-minutes: 30

steps:
- name: Check out the code
Expand All @@ -17,7 +18,7 @@ jobs:

- name: Set cache key hash
run: |
has_only_tags=$(jq '[ .object.pins[].state | has("version") ] | all' DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved)
has_only_tags=$(jq '[ .pins[].state | has("version") ] | all' DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved)
if [[ "$has_only_tags" == "true" ]]; then
echo "cache_key_hash=${{ hashFiles('DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved') }}" >> $GITHUB_ENV
else
Expand All @@ -40,43 +41,80 @@ jobs:
run: |
set -o pipefail && xcodebuild \
-scheme "DuckDuckGo" \
-destination "platform=iOS Simulator,name=iPhone 14,OS=16.4" \
-destination "platform=iOS Simulator,name=iPhone 14" \
-derivedDataPath "DerivedData" \
-skipPackagePluginValidation \
| tee xcodebuild.log
- name: Store Binary
uses: actions/upload-artifact@v4
with:
name: duckduckgo-ios-app
path: DerivedData/Build/Products/Debug-iphonesimulator/DuckDuckGo.app

- name: Upload logs when workflow failed
uses: actions/upload-artifact@v4
if: failure()
with:
name: BuildLogs
path: |
xcodebuild.log
DerivedData/Logs/Test/*.xcresult
retention-days: 7

sync-end-to-end-tests:
name: Sync End To End Tests
needs: build-for-sync-end-to-end-tests
runs-on: macos-13
timeout-minutes: 30
strategy:
matrix:
os-version: [15, 16, 17]
#max-parallel: 1 # Uncomment this line to run tests sequentially.
fail-fast: false

steps:
- name: Check out the code
uses: actions/checkout@v3 # Don't need submodules here as this is only for the tests folder

- name: Create test account for Sync and return the recovery code
uses: duckduckgo/sync_crypto/action@main
id: sync-recovery-code
with:
debug: true

- name: Sync e2e tests
uses: mobile-dev-inc/[email protected]
- name: Retrieve Binary
uses: actions/download-artifact@v4
with:
name: duckduckgo-ios-app
path: DerivedData/Build/Products/Debug-iphonesimulator/DuckDuckGo.app

- name: Sync e2e tests
uses: mobile-dev-inc/[email protected]
with:
api-key: ${{ secrets.MAESTRO_CLOUD_API_KEY }}
app-file: DerivedData/Build/Products/Debug-iphonesimulator/DuckDuckGo.app
ios-version: ${{ matrix.os-version }}
workspace: .maestro
include-tags: sync
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 }}" } }'
notify-failure:
name: Notify on failure
if: ${{ always() && contains(join(needs.*.result, ','), 'failure') }}
needs: [build-for-sync-end-to-end-tests, sync-end-to-end-tests]
runs-on: ubuntu-latest

- 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
steps:
- name: Create Asana task when workflow failed
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 }}" } }'


21 changes: 21 additions & 0 deletions .maestro/shared/add_bookmarks_and_favorites.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
appId: com.duckduckgo.mobile.ios
---

- tapOn:
id: searchEntry
- inputText: www.duckduckgo.com
- pressKey: Enter
- runFlow:
when:
visible:
text: "Got It"
commands:
- tapOn: Got It
- tapOn: Browsing Menu
- tapOn: Add Favorite
- tapOn:
id: searchEntry
- inputText: www.spreadprivacy.com
- pressKey: Enter
- tapOn: Browsing Menu
- tapOn: Add Bookmark
15 changes: 15 additions & 0 deletions .maestro/shared/add_login_from_settings.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
appId: com.duckduckgo.mobile.ios
---

- tapOn: Passwords
- tapOn: Add 24
- tapOn: Title
- inputText: My Personal Website
- tapOn: [email protected]
- inputText: [email protected]
- tapOn: example.com
- inputText: mypersonalwebsite.com
- tapOn: Save
- tapOn: Passwords
- tapOn: Settings
- tapOn: Done
9 changes: 9 additions & 0 deletions .maestro/shared/copy_recovery_code.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
appId: com.duckduckgo.mobile.ios
---
# # - Put the code in the clipboard on Maestro Cloud
# # - Prevent iOS from showing the Paste permission alert as Maestro can't handle it
- tapOn: Sync Info
- tapOn: Paste and Copy Recovery Code
- inputText: ${CODE}
- tapOn: Copy
- tapOn: Debug
16 changes: 16 additions & 0 deletions .maestro/shared/copy_recovery_code_from_settings.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# copy_recovery_code_from_settings.yaml

appId: com.duckduckgo.mobile.ios
---

- scroll
- scroll
- scroll
- assertVisible: Debug Menu
- tapOn: Debug Menu
- tapOn: Sync Info
- tapOn: Paste and Copy Recovery Code
- inputText: ${CODE}
- tapOn: Copy
- tapOn: Debug
- tapOn: Settings
12 changes: 12 additions & 0 deletions .maestro/shared/remove_local_bookmarks.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
appId: com.duckduckgo.mobile.ios
---

- tapOn: Bookmarks
- tapOn: Edit
- tapOn: Spread Privacy
- scroll
- scroll
- tapOn: Delete
- tapOn: Delete
- tapOn: Done
- tapOn: Done
13 changes: 13 additions & 0 deletions .maestro/shared/remove_local_logins.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
appId: com.duckduckgo.mobile.ios
---

- tapOn: Settings
- tapOn: Passwords
- tapOn: Passcode field
- inputText: "0000"
- pressKey: Enter
- tapOn: My Personal Website
- tapOn: Delete Password
- tapOn: Delete Password
- tapOn: Settings
- tapOn: Done
File renamed without changes.
1 change: 1 addition & 0 deletions .maestro/shared/sync_create.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@ appId: com.duckduckgo.mobile.ios
- tapOn: Next
- assertVisible: Your Data is Synced!
- tapOn: Done
- assertVisible: Sync Enabled
3 changes: 1 addition & 2 deletions .maestro/shared/sync_delete.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ appId: com.duckduckgo.mobile.ios

- assertVisible: Sync & Backup
- scroll
- tapOn:
point: 50%,91% # TODO: Revisit after new setup flow has been implemented.
- tapOn: Turn Off and Delete Server Data...
- assertVisible: Delete Server Data?
- tapOn: Delete Server Data
- assertVisible: Begin Syncing
Loading

0 comments on commit 6a812a2

Please sign in to comment.