mingyen066 commented on code in PR #19168:
URL: https://github.com/apache/kafka/pull/19168#discussion_r1987798872
##########
committer-tools/reviewers.py:
##########
@@ -35,6 +37,30 @@ def prompt_for_user():
return clean_input
+def append_message_to_pr_body(pr_url, message):
+ try:
+ cmd_get_pr = ["gh", "pr", "view", pr_url, "--json", "title,body"]
+ result = subprocess.run(cmd_get_pr, capture_output=True, text=True,
check=True)
+ current_pr_body = json.loads(result.stdout).get("body", {})
+ pr_title = json.loads(result.stdout).get("title", {})
+ escaped_message = message.replace("<", "\\<").replace(">", "\\>")
Review Comment:
Thanks for great suggestions. Now the tool can replace existing "Reviewers:"
trailer via `git interpret-trailers`.
It's more robust since using the "Reviewers:" prefix can incorrectly replace
"Reviewers:" inside code blocks, whereas using git interpret-trailers avoids
this issue.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]