-
Notifications
You must be signed in to change notification settings - Fork 12
review_patch: CLI command for AI code review #62
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
-This is currently ran on CLI but in future, the entry point might be slightly modified to fit into the linux CI system -The end goal of this project is to integrate an AI code reviewer into our CI process Signed-off-by: Zinc Lim <zinclim@meta.com>
Getting each commit title, message and diff should be sufficient for our ai to do an automated review Signed-off-by: Zinc Lim <zinclim@meta.com>
Signed-off-by: Zinc Lim <zinclim@meta.com>
- Note that it only works in the EC2 instance. Run python3 "review_patch.py --series <series id>" - In future, we will refine the AI by using MCP and codebase indexing in https://github.com/facebookexperimental/semcode.git Subject Signed-off-by: Zinc Lim <zinclim@meta.com>
| 2. Linux kernel coding style | ||
| 3. Memory safety | ||
| 4. Security concerns | ||
| 5. Performance implications |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The prompt should be loaded from Chris's repo (expect a path to it via config), I'm surprised to see this here..
|
|
||
| body_dict = { | ||
| "anthropic_version": os.environ.get("BEDROCK_ANTHROPIC_VERSION"), | ||
| "max_tokens": int(os.environ.get("BEDROCK_MAX_TOKENS")), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should consistently use config rather than env?
| for patch in series["patches"]: | ||
| log_open_sec(f'Processing patch id {patch["id"]}') | ||
|
|
||
| page = requests.get(patch["url"]).json() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought pw has a method for getting the patch, doesn't it? Better to stick to using pw 'cause it does all the retry and user agent config that we need.
The end goal is to integrate automated code review with Claude into our CI workflow. As a first step, I've implemented the following CLI command:
To generate an AI code review for all patches in that series.
Note that this only works in our new ai-runner EC2 instance.