Skip to content

Commit c5b77a4

Browse files
authored
Sync filter_forced_merge_pr with the newer weekly_force_merge_stats query (#4484)
This query is used by fetchHud to get the force merge status of the pull requests so that they can be highlighted on HUD. Specifically, force merges with failures are highlighted with a darker shade of orange while regular force merges due to impatience are marked with yellow. The logic needs to be in sync with the source of truth [weekly_force_merge_stats](https://github.com/pytorch/test-infra/blob/main/torchci/rockset/commons/__sql/weekly_force_merge_stats.sql) query and uses the recently added `ignore_current_checks` field for `merge -i` ### Testing I proof check all force merges on the first page of https://torchci-git-fork-huydhn-fix-hud-force-merge-76a8e4-fbopensource.vercel.app and compare them with https://hud.pytorch.org
1 parent 78fb6e1 commit c5b77a4

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

torchci/rockset/commons/__sql/filter_forced_merge_pr.sql

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
1+
-- This query is used by fetchHud to get the force merge status of the pull requests so that
2+
-- they can be highlighted on HUD. Specifically, force merges with failures are highlighted
3+
-- with a darker shade of orange while regular force merges due to impatience are marked with
4+
--- yellow. The logic needs to be in sync with weekly_force_merge_stats query.
15
WITH all_merges AS (
26
SELECT
37
skip_mandatory_checks,
48
LENGTH(failed_checks) AS failed_checks_count,
9+
LENGTH(ignore_current_checks) AS ignored_checks_count,
510
ignore_current,
611
is_failed,
712
pr_num,
@@ -23,11 +28,13 @@ force_merges_with_failed_checks AS (
2328
OR (
2429
ignore_current = true
2530
AND is_failed = false
26-
),
31+
AND ignored_checks_count > 0 -- if no checks were ignored, it's not a force merge
32+
),
2733
1,
2834
0
2935
) AS force_merge,
3036
failed_checks_count,
37+
ignored_checks_count,
3138
pr_num,
3239
merge_commit_sha,
3340
FROM
@@ -40,7 +47,10 @@ SELECT
4047
IF(
4148
(
4249
force_merge = 1
43-
AND failed_checks_count > 0
50+
AND (
51+
failed_checks_count > 0
52+
OR ignored_checks_count > 0
53+
)
4454
),
4555
1,
4656
0

torchci/rockset/prodVersions.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"commit_jobs_query": "cc524c5036e78794",
66
"disabled_non_flaky_tests": "f909abf9eec15b56",
77
"commit_failed_jobs": "45095418d71a3778",
8-
"filter_forced_merge_pr": "98786319ff984d95",
8+
"filter_forced_merge_pr": "00d662e98c8bdbdc",
99
"flaky_tests": "9f7a1abcebb7f027",
1010
"flaky_tests_across_jobs": "474e5454bda0c5bb",
1111
"get_relevant_alerts": "727014a49bef2c20",

0 commit comments

Comments
 (0)