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

Add Code-Butler GitHub Action #3

Closed
wants to merge 2 commits into from
Closed

Conversation

sweep-ai[bot]
Copy link
Contributor

@sweep-ai sweep-ai bot commented Dec 1, 2023

PR Feedback: 👎

Description

This pull request adds the Code-Butler GitHub Action to the repository. The Code-Butler Action is a workflow that runs on pull requests and performs code review tasks.

Summary

  • Added .github/workflows/code_butler.yml file
  • Created a workflow named "Code Butler" that runs on pull requests
  • Added a job named "review" that runs on the latest version of Ubuntu
  • Added steps to checkout the code and run the Code Butler action
  • Configured the Code Butler action with the GitHub token and the "review" command

Fixes #2.


🎉 Latest improvements to Sweep:

  • Sweep uses OpenAI's latest Assistant API to plan code changes and modify code! This is 3x faster and significantly more reliable as it allows Sweep to edit code and validate the changes in tight iterations, the same way as a human would.
  • Sweep now uses the rope library to refactor Python! Check out Large Language Models are Bad at Refactoring Code. To have Sweep refactor your code, try sweep: Refactor <your_file>.py!

💡 To get Sweep to edit this pull request, you can:

  • Comment below, and Sweep can edit the entire PR
  • Comment on a file, Sweep will only modify the commented file
  • Edit the original issue to get Sweep to recreate the PR from scratch

Copy link
Contributor Author

sweep-ai bot commented Dec 1, 2023

Sandbox Executions

Copy link
Contributor Author

sweep-ai bot commented Dec 1, 2023

Apply Sweep Rules to your PR?

  • Apply: All new business logic should have corresponding unit tests.
  • Apply: Refactor large functions to be more modular.
  • Apply: Add docstrings to all functions and file headers.

@sweep-ai sweep-ai bot added the sweep label Dec 1, 2023
@sweep-ai sweep-ai bot mentioned this pull request Dec 1, 2023
1 task
Copy link
Contributor Author

sweep-ai bot commented Dec 1, 2023

The command:
Operating System
yielded the following error:
##[error]Unable to resolve action ouchi2501/code-butler, repository not found Requested labels: ubuntu-latest Job defined at: ouchi2501/code-explain/.github/workflows/code_butler.yml@refs/pull/3/merge Waiting for a runner to pick up this job... Job is waiting for a hosted runner to come online. Job is about to start running on the hosted runner: GitHub Actions 1 (hosted) Current runner version: '2.311.0' ##[group]Operating System Ubuntu 22.04.3 LTS ##[endgroup] ##[group]Runner Image Image: ubuntu-22.04 Version: 20231126.1.0 Included Software: https://github.com/actions/runner-images/blob/ubuntu22/20231126.1/images/ubuntu/Ubuntu2204-Readme.md Image Release: https://github.com/actions/runner-images/releases/tag/ubuntu22%2F20231126.1 ##[endgroup] ##[group]Runner Image Provisioner 2.0.321.1 ##[endgroup] ##[group]GITHUB_TOKEN Permissions Contents: read Metadata: read Packages: read ##[endgroup] Secret source: Actions Prepare workflow directory Prepare all required actions Getting action download info ##[error]Unable to resolve action ouchi2501/code-butler, repository not found
Here are the logs:

##[group]Runner Image
Image: ubuntu-22.04
Version: 20231126.1.0
Included Software: https://github.com/actions/runner-images/blob/ubuntu22/20231126.1/images/ubuntu/Ubuntu2204-Readme.md
Image Release: https://github.com/actions/runner-images/releases/tag/ubuntu22%2F20231126.1
##[endgroup]
##[group]Runner Image Provisioner
2.0.321.1
##[endgroup]
##[group]GITHUB_TOKEN Permissions
Contents: read
Metadata: read
Packages: read
##[endgroup]
Secret source: Actions
Prepare workflow directory
Prepare all required actions
Getting action download info

Copy link
Contributor Author

sweep-ai bot commented Dec 1, 2023

🚀 Wrote Changes

Done.

@ouchi2501
Copy link
Owner

Sweep: add the yml from https://github.com/marketplace/actions/code-butler-for-pr-review's Initial Setup to this repository without changing anything

Copy link
Contributor Author

sweep-ai bot commented Dec 1, 2023

❌ Failed to make changes

Please join our Discord to report this issue.

@ouchi2501
Copy link
Owner

Sweep: Correction to the following.

name: Code Butler

permissions:
  contents: read
  pull-requests: write

on:
  issue_comment:
    types: [created]

jobs:
  review:
    if: startsWith(github.event.comment.body, '/review')
    runs-on: ubuntu-latest
    steps:
      - uses: ca-dp/code-butler@v1
        with:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
          cmd: review
  chat:
    if: startsWith(github.event.comment.body, '/chat')
    runs-on: ubuntu-latest
    steps:
      - uses: ca-dp/code-butler@v1
        with:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
          cmd: chat
          comment_body: ${{ github.event.comment.body }}

Copy link
Contributor Author

sweep-ai bot commented Dec 1, 2023

🚀 Wrote Changes

I wasn't able to make changes. This could be due to an unclear request or a bug in my code.
As a reminder, comments on a file only modify that file. Comments on a PR (at the bottom of the "conversation" tab) can modify the entire PR. Please try again or contact us on Discord

@ouchi2501 ouchi2501 closed this Dec 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Sweep: Install Code-Butler
1 participant