From 728131ff1dfb64123f4a7826a37513c3f37ca032 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E0=AE=AE=E0=AE=A9=E0=AF=8B=E0=AE=9C=E0=AF=8D=E0=AE=95?= =?UTF-8?q?=E0=AF=81=E0=AE=AE=E0=AE=BE=E0=AE=B0=E0=AF=8D=20=E0=AE=AA?= =?UTF-8?q?=E0=AE=B4=E0=AE=A9=E0=AE=BF=E0=AE=9A=E0=AF=8D=E0=AE=9A=E0=AE=BE?= =?UTF-8?q?=E0=AE=AE=E0=AE=BF?= Date: Thu, 18 Jul 2024 08:40:53 +0530 Subject: [PATCH] Fix: Review PR Dogfood (#2916) * Fix env variables, prompt, and exit (cherry picked from commit b45bc1638397427ec5e82540c63c4cda0d1e2094) * fix echo * Run without docker to avoid running as root. --------- Co-authored-by: Boxuan Li --- .github/workflows/review-pr.yml | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/.github/workflows/review-pr.yml b/.github/workflows/review-pr.yml index 1a9aeccc391c..f38c65b8325d 100644 --- a/.github/workflows/review-pr.yml +++ b/.github/workflows/review-pr.yml @@ -12,15 +12,15 @@ jobs: dogfood: if: contains(github.event.pull_request.labels.*.name, 'review-this') runs-on: ubuntu-latest - container: - image: ghcr.io/opendevin/opendevin - volumes: - - /var/run/docker.sock:/var/run/docker.sock - steps: + - uses: actions/checkout@v4 + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: '3.11' - name: install git, github cli run: | - apt-get install -y git gh + sudo apt-get install -y git gh git config --global --add safe.directory $PWD - name: Checkout Repository @@ -34,7 +34,9 @@ jobs: - name: Write Task File run: | - echo "Your coworker wants to apply a pull request to this project. Read and review ${{ github.event.pull_request.number }}.diff file. Create a review-${{ github.event.pull_request.number }}.txt and write your concise comments and suggestions there." > task.txt + echo "Your coworker wants to apply a pull request to this project." > task.txt + echo "Read and review ${{ github.event.pull_request.number }}.diff file. Create a review-${{ github.event.pull_request.number }}.txt and write your concise comments and suggestions there." >> task.txt + echo "Do not ask me for confirmation at any point." >> task.txt echo "" >> task.txt echo "Title" >> task.txt echo "${{ github.event.pull_request.title }}" >> task.txt @@ -53,15 +55,17 @@ jobs: - name: Run OpenDevin env: - LLM_API_KEY: ${{ secrets.OPENAI_API_KEY }} - OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} + LLM_API_KEY: ${{ secrets.LLM_API_KEY }} + LLM_MODEL: ${{ vars.LLM_MODEL }} SANDBOX_BOX_TYPE: ssh run: | # Append path to launch poetry export PATH="/github/home/.local/bin:$PATH" # Append path to correctly import package, note: must set pwd at first export PYTHONPATH=$(pwd):$PYTHONPATH - WORKSPACE_MOUNT_PATH=$GITHUB_WORKSPACE poetry run python ./opendevin/core/main.py -i 50 -f task.txt -d $GITHUB_WORKSPACE + export WORKSPACE_MOUNT_PATH=$GITHUB_WORKSPACE + export WORKSPACE_BASE=$GITHUB_WORKSPACE + echo -e "/exit\n" | poetry run python opendevin/core/main.py -i 50 -f task.txt rm task.txt - name: Check if review file is non-empty