commit 9f649eb526cc472e18bacc1f241ae6c1e5f1b191
parent abd1d924f4a5886ce21b878a5e481d99c78ea705
Author: Marco Castelluccio <mcastelluccio@mozilla.com>
Date: Thu, 30 Oct 2025 11:26:09 +0000
Bug 1996997 - Use new bugbug deployment. r=taskgraph-reviewers,bhearsum
Differential Revision: https://phabricator.services.mozilla.com/D270425
Diffstat:
2 files changed, 28 insertions(+), 1 deletion(-)
diff --git a/taskcluster/gecko_taskgraph/test/test_optimize_strategies.py b/taskcluster/gecko_taskgraph/test/test_optimize_strategies.py
@@ -24,6 +24,7 @@ from gecko_taskgraph.optimize.mozlint import SkipUnlessMozlint
from gecko_taskgraph.optimize.strategies import SkipUnlessMissing, SkipUnlessSchedules
from gecko_taskgraph.util.backstop import BACKSTOP_PUSH_INTERVAL
from gecko_taskgraph.util.bugbug import (
+ BUGBUG_BASE_FALLBACK_URL,
BUGBUG_BASE_URL,
BugbugTimeoutException,
push_schedules,
@@ -372,6 +373,13 @@ def test_bugbug_timeout(monkeypatch, responses, params):
json={"ready": False},
status=202,
)
+ fallback_url = BUGBUG_BASE_FALLBACK_URL + query
+ responses.add(
+ responses.GET,
+ fallback_url,
+ json={"ready": False},
+ status=202,
+ )
# Make sure the test runs fast.
monkeypatch.setattr(time, "sleep", lambda i: None)
@@ -390,6 +398,13 @@ def test_bugbug_fallback(monkeypatch, responses, params):
json={"ready": False},
status=202,
)
+ fallback_url = BUGBUG_BASE_FALLBACK_URL + query
+ responses.add(
+ responses.GET,
+ fallback_url,
+ json={"ready": False},
+ status=202,
+ )
opt = BugBugPushSchedules(0.5, fallback=FALLBACK)
diff --git a/taskcluster/gecko_taskgraph/util/bugbug.py b/taskcluster/gecko_taskgraph/util/bugbug.py
@@ -20,7 +20,8 @@ try:
except ImportError:
from time import time as monotonic
-BUGBUG_BASE_URL = "https://bugbug.herokuapp.com"
+BUGBUG_BASE_URL = "https://bugbug.moz.tools"
+BUGBUG_BASE_FALLBACK_URL = "https://bugbug.herokuapp.com"
RETRY_TIMEOUT = 9 * 60 # seconds
RETRY_INTERVAL = 10 # seconds
@@ -108,6 +109,7 @@ def push_schedules(branch, rev):
return
url = BUGBUG_BASE_URL + f"/push/{branch}/{rev}/schedules"
+ fallback_url = url.replace(BUGBUG_BASE_URL, BUGBUG_BASE_FALLBACK_URL)
start = monotonic()
session = get_session()
@@ -120,6 +122,7 @@ def push_schedules(branch, rev):
attempts = timeout / RETRY_INTERVAL
i = 0
+ did_fallback = 0
while i < attempts:
r = session.get(url)
r.raise_for_status()
@@ -127,6 +130,14 @@ def push_schedules(branch, rev):
if r.status_code != 202:
break
+ r = session.get(fallback_url)
+ r.raise_for_status()
+
+ if r.status_code != 202:
+ did_fallback = 1
+ print("bugbug fallback answered quicker")
+ break
+
time.sleep(RETRY_INTERVAL)
i += 1
end = monotonic()
@@ -135,6 +146,7 @@ def push_schedules(branch, rev):
lower_is_better={
"bugbug_push_schedules_time": end - start,
"bugbug_push_schedules_retries": i,
+ "bugbug_push_schedules_fallback": did_fallback,
}
)