Skip to content
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

[feat] Add functionality for AI PR review #1647

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

rohitvinnakota-codecov
Copy link
Member

This PR adds functionality for 2 endpoints to review a PR using Vertex
AI. It leverages similar functionality as the unit test endpoint.

/codegen/pr-review kicks off a PR review
/codegen/pr-review/state fetches the stats of a given review

pr_review_step.py is responsible for fetching a list of json comments
for a given PR, and pr_review_publisher is responsible for posting
comments to that PR.

This PR adds functionality for 2 endpoints to review a PR using Vertex
AI. It leverages similar functionality as the unit test endpoint.

`/codegen/pr-review` kicks off a PR review 
`/codegen/pr-review/state` fetches the stats of a given review

`pr_review_step.py` is responsible for fetching a list of json comments
for a given PR, and `pr_review_publisher` is responsible for posting
comments to that PR.

---------

Co-authored-by: Suejung Shin <suejung.shin@sentry.io>
Co-authored-by: Jenn Mueng <30991498+jennmueng@users.noreply.github.com>
@rohitvinnakota-codecov rohitvinnakota-codecov requested a review from a team as a code owner December 17, 2024 19:16
@@ -68,7 +68,7 @@ class PipelineStep(abc.ABC, Generic[_RequestType, _ContextType]):

def __init__(self, request: dict[str, Any]):
self.request = self._instantiate_request(request)
self.context = self._instantiate_context(self.request)
self.context = self._instantiate_context(self.request, DbStateRunTypes.PR_REVIEW)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed keyword here:

Cause of last revert

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm is this correct? we'd be defaulting all pipeline contexts to the pr review type including autofix?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That var is unused in the _instantiate_context method. I can update to autofix for clarity.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated to use None.

You can check autofix\steps\steps.py to verify

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