mirror of
https://github.com/fork-maintainers/iceraven-browser
synced 2024-11-17 15:26:23 +00:00
[fenix] stop triggering multiple nightlies off the same revision
This commit is contained in:
parent
dded33a1fb
commit
f86af3af82
@ -185,6 +185,7 @@ tasks:
|
|||||||
MOBILE_HEAD_REV: '${head_sha}'
|
MOBILE_HEAD_REV: '${head_sha}'
|
||||||
MOBILE_REPOSITORY_TYPE: git
|
MOBILE_REPOSITORY_TYPE: git
|
||||||
MOBILE_PIP_REQUIREMENTS: taskcluster/requirements.txt
|
MOBILE_PIP_REQUIREMENTS: taskcluster/requirements.txt
|
||||||
|
MOZ_AUTOMATION: "1"
|
||||||
REPOSITORIES: {$json: {mobile: "Fenix"}}
|
REPOSITORIES: {$json: {mobile: "Fenix"}}
|
||||||
HG_STORE_PATH: /builds/worker/checkouts/hg-store
|
HG_STORE_PATH: /builds/worker/checkouts/hg-store
|
||||||
ANDROID_SDK_ROOT: /builds/worker/android-sdk
|
ANDROID_SDK_ROOT: /builds/worker/android-sdk
|
||||||
|
@ -2,7 +2,22 @@
|
|||||||
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
# 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/.
|
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||||
|
|
||||||
|
import os
|
||||||
|
from redo import retry
|
||||||
|
|
||||||
from taskgraph.target_tasks import _target_task
|
from taskgraph.target_tasks import _target_task
|
||||||
|
from taskgraph.util.taskcluster import find_task_id
|
||||||
|
|
||||||
|
|
||||||
|
def index_exists(index_path, reason=""):
|
||||||
|
print(f"Looking for existing index {index_path} {reason}...")
|
||||||
|
try:
|
||||||
|
task_id = find_task_id(index_path)
|
||||||
|
print(f"Index {index_path} exists: taskId {task_id}")
|
||||||
|
return True
|
||||||
|
except KeyError:
|
||||||
|
print(f"Index {index_path} doesn't exist.")
|
||||||
|
return False
|
||||||
|
|
||||||
|
|
||||||
@_target_task("release")
|
@_target_task("release")
|
||||||
@ -22,6 +37,19 @@ def target_tasks_nightly(full_task_graph, parameters, graph_config):
|
|||||||
def filter(task, parameters):
|
def filter(task, parameters):
|
||||||
return task.attributes.get("nightly", False)
|
return task.attributes.get("nightly", False)
|
||||||
|
|
||||||
|
index_path = (
|
||||||
|
f"{graph_config['trust-domain']}.v2.{parameters['project']}.branch."
|
||||||
|
f"{parameters['head_ref']}.revision.{parameters['head_rev']}.taskgraph.decision-nightly"
|
||||||
|
)
|
||||||
|
if os.environ.get("MOZ_AUTOMATION") and retry(
|
||||||
|
index_exists,
|
||||||
|
args=(index_path,),
|
||||||
|
kwargs={
|
||||||
|
"reason": "to avoid triggering multiple nightlies off the same revision",
|
||||||
|
},
|
||||||
|
):
|
||||||
|
return []
|
||||||
|
|
||||||
return [l for l, t in full_task_graph.tasks.items() if filter(t, parameters)]
|
return [l for l, t in full_task_graph.tasks.items() if filter(t, parameters)]
|
||||||
|
|
||||||
|
|
||||||
|
@ -3,3 +3,4 @@
|
|||||||
|
|
||||||
taskcluster-taskgraph>=1.3.1
|
taskcluster-taskgraph>=1.3.1
|
||||||
mozilla-version
|
mozilla-version
|
||||||
|
redo
|
||||||
|
Loading…
Reference in New Issue
Block a user