mirror of
https://github.com/sunnypilot/sunnypilot.git
synced 2026-02-18 14:13:53 +08:00
ci: overwrite previous comment for model_replay (#35209)
* less * test * fix * cleanup
This commit is contained in:
@@ -123,7 +123,7 @@ def comment_replay_report(proposed, master, full_logs):
|
|||||||
diff_plots = create_table("Model Replay Differences", diff_files, link, open_table=True)
|
diff_plots = create_table("Model Replay Differences", diff_files, link, open_table=True)
|
||||||
all_plots = create_table("All Model Replay Plots", files, link)
|
all_plots = create_table("All Model Replay Plots", files, link)
|
||||||
comment = f"ref for commit {commit}: {link}/{log_name}" + diff_plots + all_plots
|
comment = f"ref for commit {commit}: {link}/{log_name}" + diff_plots + all_plots
|
||||||
GITHUB.comment_on_pr(comment, PR_BRANCH)
|
GITHUB.comment_on_pr(comment, PR_BRANCH, "commaci-public", True)
|
||||||
|
|
||||||
def trim_logs_to_max_frames(logs, max_frames, frs_types, include_all_types):
|
def trim_logs_to_max_frames(logs, max_frames, frs_types, include_all_types):
|
||||||
all_msgs = []
|
all_msgs = []
|
||||||
|
|||||||
@@ -87,8 +87,8 @@ class GithubUtils:
|
|||||||
def comment_on_pr(self, comment, pr_branch, commenter="", overwrite=False):
|
def comment_on_pr(self, comment, pr_branch, commenter="", overwrite=False):
|
||||||
pr_number = self.get_pr_number(pr_branch)
|
pr_number = self.get_pr_number(pr_branch)
|
||||||
data = f'{{"body": "{comment}"}}'
|
data = f'{{"body": "{comment}"}}'
|
||||||
|
github_path = f'issues/{pr_number}/comments'
|
||||||
if overwrite:
|
if overwrite:
|
||||||
github_path = f'issues/{pr_number}/comments'
|
|
||||||
r = self.api_call(github_path)
|
r = self.api_call(github_path)
|
||||||
comments = [x['id'] for x in r.json() if x['user']['login'] == commenter]
|
comments = [x['id'] for x in r.json() if x['user']['login'] == commenter]
|
||||||
if comments:
|
if comments:
|
||||||
@@ -96,7 +96,6 @@ class GithubUtils:
|
|||||||
self.api_call(github_path, data=data, method=HTTPMethod.PATCH)
|
self.api_call(github_path, data=data, method=HTTPMethod.PATCH)
|
||||||
return
|
return
|
||||||
|
|
||||||
github_path=f'issues/{pr_number}/comments'
|
|
||||||
self.api_call(github_path, data=data, method=HTTPMethod.POST)
|
self.api_call(github_path, data=data, method=HTTPMethod.POST)
|
||||||
|
|
||||||
# upload files to github and comment them on the pr
|
# upload files to github and comment them on the pr
|
||||||
|
|||||||
Reference in New Issue
Block a user