Bug 1964784 - Output treeherder link with lando commit ID during push to try. r=ahal

This patch adds an output of a treeherder link during the standard push to try, and during the mach try perf push to try.

Differential Revision: https://phabricator.services.mozilla.com/D249772
This commit is contained in:
Greg Mierzwinski
2025-05-21 18:45:04 +00:00
committed by gmierz2@outlook.com
parent d7e2278b6c
commit 0ea2a845a0
3 changed files with 25 additions and 7 deletions

View File

@@ -49,6 +49,10 @@ MAX_HISTORY = 10
MACH_TRY_PUSH_TO_VCS = os.getenv("MACH_TRY_PUSH_TO_VCS") == "1"
TREEHERDER_LANDO_TRY_RUN_URL = (
"https://treeherder.mozilla.org/jobs?repo=try&landoCommitID={job_id}"
)
here = os.path.abspath(os.path.dirname(__file__))
build = MozbuildObject.from_environment(cwd=here)
vcs = get_repository_object(build.topsrcdir)
@@ -259,7 +263,13 @@ def push_to_try(
allow_log_capture=allow_log_capture,
)
else:
return push_to_lando_try(vcs, commit_message, changed_files)
job_id = push_to_lando_try(vcs, commit_message, changed_files)
print(
f"Follow the progress of your build on Treeherder: "
f"{TREEHERDER_LANDO_TRY_RUN_URL.format(job_id=job_id)}"
)
return job_id
except MissingVCSExtension as e:
if e.ext == "push-to-try":
print(HG_PUSH_TO_TRY_NOT_FOUND)

View File

@@ -53,6 +53,9 @@ PERFCOMPARE_BASE_URL_LANDO = (
"baseLando=%s&newLando=%s&baseRepo=try&newRepo=try&framework=%s"
)
TREEHERDER_TRY_BASE_URL = "https://treeherder.mozilla.org/jobs?repo=try&revision=%s"
TREEHERDER_TRY_LANDO_BASE_URL = (
"https://treeherder.mozilla.org/jobs?repo=try&landoCommitID=%s"
)
TREEHERDER_ALERT_TASKS_URL = (
"https://treeherder.mozilla.org/api/performance/alertsummary-tasks/?id=%s"
)
@@ -1666,15 +1669,20 @@ def run(**kwargs):
print("* 2 commits/try-runs were created... *")
print("*******************************************************")
if kwargs.get("push_to_vcs"):
original_try_url = TREEHERDER_TRY_BASE_URL % PerfParser.push_info.base_revision
local_change_try_url = (
TREEHERDER_TRY_BASE_URL % PerfParser.push_info.new_revision
)
if not kwargs.get("push_to_vcs"):
original_try_url = (
TREEHERDER_TRY_BASE_URL % PerfParser.push_info.base_revision
TREEHERDER_TRY_LANDO_BASE_URL
% PerfParser.push_info.base_lando_commit_id
)
local_change_try_url = (
TREEHERDER_TRY_BASE_URL % PerfParser.push_info.new_revision
TREEHERDER_TRY_LANDO_BASE_URL % PerfParser.push_info.new_lando_commit_id
)
print(f"Base revision's try run: {original_try_url}")
print(f"Local revision's try run: {local_change_try_url}\n")
print(f"Base revision's try run: {original_try_url}")
print(f"Local revision's try run: {local_change_try_url}\n")
print(
"If you need any help, you can find us in the #perf-help Matrix channel:\n"

View File

@@ -1155,7 +1155,7 @@ def test_full_run(options, call_counts, log_ind, expected_log_message):
[
(
{"tests": ["amazon"], "show_all": True},
[1, 2, 0, 6, 2, 1],
[1, 2, 0, 8, 2, 1],
0,
(
"\n!!!NOTE!!!\n You'll be able to find a performance comparison "