Skip to content

Commit 857ed57

Browse files
author
Zinc Lim
committed
review_patch: Parsing necessary fields for ai to review
Getting each commit title, message and diff should be sufficient for our ai to do an automated review Signed-off-by: Zinc Lim <[email protected]>
1 parent 03755a9 commit 857ed57

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

review_patch.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,29 @@ def main():
4141
log("Series information", series)
4242
log_end_sec()
4343

44+
for patch in series["patches"]:
45+
log_open_sec(f"Processing patch id {patch["id"]}")
46+
47+
page = requests.get(patch["url"]).json()
48+
49+
title = page["name"]
50+
commit_msg = page["content"]
51+
diff = page["diff"]
52+
53+
log_open_sec(f"Title")
54+
log(title)
55+
log_end_sec()
56+
57+
log_open_sec(f"Content")
58+
log(commit_msg)
59+
log_end_sec()
60+
61+
log_open_sec(f"Diff")
62+
log(diff)
63+
log_end_sec()
64+
65+
log_end_sec()
66+
4467

4568
if __name__ == "__main__":
4669
main()

0 commit comments

Comments
 (0)