Skip to content

Conversation

@ZnPR0N00BnZ
Copy link

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:

python3 review_patch.py --series <series-id>

To generate an AI code review for all patches in that series.

Note that this only works in our new ai-runner EC2 instance.

Zinc Lim added 4 commits October 28, 2025 11:49
-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
Copy link
Contributor

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")),
Copy link
Contributor

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()
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants