-
-
Notifications
You must be signed in to change notification settings - Fork 1
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
base: main
Are you sure you want to change the base?
Conversation
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>
src/seer/automation/pipeline.py
Outdated
@@ -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) |
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.
Removed keyword here:
Cause of last revert
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.
hmm is this correct? we'd be defaulting all pipeline contexts to the pr review type including autofix?
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.
That var is unused in the _instantiate_context method. I can update to autofix for clarity.
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.
Updated to use None
.
You can check autofix\steps\steps.py
to verify
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 reviewpr_review_step.py
is responsible for fetching a list of json commentsfor a given PR, and
pr_review_publisher
is responsible for postingcomments to that PR.