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

Sweep: in on_ticket.py, move the "Install Sweep Configs: Pull Request" above the email line #2918

Open
2 tasks done
kevinlu1248 opened this issue Jan 10, 2024 · 1 comment · May be fixed by #2919 or #2932
Open
2 tasks done
Labels
sweep Assigns Sweep to an issue or pull request.

Comments

@kevinlu1248
Copy link
Member

kevinlu1248 commented Jan 10, 2024

Checklist
  • Modify sweepai/handlers/on_ticket.py7dbe424 Edit
  • Running GitHub Actions for sweepai/handlers/on_ticket.pyEdit
@kevinlu1248 kevinlu1248 added the sweep Assigns Sweep to an issue or pull request. label Jan 10, 2024
Copy link
Contributor

sweep-nightly bot commented Jan 10, 2024

🚀 Here's the PR! #3018

See Sweep's progress at the progress dashboard!
💎 Sweep Pro: I'm using GPT-4. You have unlimited GPT-4 tickets. (tracking ID: 88badd965c)

Tip

I'll email you at kevinlu1248@gmail.com when I complete this pull request!


Actions (click)

  • ↻ Restart Sweep

GitHub Actions✓

Here are the GitHub Actions logs prior to making any changes:

Sandbox logs for 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.


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 think are relevant in decreasing order of relevance (click to expand). If some file is missing from here, you can mention the path in the ticket description.

):
config_pr_message = (
"\n"
+ f"<div align='center'>Install Sweep Configs: <a href='{config_pr_url}'>Pull Request</a></div>"
if config_pr_url is not None
else ""
)
actions_message = create_action_buttons(
[
RESTART_SWEEP_BUTTON,
]
)
sandbox_execution_message = "\n\n## GitHub Actions failed\n\nThe sandbox appears to be unavailable or down.\n\n"


Step 2: ⌨️ Coding

  • Modify sweepai/handlers/on_ticket.py7dbe424 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, )
  • Running GitHub Actions for sweepai/handlers/on_ticket.pyEdit
Check sweepai/handlers/on_ticket.py with contents:

Ran GitHub Actions for 7dbe4245fc1bb2fb211840bb2b84fe981bc58466:
• Vercel Preview Comments:


Step 3: 🔁 Code Review

I have finished reviewing the code for completeness. I did not find errors for sweep/in_on_ticketpy_move_the_install_sweep_co_98954.


🎉 Latest improvements to Sweep:
  • New dashboard launched for real-time tracking of Sweep issues, covering all stages from search to coding.
  • Integration of OpenAI's latest Assistant API for more efficient and reliable code planning and editing, improving speed by 3x.
  • Use the GitHub issues extension for creating Sweep issues directly from your editor.

💡 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment