Skip to content

Commit

Permalink
Merge branch 'main' into sam/remove-atb-from-default-pixel-parameters
Browse files Browse the repository at this point in the history
# By Daniel Bernal (33) and others
# Via Mariusz Śpiewak (5) and others
* main: (245 commits)
  Fix inconsistent bars state when scrolling (#2733)
  fix tests (#2732)
  Release 7.115.0-4 (#2729)
  Fix VPN denial prompt loop (#2728)
  Small UI Fixes for subscriptions (#2690)
  SPM updated: SwiftSoup, Lottie, ZIPFoundation (#2724)
  Release 7.115.0-3 (#2727)
  VPN: Specific TunnelController start failure reporting (#2714)
  update bsk dependency (#2725)
  Subscriptions: Fix thread issue on Subscription Restore (#2719)
  Manage ‘Stale’ PRs (#2723)
  maestro: hide dax dialogs if visible and cancel keyboard after fireproof (#2695)
  Remove timezone offset from the VPN server object (#2701)
  Reverting accidental push to main (#2718)
  Add SubscriptionContainerViewModel and
  Manually hide loader + Pixel (#2687)
  Release 7.115.0-2 (#2712)
  soft revert history suggestions (#2711)
  Bring back accessibility identifiers for onboarding buttons (#2709)
  BSK release 133.1.0 (#2708)
  ...

# Conflicts:
#	Core/Pixel.swift
  • Loading branch information
samsymons committed Apr 15, 2024
2 parents f1ac813 + 398bed3 commit 1ef806a
Show file tree
Hide file tree
Showing 814 changed files with 39,628 additions and 12,239 deletions.
1 change: 1 addition & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ jobs:
-scheme "DuckDuckGo" \
-destination "platform=iOS Simulator,name=iPhone 14,OS=16.4"
-skipPackagePluginValidation \
-skipMacroValidation \
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/end-to-end.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ name: End-to-End tests
on:
schedule:
- cron: '0 4 * * *' # run at 4 AM UTC
workflow_dispatch:

jobs:
end-to-end-tests:
Expand Down Expand Up @@ -43,6 +44,7 @@ jobs:
-destination "platform=iOS Simulator,name=iPhone 15,OS=17.2" \
-derivedDataPath "DerivedData" \
-skipPackagePluginValidation \
-skipMacroValidation \
ONLY_ACTIVE_ARCH=NO \
| tee xcodebuild.log
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ jobs:
-destination "platform=iOS Simulator,name=iPhone 15,OS=17.2" \
-derivedDataPath "DerivedData" \
-skipPackagePluginValidation \
-skipMacroValidation \
| tee xcodebuild.log \
| xcbeautify --report junit --report-path . --junit-report-filename unittests.xml
Expand Down Expand Up @@ -89,6 +90,7 @@ jobs:
-destination "platform=iOS Simulator,name=iPhone 15,OS=17.2" \
-derivedDataPath "DerivedData" \
-skipPackagePluginValidation \
-skipMacroValidation \
| xcbeautify --report junit --report-path . --junit-report-filename unittests.xml
- name: Publish unit tests report
Expand Down
136 changes: 136 additions & 0 deletions .github/workflows/pr-task-url.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,136 @@
name: Asana PR Task URL

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

jobs:

# This job is used to assert that the task linked in the PR description belongs to the specified project (App Board).
assert-project-membership:

name: Check App Board Project Membership

runs-on: ubuntu-latest

outputs:
task_id: ${{ steps.get-task-id.outputs.task_id }}
failure: ${{ steps.check-task-url.outputs.failure }}

steps:
- name: Get Task ID
id: get-task-id
env:
BODY: ${{ github.event.pull_request.body }}
run: |
task_id=$(grep -i "task/issue url.*https://app.asana.com/" <<< "$BODY" \
| sed -E 's|.*https://(.*)|\1|' \
| cut -d '/' -f 4)
echo "task_id=$task_id" >> $GITHUB_OUTPUT
- name: Check Task URL
id: check-task-url
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
ASANA_ACCESS_TOKEN: ${{ secrets.ASANA_ACCESS_TOKEN }}
ASANA_PROJECT_ID: ${{ vars.IOS_APP_BOARD_ASANA_PROJECT_ID }}
run: |
project_ids="$(curl -fLSs "https://app.asana.com/api/1.0/tasks/${{ steps.get-task-id.outputs.task_id }}?opt_fields=projects" \
-H "Authorization: Bearer ${{ env.ASANA_ACCESS_TOKEN }}" \
| jq -r .data.projects[].gid)"
if grep -q "\b${{ env.ASANA_PROJECT_ID }}\b" <<< $project_ids; then
echo "failure=0" >> $GITHUB_OUTPUT
else
echo "failure=1" >> $GITHUB_OUTPUT
fi
# If a task URL is present, but task is missing from the App Board project, add a comment to the PR and fail the check.
# Otherwise, delete the comment and pass the check.
update-project-membership-report:

name: App Board Project Membership Report

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

needs: [assert-project-membership]

steps:
- name: Comment on the PR
if: ${{ needs.assert-project-membership.outputs.task_id && needs.assert-project-membership.outputs.failure == '1' }}
env:
ASANA_PROJECT_NAME: ${{ vars.IOS_APP_BOARD_ASANA_PROJECT_NAME }}
uses: marocchino/sticky-pull-request-comment@v2
with:
header: asana-task-check-status
message: |
:no_entry_sign: The Asana task linked in the PR description is not added to ${{ env.ASANA_PROJECT_NAME }} project.
1. Verify that the correct task is linked in the PR.
* :warning: Please use the actual implementation task, rather than the Code Review subtask.
2. Verify that the task is added to ${{ env.ASANA_PROJECT_NAME }} project.
3. When ready, remove the `bot: not in app board` label to retrigger the check.
- name: Add a label to the PR
if: ${{ needs.assert-project-membership.outputs.task_id && needs.assert-project-membership.outputs.failure == '1' }}
uses: actions/github-script@v7
with:
script: |
github.rest.issues.addLabels({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
labels: ['bot: not in app board']
})
- name: Delete comment on the PR
if: ${{ needs.assert-project-membership.outputs.task_id == '' || needs.assert-project-membership.outputs.failure == '0' }}
uses: marocchino/sticky-pull-request-comment@v2
with:
header: asana-task-check-status
delete: true

- name: Remove the label from the PR
if: ${{ needs.assert-project-membership.outputs.task_id == '' || needs.assert-project-membership.outputs.failure == '0' }}
uses: actions/github-script@v7
with:
script: |
try {
await github.rest.issues.removeLabel({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
name: 'bot: not in app board'
});
} catch (error) {
if (error.status !== 404) {
throw error;
}
}
- name: Report status
if: ${{ needs.assert-project-membership.outputs.task_id }}
run: exit ${{ needs.assert-project-membership.outputs.failure }}

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

name: Move to Waiting for Release on Merge

runs-on: ubuntu-latest
if: github.event.action == 'closed' && github.event.pull_request.merged == true

needs: [assert-project-membership]

steps:
- name: Move to Waiting for Release
if: ${{ needs.assert-project-membership.result.failure == '0' }}
env:
ASANA_ACCESS_TOKEN: ${{ secrets.ASANA_ACCESS_TOKEN }}
ASANA_PROJECT_ID: ${{ vars.IOS_APP_BOARD_ASANA_PROJECT_ID }}
run: |
curl -fLSs -X POST "https://app.asana.com/api/1.0/sections/${{ vars.IOS_APP_BOARD_WAITING_FOR_RELEASE_SECTION_ID }}/addTask" \
-H "Authorization: Bearer ${{ env.ASANA_ACCESS_TOKEN }}" \
-H "Content-Type: application/json" \
--output /dev/null \
-d "{\"data\": {\"task\": \"${{ needs.assert-project-membership.outputs.task_id }}\"}}"
2 changes: 2 additions & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ jobs:
-destination "platform=iOS Simulator,name=iPhone 15,OS=17.2" \
-derivedDataPath "DerivedData" \
-skipPackagePluginValidation \
-skipMacroValidation \
DDG_SLOW_COMPILE_CHECK_THRESHOLD=250 \
| tee xcodebuild.log \
| xcbeautify --report junit --report-path . --junit-report-filename unittests.xml
Expand Down Expand Up @@ -188,6 +189,7 @@ jobs:
-derivedDataPath "DerivedData" \
-configuration "Release" \
-skipPackagePluginValidation \
-skipMacroValidation \
| xcbeautify
create-asana-task:
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ jobs:
else
echo "::error::Asana Task URL has incorrect format (attempted to match ${task_url_regex})."
fi
- name: Upload debug symbols to Asana
if: ${{ always() && github.event.inputs.asana-task-url }}
env:
Expand All @@ -109,6 +109,7 @@ jobs:
fi
- name: Send Mattermost message
if: ${{ success() || failure() }} # Don't execute when cancelled
env:
WORKFLOW_URL: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}
DESTINATION: ${{ steps.destination.outputs.destination }}
Expand All @@ -117,9 +118,8 @@ jobs:
if [[ -z "${MM_USER_HANDLE}" ]]; then
echo "Mattermost user handle not known for ${{ github.actor }}, skipping sending message"
else
else
curl -s -H 'Content-type: application/json' \
-d "$(envsubst < ./scripts/assets/appstore-release-mm-template.json)" \
-d "$(envsubst < ./scripts/assets/appstore-release-mm-template.json | jq ".${{ job.status }}")" \
${{ secrets.MM_WEBHOOK_URL }}
fi
19 changes: 19 additions & 0 deletions .github/workflows/stale-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Close Stale Pull Requests

on:
schedule:
- cron: '0 0 * * *'

jobs:
close_stale_prs:
runs-on: ubuntu-latest
steps:
- name: Close stale pull requests
uses: actions/stale@v9
with:
stale-pr-message: 'This PR has been inactive for more than 7 days and will be automatically closed 7 days from now.'
days-before-stale: 7
close-pr-message: 'This PR has been closed after 14 days of inactivity. Feel free to reopen it if you plan to continue working on it or have further discussions.'
days-before-close: 7
stale-pr-label: stale
exempt-draft-pr: true
1 change: 1 addition & 0 deletions .github/workflows/sync-end-to-end.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ jobs:
-destination "platform=iOS Simulator,name=iPhone 15" \
-derivedDataPath "DerivedData" \
-skipPackagePluginValidation \
-skipMacroValidation \
ONLY_ACTIVE_ARCH=NO \
| tee xcodebuild.log
Expand Down
65 changes: 65 additions & 0 deletions .maestro/browser_features/opening_tabs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
# tabs.yaml
appId: com.duckduckgo.mobile.ios
tags:
- release

---

# Set up
- clearState
- launchApp
- runFlow:
when:
visible:
text: "Let’s Do It!"
index: 0
file: ../shared/onboarding.yaml

# Load Site
- assertVisible:
id: "searchEntry"
- tapOn:
id: "searchEntry"
- inputText: "https://privacy-test-pages.site"
- pressKey: Enter

# Manage onboarding
- runFlow:
when:
visible:
text: "Got It"
index: 0
file: ../shared/onboarding_browsing.yaml

- assertVisible: ".*Privacy Test Pages.*"
- tapOn: "Links Open in New Window"

# Validate there's one tab
- runFlow:
file: ../shared/check_number_of_tabs.yaml
env:
TITLE: "1 Private Tab"

- tapOn: "Opens in new window"
- runFlow:
file: ../shared/check_number_of_tabs.yaml
env:
TITLE: "2 Private Tabs"

- tapOn: "Close"
- assertVisible: "A link that opens in a new window"
- tapOn: "Opens in new window"
- runFlow:
file: ../shared/check_number_of_tabs.yaml
env:
TITLE: "2 Private Tabs"

- tapOn: "Browse Back"
- assertVisible: "A link that opens in a new window"

# Workaround - for some reason Tab Switcher button is not found by maestro at this point.
- tapOn: "Refresh Page"
- runFlow:
file: ../shared/check_number_of_tabs.yaml
env:
TITLE: "1 Private Tab"
79 changes: 79 additions & 0 deletions .maestro/data_clearing_tests/01_fire_proofing.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
appId: com.duckduckgo.mobile.ios
tags:
- privacy

---

# Set up
- clearState
- launchApp
- runFlow:
when:
visible:
text: "Let’s Do It!"
index: 0
file: ../shared/onboarding.yaml

# Load Site
- assertVisible:
id: "searchEntry"
- tapOn:
id: "searchEntry"
- inputText: "https://setcookie.net"
- pressKey: Enter
- runFlow:
file: ../shared/hide_daxdialogs.yaml

# Set a cookie
- assertVisible: "Cookie Test"
- tapOn: "Cookie name"
- inputText: "TestName"
- tapOn: "Cookie value"
- inputText: "TestValue"
- tapOn: "Done"
- scrollUntilVisible:
element:
text: "Submit"
- tapOn: "Submit"

# Fireproof the site
- tapOn: "Browsing Menu"
- tapOn: "Fireproof This Site"
- tapOn: "Fireproof"
- assertVisible: "setcookie.net is now Fireproof"

# Fire Button - twice, just to be sure
- tapOn: "Close Tabs and Clear Data"
- tapOn:
id: "alert.forget-data.confirm"
- assertVisible: "Cancel"
- tapOn: "Cancel"
- assertVisible:
id: "searchEntry"
- tapOn: "Close Tabs and Clear Data"
- tapOn:
id: "alert.forget-data.confirm"

# Validate Cookie was retained
- tapOn:
id: "searchEntry"
- inputText: "https://setcookie.net"
- pressKey: Enter
- assertVisible: "TestName = TestValue"

# Remove fireproofing
- tapOn: "Browsing Menu"
- tapOn: "Remove Fireproofing"

# Fire Button
- tapOn: "Close Tabs and Clear Data"
- tapOn:
id: "alert.forget-data.confirm"

# Validate Cookie was removed
- tapOn:
id: "searchEntry"
- inputText: "https://setcookie.net"
- pressKey: Enter
- assertVisible: "Cookie Test"
- assertVisible: "Received no cookies."
Loading

0 comments on commit 1ef806a

Please sign in to comment.