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: cookbook entry to auto-merge/close select Dependabot PRs #724
base: main
Are you sure you want to change the base?
Conversation
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.
💙 this is awesome - thanks for the PR!
just a couple comments / requests
def heruistics(pr): | ||
client = OpenAI(api_key=os.getenv("OPENAI_API_KEY")) | ||
|
||
def evaluate_heuristic(pr, labels, description, files_changed): |
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.
can we type-hint this since it'll be something we serialize and show to an LLM?
@cyai it would also be great if you could run |
on: | ||
pull_request: | ||
paths: | ||
- "cookbook/**/*" |
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 don't think we want this to run on all pull requests, perhaps a cron
would be more appropriate? or maybe an if
that checks the username / branch upon a new pull request?
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.
Checking the username / branch upon a new pull request is a great idea.
Hey, @zzstoatzz I've added commits for the requested changes and also ran |
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 inline comment in the GitHub Actions workflow is clear, but the Python script itself would benefit from more in-line comments explaining the logic, especially around decision points like confidence score thresholds.
return repo.get_pulls(state="open", head="dependabot") | ||
|
||
|
||
def heruistics(pr) -> float: |
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.
heruistics != heuristics
|
||
def notify_maintainer_merger(pr, confidence_score: float) -> None: | ||
pr.create_issue_comment( | ||
f"Hey @@zzstoatzz! I have evaluated this PR and am {confidence_score*100}%" |
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 script hardcodes the GitHub username @zzstoatzz in the notification messages. It's better to use a dynamic value or an environment variable for flexibility.
Adding docstrings explaining the purpose, parameters, and return values of functions would greatly improve code readability and maintainability. |
feat: cookbook entry to auto-merge/close select Dependabot PRs
This commit includesPython script,
dependabot_auto_evaluation_pr.py
, which automates the process of handling Dependabot PRs. The script authenticates with GitHub, retrieves open PRs from Dependabot, uses marvin ai function to determine heuristics (confidence to merge) to evaluate the PRs, and then decides whether to merge or close the PRs based on the evaluation results.closes #700