We are thrilled to introduce the latest integration of AutoCodeRover within GitHub, bringing effortless automation to software development. With this new feature, users can seamlessly invoke the AutoCodeRover agent directly within GitHub issues to automatically generate software patches, quickly address reported problems, and subsequently create Pull Requests with zero friction. AutoCodeRover is our advanced agent technology designed for autonomous program enhancement, which is capable of generating code to fix software defects and implement new features.
![](https://static.wixstatic.com/media/e4fd53_7a986ee3375d4ddf86455e9b2b9d0dfa~mv2.png/v1/fill/w_720,h_720,al_c,q_90,enc_auto/e4fd53_7a986ee3375d4ddf86455e9b2b9d0dfa~mv2.png)
How does it work?
AutoCodeRover is an agent technology that leverages the capabilities of AI to generate program improvements (see technical report). Our autonomous agent can automatically infer the expected behavior from the issue description, identify the source location to modify, and generate code changes to resolve the described issue. Here is a quick demo showcasing the use of AutoCodeRover on GitHub issues. In this video, we demonstrate the power of AI using a real-world GitHub project discord.py, a popular API wrapper for Discord written in Python. We replicate a scenario from a recently disclosed issue.
How to Setup?
You can set up AutoCodeRover on your own GitHub repositories using GitHub Actions. GitHub Actions provides a way to automate workflows for continuous integration, deployment tasks, and project management in a repository. They run directly on GitHub servers hosted runner machines or self-hosted runners that your repository maintainer sets up. You can configure custom workflows and decide when to invoke AutoCodeRover.
You can also configure your preferred LLM model to generate the patch, currently, we support OpenAI and Anthoripc models only. GitHub Actions comes with built-in secrets management, which allows you to securely store your OpenAI or Anthropic keys.
Step 1:
In your repository, create a new workflow file (e.g. acr_bot.yml) in .github/workflows/. Following is an example template that you can modify and update.
name: "AutoCodeRover Bot"
permissions:
issues: write
contents: write # change to `read` if you do not want to use open-pr
pull-requests: write # (optional) remove if you do not want to use open-pr
on:
issue_comment:
types: [created]
issues:
types: [opened]
jobs:
acr-bot:
runs-on: ubuntu-latest
if: ${{ contains(github.event.comment.body || github.event.issue.body, '@acr-bot') }}
steps:
- name: Check out
uses: actions/checkout@v4
- id: set-var
run: echo "GITHUB_WORKSPACE=$GITHUB_WORKSPACE" >> $GITHUB_OUTPUT
- name: ACR bot
uses: AutoCodeRoverSG/code-rover-bot@v2.0.0
env:
TARGET_REPO_PATH: ${{ steps.set-var.outputs.GITHUB_WORKSPACE }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
Step 2:
Set OPENAI_API_KEYÂ or ANTHROPIC_API_KEYÂ in your repository.
This should set in Settings -> Secrets and variables -> Actions. In Repository secrets, create a new secret with the name OPENAI_API_KEYÂ whose value is your key. If you want to use the Anthropic models, set ANTHROPIC_API_KEYÂ them with similar steps.
Running the Bot
You can now invoke acr-bot under an existing issue in your repository. The bot can be invoked by writing @acr-bot <instruction>Â as a comment on the issue. <instruction>Â should be a model name that you wish to invoke acr-bot with.
List of currently supported model names:
Name | Model |
gpt-4o | gpt-4o-2024-11-20 |
gpt-4o-2024-08-06 | gpt-4o-2024-08-06 |
gpt-4o-2024-05-13 | gpt-4o-2024-05-13 |
gpt-4-turbo-2024-04-09 | gpt-4-turbo-2024-04-09 |
gpt-4-turbo-2024-04-09 | gpt-4-turbo-2024-04-09 |
sonnet | claude-3-5-sonnet-20241022 |
claude-3-5-sonnet-20241022 | claude-3-5-sonnet-20241022 |
claude-3-5-sonnet-20240620 | claude-3-5-sonnet-20240620 |
claude-3-opus-20240229 | claude-3-opus-20240229 |
The recommended models are gpt-4o and sonnet, which can be invoked by @acr-bot gpt-4o and @acr-bot sonnet. You can also omit the instruction (i.e. just @acr-bot), and the default model will be used (currently gpt-4o).
Iterative Feedback
The GitHub bot can also work in an interactive feedback loop, where you can add additional requirements or enhance the issue description by adding new comments to the existing GitHub issue. AutoCodeRover bot will automatically retrieve all comments to create a summary to generate a better patch.
Finally, you can instruct our GitHub bot to create a pull request using
@acr-bot open-pr
The bot will then process the conversation history of the issue and take the latest patch generated by itself to create a pull request.
Note that you should use this mode only after acr-bot has generated a patch for this issue in the Patch mode.
Final Remarks
It’s easier to use AutoCodeRover with your GitHub projects using GitHub actions, which you can customize with many more events. Extending the above template, you can invoke AutoCodeRover to fix build failures, generate code changes for discussion topics, and many more. We encourage you to explore these possibilities and share your experience in the comments below!
We’ll also be releasing more user-friendly services around AutoCodeRover.
Stay tuned by:
Following us on X (https://twitter.com/autocoderover)
Following us on LinkedIn (https://www.linkedin.com/company/autocoderover)
Joining our Discord channel (https://discord.gg/c6DAfNUngZ)
Visiting our Website (https://autocoderover.dev)
Comentários