MCPcopy
hub / github.com/commaai/openpilot / comment_on_pr

Method comment_on_pr

tools/lib/github_utils.py:87–99  ·  view source on GitHub ↗
(self, comment, pr_branch, commenter="", overwrite=False)

Source from the content-addressed store, hash-verified

85 return f'https://raw.githubusercontent.com/{self.OWNER}/{self.DATA_REPO}/refs/heads/{bucket}'
86
87 def comment_on_pr(self, comment, pr_branch, commenter="", overwrite=False):
88 pr_number = self.get_pr_number(pr_branch)
89 data = f'{{"body": "{comment}"}}'
90 github_path = f'issues/{pr_number}/comments'
91 if overwrite:
92 r = self.api_call(github_path)
93 comments = [x['id'] for x in r.json() if x['user']['login'] == commenter]
94 if comments:
95 github_path = f'issues/comments/{comments[0]}'
96 self.api_call(github_path, data=data, method=HTTPMethod.PATCH)
97 return
98
99 self.api_call(github_path, data=data, method=HTTPMethod.POST)
100
101 # upload files to github and comment them on the pr
102 def comment_images_on_pr(self, title, commenter, pr_branch, bucket, images):

Callers 2

comment_images_on_prMethod · 0.95
comment_replay_reportFunction · 0.80

Calls 2

get_pr_numberMethod · 0.95
api_callMethod · 0.95

Tested by

no test coverage detected