sweepai / sweep

Sweep: open-source AI-powered Software Developer for small features and bug fixes.
https://sweep.dev
Other
7.44k stars 426 forks source link

Sweep: Wrap all of the events in api.py with a worker wrapper #2314

Open wwzeng1 opened 1 year ago

wwzeng1 commented 1 year ago

Details

No response

Checklist - [X] ``sweepai/utils/worker_wrapper.py`` ✅ Commit 43dbf67 - [X] `sweepai/utils/worker_wrapper.py` ✅ Sandbox ran successfully - [X] ``sweepai/api.py`` ⚠️ No Changes Made - [X] `sweepai/api.py` ❌ Sandbox failed so I made additional changes - [X] `sweepai/api.py` ❌ Sandbox failed so I made additional changes - [X] `sweepai/api.py` ❌ Sandbox failed so I made additional changes - [X] `sweepai/api.py` ❌ Sandbox failed so I made additional changes - [X] `sweepai/api.py` ❌ Sandbox failed so I made additional changes - [ ] `tests/redirect_api.py` - [ ] `tests/archive/test_api.py` ![Flowchart](http://24.199.78.105:8082/public/dc17fc292a74a8122550bc550f93aebe7b167d72a8400a29f3788b36e4b69ddb_2314_flowchart.svg)
sweep-nightly[bot] commented 1 year ago
Sweeping

50%
💎 Sweep Pro: I'm creating this ticket using GPT-4. You have unlimited GPT-4 tickets.

![Docker Version Updated](https://img.shields.io/badge/Docker%20Version%20Update-59%20minutes%20ago-blue)

Actions (click)


Step 1: 🔎 Searching

I found the following snippets in your repository. I will now analyze these snippets and come up with a plan.

Some code snippets I looked at (click to expand). If some file is missing from here, you can mention the path in the ticket description. https://github.com/sweepai/sweep/blob/9fdbed39543d099904271bebe46ff6b0bb7e90eb/sweepai/api.py#L77-L376 https://github.com/sweepai/sweep/blob/9fdbed39543d099904271bebe46ff6b0bb7e90eb/tests/redirect_api.py#L1-L48 https://github.com/sweepai/sweep/blob/9fdbed39543d099904271bebe46ff6b0bb7e90eb/tests/archive/test_api.py#L1-L95 https://github.com/sweepai/sweep/blob/9fdbed39543d099904271bebe46ff6b0bb7e90eb/tests/archive/test_redis_api.py#L1-L67 https://github.com/sweepai/sweep/blob/9fdbed39543d099904271bebe46ff6b0bb7e90eb/sweepai/agents/validate_code.py#L211-L297

Step 2: ⌨️ Coding


Sandbox logs for 266be10
git add . && pre-commit run --files sweepai/utils/worker_wrapper.py || exit 0 1/3 ✓
trim trailing whitespace.................................................Failed
- hook id: trailing-whitespace
- exit code: 1
- files were modified by this hook
Fixing sweepai/utils/worker_wrapper.py
fix end of files.........................................................Passed
check yaml...........................................(no files to check)Skipped
black....................................................................Failed
- hook id: black
- files were modified by this hook
reformatted sweepai/utils/worker_wrapper.py
All done! ✨ 🍰 ✨
1 file reformatted.
isort....................................................................Failed
- hook id: isort
- files were modified by this hook
Fixing /repo/sweepai/utils/worker_wrapper.py
autoflake................................................................Passed
if [[ "sweepai/utils/worker_wrapper.py" == *.py ]]; then poetry run pylint --errors-only sweepai/utils/worker_wrapper.py; else return 0; fi 2/3 ✓
(nothing was outputted)
if [[ "sweepai/utils/worker_wrapper.py" == *.py ]]; then PYTHONPATH=. poetry run python sweepai/utils/worker_wrapper.py; else return 0; fi 3/3 ✓
(nothing was outputted)


Sandbox logs for 1ff97af
git add . && pre-commit run --files sweepai/api.py || exit 0 1/2 ✓
trim trailing whitespace.................................................Failed
- hook id: trailing-whitespace
- exit code: 1
- files were modified by this hook
Fixing sweepai/api.py
fix end of files.........................................................Passed
check yaml...........................................(no files to check)Skipped
black....................................................................Failed
- hook id: black
- exit code: 123
error: cannot format sweepai/api.py: Cannot parse: 677:12:             @app.post("/pull_request_review_comment")
Oh no! 💥 💔 💥
1 file failed to reformat.
isort....................................................................Failed
- hook id: isort
- files were modified by this hook
Fixing /repo/sweepai/api.py
autoflake................................................................Failed
- hook id: autoflake
- files were modified by this hook
if [[ "sweepai/api.py" == *.py ]]; then poetry run pylint --errors-only sweepai/api.py; else return 0; fi 2/2 ❌ (`2`)
************* Module sweepai.api
sweepai/api.py:677:13: E0001: Parsing failed: 'invalid syntax (, line 677)' (syntax-error)


Sandbox logs for 1ff97af
git add . && pre-commit run --files sweepai/api.py || exit 0 1/2 ✓
trim trailing whitespace.................................................Failed
- hook id: trailing-whitespace
- exit code: 1
- files were modified by this hook
Fixing sweepai/api.py
fix end of files.........................................................Passed
check yaml...........................................(no files to check)Skipped
black....................................................................Failed
- hook id: black
- exit code: 123
error: cannot format sweepai/api.py: Cannot parse: 677:12:             @app.post("/pull_request_review_comment")
Oh no! 💥 💔 💥
1 file failed to reformat.
isort....................................................................Failed
- hook id: isort
- files were modified by this hook
Fixing /repo/sweepai/api.py
autoflake................................................................Failed
- hook id: autoflake
- files were modified by this hook
if [[ "sweepai/api.py" == *.py ]]; then poetry run pylint --errors-only sweepai/api.py; else return 0; fi 2/2 ❌ (`2`)
************* Module sweepai.api
sweepai/api.py:677:13: E0001: Parsing failed: 'invalid syntax (, line 677)' (syntax-error)


Sandbox logs for dc0ae42
git add . && pre-commit run --files sweepai/api.py || exit 0 1/2 ✓
trim trailing whitespace.................................................Passed
fix end of files.........................................................Passed
check yaml...........................................(no files to check)Skipped
black....................................................................Failed
- hook id: black
- exit code: 123
error: cannot format sweepai/api.py: Cannot parse: 533:12:             @app.post("/pull_request_review_comment")
Oh no! 💥 💔 💥
1 file failed to reformat.
isort....................................................................Failed
- hook id: isort
- files were modified by this hook
Fixing /repo/sweepai/api.py
autoflake................................................................Passed
if [[ "sweepai/api.py" == *.py ]]; then poetry run pylint --errors-only sweepai/api.py; else return 0; fi 2/2 ❌ (`2`)
************* Module sweepai.api
sweepai/api.py:534:13: E0001: Parsing failed: 'invalid syntax (, line 534)' (syntax-error)


Sandbox logs for f1206b8
git add . && pre-commit run --files sweepai/api.py || exit 0 1/2 ✓
trim trailing whitespace.................................................Passed
fix end of files.........................................................Passed
check yaml...........................................(no files to check)Skipped
black....................................................................Failed
- hook id: black
- exit code: 123
error: cannot format sweepai/api.py: Cannot parse: 537:0:                     worker = WorkerWrapper(call_on_comment, **pr_change_request.params)
Oh no! 💥 💔 💥
1 file failed to reformat.
isort....................................................................Failed
- hook id: isort
- files were modified by this hook
Fixing /repo/sweepai/api.py
autoflake................................................................Passed
if [[ "sweepai/api.py" == *.py ]]; then poetry run pylint --errors-only sweepai/api.py; else return 0; fi 2/2 ❌ (`2`)
************* Module sweepai.api
sweepai/api.py:538:20: E0001: Parsing failed: 'unexpected indent (, line 538)' (syntax-error)


Sandbox logs for f1206b8
git add . && pre-commit run --files sweepai/api.py || exit 0 1/2 ✓
trim trailing whitespace.................................................Passed
fix end of files.........................................................Passed
check yaml...........................................(no files to check)Skipped
black....................................................................Failed
- hook id: black
- exit code: 123
error: cannot format sweepai/api.py: Cannot parse: 537:0:                     worker = WorkerWrapper(call_on_comment, **pr_change_request.params)
Oh no! 💥 💔 💥
1 file failed to reformat.
isort....................................................................Failed
- hook id: isort
- files were modified by this hook
Fixing /repo/sweepai/api.py
autoflake................................................................Passed
if [[ "sweepai/api.py" == *.py ]]; then poetry run pylint --errors-only sweepai/api.py; else return 0; fi 2/2 ❌ (`2`)
************* Module sweepai.api
sweepai/api.py:538:20: E0001: Parsing failed: 'unexpected indent (, line 538)' (syntax-error)


Step 3: 🔁 Code Review

Working on it...


🎉 Latest improvements to Sweep:


💡 To recreate the pull request edit the issue title or description. To tweak the pull request, leave a comment on the pull request. Join Our Discord