Open kevinlu1248 opened 9 months ago
88badd965c
)[!TIP] I'll email you at kevinlu1248@gmail.com when I complete this pull request!
Here are the GitHub Actions logs prior to making any changes:
581c4a8
Checking sweepai/handlers/on_ticket.py for syntax errors... β sweepai/handlers/on_ticket.py has no syntax errors!
1/1 βChecking sweepai/handlers/on_ticket.py for syntax errors... β sweepai/handlers/on_ticket.py has no syntax errors!
Sandbox passed on the latest main
, so sandbox checks will be enabled for this issue.
I found the following snippets in your repository. I will now analyze these snippets and come up with a plan.
sweepai/handlers/on_ticket.py
β https://github.com/sweepai/sweep/commit/7dbe4245fc1bb2fb211840bb2b84fe981bc58466 Edit
Modify sweepai/handlers/on_ticket.py with contents:
β’ Move the block of code that generates the `config_pr_message` (lines 435-440) to be above the line where the email content starts being assembled. This will likely involve repositioning the code to before any other message components are concatenated.
β’ Ensure that the `config_pr_message` is still conditionally added based on whether `config_pr_url` is not None. The logic for this condition should not change.
β’ After repositioning, adjust the concatenation order to ensure that the `config_pr_message` appears above the email line in the final message. This might involve introducing a new variable or directly concatenating the `config_pr_message` with the subsequent message parts in the correct order.
β’ Test the change by triggering the condition that generates this message to ensure that the "Install Sweep Configs: Pull Request" message now appears above the email line as requested.
--- +++ @@ -412,24 +412,6 @@ ticket_progress.save() config_pr_url = None - - user_settings = UserSettings.from_username(username=username) - user_settings_message = user_settings.get_message() - - def get_comment_header( - index, - errored=False, - pr_message="", - done=False, - initial_sandbox_response: int | SandboxResponse = -1, - initial_sandbox_response_file=None, - ): - config_pr_message = ( - "\n" - + f"Install Sweep Configs: Pull Request" - if config_pr_url is not None - else "" - ) actions_message = create_action_buttons( [ RESTART_SWEEP_BUTTON, @@ -1464,6 +1446,14 @@ f"Sorry, I could not edit `{e.filename}` as this file is too long." " We are currently working on improved file streaming to address" " this issue.\n" + config_pr_message = ( + "\n" + + f"Install Sweep Configs: Pull Request" + if config_pr_url is not None + else "" + ) + user_settings = UserSettings.from_username(username=username) + user_settings_message = user_settings.get_message() ), -1, )
sweepai/handlers/on_ticket.py
β Edit
Check sweepai/handlers/on_ticket.py with contents:
Ran GitHub Actions for 7dbe4245fc1bb2fb211840bb2b84fe981bc58466:
β’ Vercel Preview Comments: β
I have finished reviewing the code for completeness. I did not find errors for sweep/in_on_ticketpy_move_the_install_sweep_co_98954
.
π‘ To recreate the pull request edit the issue title or description. To tweak the pull request, leave a comment on the pull request.Something wrong? Let us know.
Checklist
- [X] Modify `sweepai/handlers/on_ticket.py` β https://github.com/sweepai/sweep/commit/7dbe4245fc1bb2fb211840bb2b84fe981bc58466 [Edit](https://github.com/sweepai/sweep/edit/sweep/in_on_ticketpy_move_the_install_sweep_co_98954/sweepai/handlers/on_ticket.py#L434-L448) - [X] Running GitHub Actions for `sweepai/handlers/on_ticket.py` β [Edit](https://github.com/sweepai/sweep/edit/sweep/in_on_ticketpy_move_the_install_sweep_co_98954/sweepai/handlers/on_ticket.py#L434-L448)