summaryrefslogtreecommitdiffstats
path: root/taskcluster/gecko_taskgraph/util/backstop.py
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-15 03:35:49 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-15 03:35:49 +0000
commitd8bbc7858622b6d9c278469aab701ca0b609cddf (patch)
treeeff41dc61d9f714852212739e6b3738b82a2af87 /taskcluster/gecko_taskgraph/util/backstop.py
parentReleasing progress-linux version 125.0.3-1~progress7.99u1. (diff)
downloadfirefox-d8bbc7858622b6d9c278469aab701ca0b609cddf.tar.xz
firefox-d8bbc7858622b6d9c278469aab701ca0b609cddf.zip
Merging upstream version 126.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'taskcluster/gecko_taskgraph/util/backstop.py')
-rw-r--r--taskcluster/gecko_taskgraph/util/backstop.py28
1 files changed, 15 insertions, 13 deletions
diff --git a/taskcluster/gecko_taskgraph/util/backstop.py b/taskcluster/gecko_taskgraph/util/backstop.py
index 26c9a4fb91..18c9166083 100644
--- a/taskcluster/gecko_taskgraph/util/backstop.py
+++ b/taskcluster/gecko_taskgraph/util/backstop.py
@@ -37,22 +37,17 @@ def is_backstop(
return True
project = params["project"]
- pushid = int(params["pushlog_id"])
- pushdate = int(params["pushdate"])
-
if project in TRY_PROJECTS:
return False
if project not in integration_projects:
return True
- # On every Nth push, want to run all tasks.
- if pushid % push_interval == 0:
- return True
-
- if time_interval <= 0:
+ # This push was explicitly set to run nothing (e.g via DONTBUILD), so
+ # shouldn't be a backstop candidate.
+ if params["target_tasks_method"] == "nothing":
return False
- # We also want to ensure we run all tasks at least once per N minutes.
+ # Find the last backstop to compute push and time intervals.
subs = {"trust-domain": trust_domain, "project": project}
index = BACKSTOP_INDEX.format(**subs)
@@ -67,9 +62,7 @@ def is_backstop(
return True
try:
- last_pushdate = get_artifact(last_backstop_id, "public/parameters.yml")[
- "pushdate"
- ]
+ last_params = get_artifact(last_backstop_id, "public/parameters.yml")
except HTTPError as e:
# If the last backstop decision task exists in the index, but
# parameters.yml isn't available yet, it means the decision task is
@@ -79,6 +72,15 @@ def is_backstop(
return False
raise
- if (pushdate - last_pushdate) / 60 >= time_interval:
+ # On every Nth push, want to run all tasks.
+ if int(params["pushlog_id"]) - int(last_params["pushlog_id"]) >= push_interval:
+ return True
+
+ if time_interval <= 0:
+ return False
+
+ # We also want to ensure we run all tasks at least once per N minutes.
+ if (params["pushdate"] - last_params["pushdate"]) / 60 >= time_interval:
return True
+
return False