diff --git a/taskcluster/gecko_taskgraph/transforms/task.py b/taskcluster/gecko_taskgraph/transforms/task.py index 3822383dea2e5..a0de71d46bec9 100644 --- a/taskcluster/gecko_taskgraph/transforms/task.py +++ b/taskcluster/gecko_taskgraph/transforms/task.py @@ -1335,21 +1335,23 @@ def build_push_addons_payload(config, task, task_def): Optional("push"): bool, Optional("source-repo"): str, Optional("ssh-user"): str, - Optional("l10n-bump-info"): { - Required("name"): str, - Required("path"): str, - Required("version-path"): str, - Optional("l10n-repo-url"): str, - Optional("l10n-repo-target-branch"): str, - Optional("ignore-config"): object, - Required("platform-configs"): [ - { - Required("platforms"): [str], - Required("path"): str, - Optional("format"): str, - } - ], - }, + Optional("l10n-bump-info"): [ + { + Required("name"): str, + Required("path"): str, + Required("version-path"): str, + Optional("l10n-repo-url"): str, + Optional("l10n-repo-target-branch"): str, + Optional("ignore-config"): object, + Required("platform-configs"): [ + { + Required("platforms"): [str], + Required("path"): str, + Optional("format"): str, + } + ], + } + ], Optional("merge-info"): object, Optional("android-l10n-import-info"): { Required("from-repo-url"): str, @@ -1409,17 +1411,26 @@ def build_treescript_payload(config, task, task_def): actions.append("version_bump") if worker.get("l10n-bump-info"): - l10n_bump_info = {} - for k, v in worker["l10n-bump-info"].items(): - l10n_bump_info[k.replace("-", "_")] = worker["l10n-bump-info"][k] - task_def["payload"]["l10n_bump_info"] = [l10n_bump_info] - if ( - "l10n_repo_url" in l10n_bump_info - and "github.com" in l10n_bump_info["l10n_repo_url"] - ): - actions.append("l10n_bump_github") - else: - actions.append("l10n_bump") + l10n_bump_info = [] + l10n_repo_urls = set() + for lbi in worker["l10n-bump-info"]: + new_lbi = {} + if "l10n-repo-url" in lbi: + l10n_repo_urls.add(lbi["l10n-repo-url"]) + for k, v in lbi.items(): + new_lbi[k.replace("-", "_")] = lbi[k] + l10n_bump_info.append(new_lbi) + + task_def["payload"]["l10n_bump_info"] = l10n_bump_info + if len(l10n_repo_urls) > 1: + raise Exception( + "Must use the same l10n-repo-url for all files in the same task!" + ) + elif len(l10n_repo_urls) == 1: + if "github.com" in l10n_repo_urls.pop(): + actions.append("l10n_bump_github") + else: + actions.append("l10n_bump") if worker.get("merge-info"): merge_info = { diff --git a/taskcluster/kinds/l10n-bump/kind.yml b/taskcluster/kinds/l10n-bump/kind.yml index d40f9c48e95dd..fd6d9b4bf9ac8 100644 --- a/taskcluster/kinds/l10n-bump/kind.yml +++ b/taskcluster/kinds/l10n-bump/kind.yml @@ -37,91 +37,91 @@ job-defaults: # XXX whenever the `beta` config changes, make sure to make # the corresponding change in merge-automation/kind.yml beta: - name: Firefox l10n changesets - path: browser/locales/l10n-changesets.json - version-path: browser/config/version.txt - l10n-repo-url: "https://hg.mozilla.org/l10n-central/%(locale)s/json-pushes?version=2&tipsonly=1" - ignore-config: - ja: - - macosx64 - - macosx64-devedition - ja-JP-mac: - - linux - - linux-devedition - - linux64 - - linux64-devedition - - linux64-aarch64 - - win32 - - win32-devedition - - win64 - - win64-devedition - - win64-aarch64 - - win64-aarch64-devedition - platform-configs: - [ - { - "platforms": - [ - "linux", - "linux-devedition", - "linux64", - "linux64-aarch64", - "linux64-devedition", - "macosx64", - "macosx64-devedition", - "win32", - "win32-devedition", - "win64", - "win64-devedition", - "win64-aarch64", - "win64-aarch64-devedition", - ], - "path": "browser/locales/shipped-locales", - }, - ] + - name: Firefox l10n changesets + path: browser/locales/l10n-changesets.json + version-path: browser/config/version.txt + l10n-repo-url: "https://hg.mozilla.org/l10n-central/%(locale)s/json-pushes?version=2&tipsonly=1" + ignore-config: + ja: + - macosx64 + - macosx64-devedition + ja-JP-mac: + - linux + - linux-devedition + - linux64 + - linux64-devedition + - linux64-aarch64 + - win32 + - win32-devedition + - win64 + - win64-devedition + - win64-aarch64 + - win64-aarch64-devedition + platform-configs: + [ + { + "platforms": + [ + "linux", + "linux-devedition", + "linux64", + "linux64-aarch64", + "linux64-devedition", + "macosx64", + "macosx64-devedition", + "win32", + "win32-devedition", + "win64", + "win64-devedition", + "win64-aarch64", + "win64-aarch64-devedition", + ], + "path": "browser/locales/shipped-locales", + }, + ] default: - name: Firefox l10n changesets - path: browser/locales/l10n-changesets.json - l10n-repo-url: "https://hg.mozilla.org/l10n-central/%(locale)s/json-pushes?version=2&tipsonly=1" - version-path: browser/config/version.txt - ignore-config: - ja: - - macosx64 - - macosx64-devedition - ja-JP-mac: - - linux - - linux-devedition - - linux64 - - linux64-aarch64 - - linux64-devedition - - win32 - - win32-devedition - - win64 - - win64-devedition - - win64-aarch64 - - win64-aarch64-devedition - platform-configs: - [ - { - "platforms": - [ - "linux", - "linux-devedition", - "linux64", - "linux64-aarch64", - "linux64-devedition", - "macosx64", - "macosx64-devedition", - "win32", - "win32-devedition", - "win64", - "win64-devedition", - "win64-aarch64", - "win64-aarch64-devedition", - ], - "path": "browser/locales/all-locales", - }, - ] + - name: Firefox l10n changesets + path: browser/locales/l10n-changesets.json + l10n-repo-url: "https://hg.mozilla.org/l10n-central/%(locale)s/json-pushes?version=2&tipsonly=1" + version-path: browser/config/version.txt + ignore-config: + ja: + - macosx64 + - macosx64-devedition + ja-JP-mac: + - linux + - linux-devedition + - linux64 + - linux64-aarch64 + - linux64-devedition + - win32 + - win32-devedition + - win64 + - win64-devedition + - win64-aarch64 + - win64-aarch64-devedition + platform-configs: + [ + { + "platforms": + [ + "linux", + "linux-devedition", + "linux64", + "linux64-aarch64", + "linux64-devedition", + "macosx64", + "macosx64-devedition", + "win32", + "win32-devedition", + "win64", + "win64-devedition", + "win64-aarch64", + "win64-aarch64-devedition", + ], + "path": "browser/locales/all-locales", + }, + ] jobs: l10n-bumper: diff --git a/taskcluster/kinds/merge-automation/kind.yml b/taskcluster/kinds/merge-automation/kind.yml index 8e2b34147e5c5..aeca31dadd16a 100644 --- a/taskcluster/kinds/merge-automation/kind.yml +++ b/taskcluster/kinds/merge-automation/kind.yml @@ -31,42 +31,42 @@ jobs: l10n-bump-info: by-behavior: central-to-beta: - name: Firefox l10n changesets - path: browser/locales/l10n-changesets.json - version-path: browser/config/version.txt - l10n-repo-url: "https://hg.mozilla.org/l10n-central/%(locale)s/json-pushes?version=2&tipsonly=1" - ignore-config: - ja: - - macosx64 - - macosx64-devedition - ja-JP-mac: - - linux - - linux-devedition - - linux64 - - linux64-devedition - - win32 - - win32-devedition - - win64 - - win64-devedition - - win64-aarch64 - - win64-aarch64-devedition - platform-configs: [{ - "platforms": [ - "linux", - "linux-devedition", - "linux64", - "linux64-devedition", - "macosx64", - "macosx64-devedition", - "win32", - "win32-devedition", - "win64", - "win64-devedition", - "win64-aarch64", - "win64-aarch64-devedition", - ], - "path": "browser/locales/shipped-locales", - }] + - name: Firefox l10n changesets + path: browser/locales/l10n-changesets.json + version-path: browser/config/version.txt + l10n-repo-url: "https://hg.mozilla.org/l10n-central/%(locale)s/json-pushes?version=2&tipsonly=1" + ignore-config: + ja: + - macosx64 + - macosx64-devedition + ja-JP-mac: + - linux + - linux-devedition + - linux64 + - linux64-devedition + - win32 + - win32-devedition + - win64 + - win64-devedition + - win64-aarch64 + - win64-aarch64-devedition + platform-configs: [{ + "platforms": [ + "linux", + "linux-devedition", + "linux64", + "linux64-devedition", + "macosx64", + "macosx64-devedition", + "win32", + "win32-devedition", + "win64", + "win64-devedition", + "win64-aarch64", + "win64-aarch64-devedition", + ], + "path": "browser/locales/shipped-locales", + }] default: null run-on-projects: [] expiration-policy: long