Skip to content

Commit

Permalink
Merge branch 'release/5.216.0' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
Dax the Deployer committed Oct 3, 2024
2 parents 666b9ab + e3889ad commit 43b85c9
Show file tree
Hide file tree
Showing 399 changed files with 21,524 additions and 7,956 deletions.
67 changes: 67 additions & 0 deletions .github/actions/assign-release-task/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: 'Assign Android Release Task in Asana'
description: 'Assigns the latest Asana Release task to the user who runs the workflow'
inputs:
task_name:
description: 'The name of the task to search for'
required: true
asana_token:
description: 'Asana Personal Access Token'
required: true
project_gid:
description: 'Asana Project GID to search within'
required: true
username:
description: 'The Github username to search for'
required: true
runs:
using: 'composite'
steps:
- name: Find task in Asana and assign it to owner
shell: bash
run: |
task_name="${{ inputs.task_name }}"
asana_token="${{ inputs.asana_token }}"
project_gid="${{ inputs.project_gid }}"
username="${{ inputs.username }}"
# Make the API request to get tasks from the specified project
response=$(curl -s -X GET "https://app.asana.com/api/1.0/projects/${project_gid}/tasks" \
-H "Authorization: Bearer ${asana_token}")
# Check if the response contains any tasks that match the specified task name exactly
task_id=$(echo "$response" | jq -r '.data[] | select(.name == "'"$task_name"'") | .gid')
if [ -z "$task_id" ]; then
echo "No tasks with the exact name '$task_name' found in project GID '$project_gid'."
exit 1
else
echo "Task ID for the task named '$task_name': $task_id"
fi
asana_user_id=$(grep -E "^$username: " .github/actions/assign-release-task/github_asana_mapping.yml | awk -F': ' '{print $2}' | tr -d '"')
if [ -z "asana_user_id" ]; then
echo "User $username not found."
exit 1
else
echo "User ID for $username: $asana_user_id"
fi
echo "Assigning task ID $task_id to user ID $asana_user_id"
# Assign the task to the user
response=$(curl -s -X PUT "https://app.asana.com/api/1.0/tasks/${task_id}" \
-H "Authorization: Bearer ${asana_token}" \
-H "Content-Type: application/json" \
-d "{\"data\": {\"assignee\": \"${asana_user_id}\"}}")
# Check if the assignment was successful
status=$(echo $response | jq -r '.errors')
if [ "$status" == "null" ]; then
echo "Task $task_id successfully assigned to user $asana_user_id."
else
echo "Failed to assign task: $status"
exit 1
fi
13 changes: 13 additions & 0 deletions .github/actions/assign-release-task/github_asana_mapping.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
malmstein: "1157893581871899"
marcosholgado: "1125189844075764"
aitorvs: "1198194956790048"
CDRussell: "608920331025313"
anikiki: "1200581511061484"
joshliebe: "1200204095365673"
karlenDimla: "1201462763414791"
cmonfortep: "1149059203346875"
lmac012: "1205617573940213"
nalcalag: "1201807753392396"
CrisBarreiro: "1204920898013507"
0nko: "1207418217763343"
mikescamell: "1207908161520961"
2 changes: 1 addition & 1 deletion .github/workflows/e2e-nightly-autofill.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ jobs:
api-key: ${{ secrets.MOBILE_DEV_API_KEY }}
name: ${{ github.sha }}
app-file: apk/release.apk
android-api-level: 30
android-api-level: 33
workspace: .maestro
include-tags: autofillNoAuthTests

Expand Down
63 changes: 63 additions & 0 deletions .github/workflows/release_create_task.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: Create Android App Release Task

on:
workflow_dispatch:
inputs:
app-version:
description: 'App Version for Release'
required: true
default: 'PLACEHOLDER'

env:
ASANA_PAT: ${{ secrets.GH_ASANA_SECRET }}

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
create_release_task:
name: Create Android App Release Task in Asana
runs-on: macos-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Check app-version value
run: |
if [ "${{ github.event.inputs.app-version }}" == "PLACEHOLDER" ]; then
echo "Input value cannot be 'PLACEHOLDER'."
exit 1
else
echo "Input value is valid: ${{ github.event.inputs.app-version }}"
fi
- name: Install Release Bridge from Homebrew
run: |
brew tap cdrussell/aarb
brew install aarb
- name: Create task in Asana
run: |
AndroidAsanaBridge version=${{ github.event.inputs.app-version }} action=createRelease,tagPendingTasks,addLinksToDescription,removePendingTasks
- name: Assign task to Github Actor
id: assign-release-task
uses: ./.github/actions/assign-release-task
with:
task_name: 'Android Release ${{ github.event.inputs.app-version }}'
asana_token: ${{ secrets.GH_ASANA_SECRET }}
project_gid: ${{ vars.GH_ANDROID_RELEASE_BOARD_PROJECT_ID }}
username: ${{ github.actor }}

- name: Create Asana task when workflow failed
if: ${{ failure() }}
uses: duckduckgo/native-github-asana-sync@v1.1
with:
asana-pat: ${{ secrets.GH_ASANA_SECRET }}
asana-project: ${{ vars.GH_ANDROID_APP_PROJECT_ID }}
asana-section: ${{ vars.GH_ANDROID_APP_INCOMING_SECTION_ID }}
asana-task-name: GH Workflow Failure - Create Android App Release Task
asana-task-description: The Create Android App Release Task workflow has failed. See https://github.com/duckduckgo/Android/actions/runs/${{ github.run_id }}
action: 'create-asana-task'
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ tags:
text: "Set of components designed following our Design System"
direction: DOWN
- assertVisible: "Set of components designed following our Design System"
- tapOn: "App Components Design Preview"
- tapOn: "Android Design System Preview"
- assertVisible: "COLOR PALETTE"
- tapOn: "TYPOGRAPHY"
- scrollUntilVisible:
Expand Down
24 changes: 24 additions & 0 deletions .maestro/autofill/2_autofill_add_search_update_delete_creds.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,21 +28,33 @@ tags:
- assertNotVisible:
id: view_menu_save

- scrollUntilVisible:
element:
id: usernameEditText
- tapOn:
id: usernameEditText
- inputText: "user"

- assertVisible:
id: view_menu_save

- scrollUntilVisible:
element:
id: passwordEditText
- tapOn:
id: passwordEditText
- inputText: "123"

- scrollUntilVisible:
element:
id: domainEditText
- tapOn:
id: domainEditText
- inputText: "${output.addLogins.domains[output.addLogins.counter]}"

- scrollUntilVisible:
element:
id: notesEditText
- tapOn:
id: notesEditText
- inputText: "a note"
Expand All @@ -51,6 +63,9 @@ tags:
id: view_menu_save
retryTapIfNoChange: false

- scrollUntilVisible:
element:
text: "Last updated.*"
- assertVisible: "Last updated.*"

- tapOn: "Navigate up"
Expand All @@ -59,15 +74,24 @@ tags:
text: "Save and autofill passwords"
- evalScript: ${output.addLogins.counter++}

- scrollUntilVisible:
element:
text: "#"
- assertVisible:
text: "#"

- scrollUntilVisible:
element:
text: "a.example.com"
- assertVisible:
text: "a.example.com"

- assertNotVisible:
text: "https://a.example.com"

- scrollUntilVisible:
element:
text: "fill.dev"
- assertVisible:
text: "fill.dev"

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
appId: com.duckduckgo.mobile.android
name: "Autofill: Prompted to save and update credentials on web form"
tags:
- autofillNoAuthTests
- autofillNoAuthTestsModernWebView
---
# Pre-requisite: on an autofill-eligible device
# Pre-requisite: on an autofill-eligible device, including having a modern WebView

- launchApp:
clearState: true
Expand Down
21 changes: 15 additions & 6 deletions .maestro/autofill/steps/delete_logins.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,35 @@ name: "Autofill: Delete credentials"
---
# Pre-requisite: the user is viewing the password manager screen with some saved passwords added by a previous test step, on an autofill-eligible device

- scrollUntilVisible:
element:
text: "192.168.0.100"
- tapOn:
id: "item_container"
index: 1
text: "192.168.0.100"
- tapOn: "More options"
- tapOn: "Delete"
- tapOn: "Delete"

- scrollUntilVisible:
element:
text: "a.example.com"
- tapOn:
id: "item_container"
index: 1
text: "a.example.com"
- tapOn: "More options"
- tapOn: "Delete"
- tapOn: "Delete"

- scrollUntilVisible:
element:
text: "fill.dev"
- tapOn:
id: "item_container"
index: 1
text: "fill.dev"
- tapOn: "More options"
- tapOn: "Delete"
- tapOn: "Delete"

- scrollUntilVisible:
element:
text: "No passwords saved yet"
- assertVisible:
text: "No passwords saved yet"
12 changes: 10 additions & 2 deletions .maestro/autofill/steps/manual_update.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,18 @@ name: "Autofill: Manually updating an existing credential"
---
# Pre-requisite: the user is viewing the password manager screen with some saved passwords added by a previous test step, on an autofill-eligible device

- scrollUntilVisible:
element:
text: "a.example.com"
- tapOn:
id: "item_container"
index: "1"
text: "a.example.com"

- tapOn: "More options"
- tapOn: "Edit"

- scrollUntilVisible:
element:
id: notesEditText
- tapOn:
id: notesEditText

Expand All @@ -21,5 +26,8 @@ name: "Autofill: Manually updating an existing credential"
id: view_menu_save
retryTapIfNoChange: false

- scrollUntilVisible:
element:
text: "new note"
- assertVisible: "new note"
- tapOn: "Navigate up"
6 changes: 6 additions & 0 deletions .maestro/autofill/steps/search_logins.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@ name: "Autofill: Search credentials"
---
# Pre-requisite: the user is viewing the password manager screen with some saved passwords added by a previous test step, on an autofill-eligible device

- runFlow:
when:
visible: "Sync & Back Up Your Passwords"
commands:
- tapOn: "No thanks"

- tapOn:
id: searchLogins

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import androidx.core.content.edit
import androidx.test.ext.junit.runners.AndroidJUnit4
import com.duckduckgo.adclick.impl.Exemption
import com.duckduckgo.app.statistics.pixels.Pixel
import com.duckduckgo.app.statistics.pixels.Pixel.PixelType.COUNT
import com.duckduckgo.app.statistics.pixels.Pixel.PixelType.Count
import com.duckduckgo.common.test.api.InMemorySharedPreferences
import java.time.Instant
import java.util.concurrent.TimeUnit
Expand Down Expand Up @@ -248,7 +248,7 @@ class RealAdClickPixelsTest {
pixel = eq(AdClickPixelName.AD_CLICK_PAGELOADS_WITH_AD_ATTRIBUTION),
parameters = any(),
encodedParameters = any(),
type = eq(COUNT),
type = eq(Count),
)
}

Expand All @@ -264,7 +264,7 @@ class RealAdClickPixelsTest {
pixel = eq(AdClickPixelName.AD_CLICK_PAGELOADS_WITH_AD_ATTRIBUTION),
parameters = eq(mapOf(AdClickPixelParameters.AD_CLICK_PAGELOADS_WITH_AD_ATTRIBUTION_COUNT to "1")),
encodedParameters = any(),
type = eq(COUNT),
type = eq(Count),
)
}

Expand All @@ -283,7 +283,7 @@ class RealAdClickPixelsTest {
pixel = eq(AdClickPixelName.AD_CLICK_PAGELOADS_WITH_AD_ATTRIBUTION),
parameters = any(),
encodedParameters = any(),
type = eq(COUNT),
type = eq(Count),
)
}

Expand All @@ -302,7 +302,7 @@ class RealAdClickPixelsTest {
pixel = eq(AdClickPixelName.AD_CLICK_PAGELOADS_WITH_AD_ATTRIBUTION),
parameters = eq(mapOf(AdClickPixelParameters.AD_CLICK_PAGELOADS_WITH_AD_ATTRIBUTION_COUNT to "1")),
encodedParameters = any(),
type = eq(COUNT),
type = eq(Count),
)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import com.duckduckgo.anrs.api.AnrRepository
import com.duckduckgo.app.statistics.api.OfflinePixel
import com.duckduckgo.app.statistics.api.PixelSender
import com.duckduckgo.app.statistics.pixels.Pixel
import com.duckduckgo.app.statistics.pixels.Pixel.PixelType.COUNT
import com.duckduckgo.app.statistics.pixels.Pixel.PixelType.Count
import com.duckduckgo.di.scopes.AppScope
import com.squareup.anvil.annotations.ContributesMultibinding
import io.reactivex.Completable
Expand All @@ -47,7 +47,7 @@ class AnrOfflinePixelSender @Inject constructor(
ANR_CUSTOM_TAB to it.customTab.toString(),
),
mapOf(),
COUNT,
Count,
).ignoreElement().doOnComplete {
anrRepository.removeMostRecentAnr()
}
Expand Down
Loading

0 comments on commit 43b85c9

Please sign in to comment.