Bug 1876041 - add android-l10n tasks. r=ahal,releng-reviewers,taskgraph-reviewers

Differential Revision: https://phabricator.services.mozilla.com/D201480
This commit is contained in:
Geoff Brown 2023-11-27 20:20:14 -07:00
parent 283157a0f9
commit b4cff2028e
6 changed files with 122 additions and 0 deletions

View file

@ -399,3 +399,11 @@ jobs:
- mozilla-central
- oak
when: [] # hook only
- name: android-l10n-import
job:
type: decision-task
treeherder-symbol: android-l10n-import
target-tasks-method: android-l10n-import
run-on-projects: [oak]
when: [] # hook only

View file

@ -0,0 +1,55 @@
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
---
loader: gecko_taskgraph.loader.transform:loader
transforms:
- gecko_taskgraph.transforms.task:transforms
job-defaults:
run-on-projects: []
treeherder:
kind: build
platform: fenix-android-all/opt
tier: 1
worker-type: tree
worker:
implementation: treescript
tags: []
bump: false
dontbuild: false
ignore-closed-tree: true
push: true
jobs:
import:
name: android_l10n_import
description: Import strings from android-l10n repo
treeherder:
symbol: android-l10n(I)
worker:
source-repo: https://hg.mozilla.org/projects/oak
android-l10n-import-info:
from-repo-url: https://github.com/mozilla-l10n/android-l10n
toml-info:
- toml-path: mozilla-mobile/fenix/l10n.toml
dest-path: mobile/android/fenix
- toml-path: mozilla-mobile/focus-android/l10n.toml
dest-path: mobile/android/focus-android
- toml-path: mozilla-mobile/android-components/l10n.toml
dest-path: mobile/android/android-components
sync:
name: android_l10n_sync
description: Sync android-l10n strings from central to beta
treeherder:
symbol: android-l10n(S)
worker:
source-repo: https://hg.mozilla.org/releases/mozilla-beta
android-l10n-sync-info:
from-repo-url: https://hg.mozilla.org/mozilla-central
toml-info:
- toml-path: mobile/android/fenix/l10n.toml
- toml-path: mobile/android/focus-android/l10n.toml
- toml-path: mobile/android/android-components/l10n.toml

View file

@ -242,6 +242,7 @@ treeherder:
'wc': 'webcompat'
'Boot': 'Bootstrap'
'Attr-L10n': 'Build Attribution'
'android-l10n': 'Import strings from android-l10n repo'
# The below symbols are from firefox-android (fenix/focus/android-components)
'buildconfig': 'Make sure the content of .buildconfig.yml matches what gradle knows about its projects'

View file

@ -883,3 +883,7 @@ Push Focus and Fenix AABs to Google Play.
push-bundle
-----------
Push Focus and Fenix AABs to Google Play.
android-l10n
------------
Update android string resources from android-l10n repo.

View file

@ -1660,3 +1660,8 @@ def target_tasks_nightly_android(full_task_graph, parameters, graph_config):
return []
return [l for l, t in full_task_graph.tasks.items() if filter(t, parameters)]
@_target_task("android-l10n-import")
def target_tasks_android_l10n_import(full_task_graph, parameters, graph_config):
return [l for l, t in full_task_graph.tasks.items() if l == "android-l10n-import"]

View file

@ -1350,6 +1350,23 @@ def build_push_addons_payload(config, task, task_def):
],
},
Optional("merge-info"): object,
Optional("android-l10n-import-info"): {
Required("from-repo-url"): str,
Required("toml-info"): [
{
Required("toml-path"): str,
Required("dest-path"): str,
}
],
},
Optional("android-l10n-sync-info"): {
Required("from-repo-url"): str,
Required("toml-info"): [
{
Required("toml-path"): str,
}
],
},
},
)
def build_treescript_payload(config, task, task_def):
@ -1413,6 +1430,38 @@ def build_treescript_payload(config, task, task_def):
task_def["payload"]["merge_info"] = merge_info
actions.append("merge_day")
if worker.get("android-l10n-import-info"):
android_l10n_import_info = {}
for k, v in worker["android-l10n-import-info"].items():
android_l10n_import_info[k.replace("-", "_")] = worker[
"android-l10n-import-info"
][k]
android_l10n_import_info["toml_info"] = [
{
param_name.replace("-", "_"): param_value
for param_name, param_value in entry.items()
}
for entry in worker["android-l10n-import-info"]["toml-info"]
]
task_def["payload"]["android_l10n_import_info"] = android_l10n_import_info
actions.append("android_l10n_import")
if worker.get("android-l10n-sync-info"):
android_l10n_sync_info = {}
for k, v in worker["android-l10n-sync-info"].items():
android_l10n_sync_info[k.replace("-", "_")] = worker[
"android-l10n-sync-info"
][k]
android_l10n_sync_info["toml_info"] = [
{
param_name.replace("-", "_"): param_value
for param_name, param_value in entry.items()
}
for entry in worker["android-l10n-sync-info"]["toml-info"]
]
task_def["payload"]["android_l10n_sync_info"] = android_l10n_sync_info
actions.append("android_l10n_sync")
if worker["push"]:
actions.append("push")