Skip to content

Commit 401d216

Browse files
authored
[TD] Script to determine which reverts are caused by bad TD (#6911)
Honestly a pretty messy script Determines a commit was caused by bad TD, basically: 1. find revert 2. find originally merged commit 3. find last commit on the PR before the merge 4. check merged commit for failures 5. check if failure was excluded by TD on the last commit on the PR Obviously not perfect, but spot checking it does seem to be ok Counts are pretty volatile if granularity is too small (week granularity is very volatile), so I'm not sure if this can really be displayed. Maybe should make this periodic and still upload to clickhouse? idk End of the output looks like this but theres a lot of extra output before it to help debug ``` CAUSED BY BAD TD: 27 / 184 = 14.67% Unable to check (lack run id) on PR: 1 / 184 = 0.54% Total caused by bad TD: 27 / 184 = 14.67% Month 674: 13 bad TD / 77 total = 16.88% Month 675: 14 bad TD / 107 total = 13.08% ``` Also make clickhouse.py client able to be used in thread pool executor (http client didn't like having 1 http client for multiple threads i think)
1 parent 2557c93 commit 401d216

File tree

2 files changed

+555
-2
lines changed

2 files changed

+555
-2
lines changed

tools/torchci/clickhouse.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
11
import json
22
import os
3-
from functools import lru_cache
43
from typing import Any, Dict, List, Optional
54

65
import clickhouse_connect
76
from clickhouse_connect.driver import Client
87
from torchci.utils import cache_json, REPO_ROOT
98

109

11-
@lru_cache(maxsize=1)
1210
def get_clickhouse_client() -> Client:
1311
endpoint = os.environ["CLICKHOUSE_ENDPOINT"]
1412
# I cannot figure out why these values aren't being handled automatically

0 commit comments

Comments
 (0)