tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

googleplay.py (1387B)


      1 # This Source Code Form is subject to the terms of the Mozilla Public
      2 # License, v. 2.0. If a copy of the MPL was not distributed with this
      3 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
      4 
      5 
      6 import logging
      7 
      8 from .registry import register_callback_action
      9 from .util import create_tasks, fetch_graph_and_labels
     10 
     11 logger = logging.getLogger(__name__)
     12 
     13 
     14 @register_callback_action(
     15    name="googleplay",
     16    title="Submit android apps to google play",
     17    symbol="gp",
     18    description="Submit android apps to google play",
     19    order=150,
     20    context=[],
     21    available=lambda params: params["project"] == "mozilla-central",
     22    schema={"type": "object", "properties": {}},
     23    permission="googleplay",
     24 )
     25 def add_push_bundle(parameters, graph_config, input, task_group_id, task_id):
     26    decision_task_id, full_task_graph, label_to_taskid, _ = fetch_graph_and_labels(
     27        parameters, graph_config
     28    )
     29 
     30    def filter(task):
     31        if task.kind != "push-bundle":
     32            return False
     33        return task.attributes["build-type"] in ("fenix-nightly", "focus-nightly")
     34 
     35    to_run = [label for label, task in full_task_graph.tasks.items() if filter(task)]
     36 
     37    create_tasks(
     38        graph_config,
     39        to_run,
     40        full_task_graph,
     41        label_to_taskid,
     42        parameters,
     43        decision_task_id,
     44    )
     45    logger.info(f"Scheduled {len(to_run)} push-bundle tasks")