Open wwzeng1 opened 5 months ago
The issue was rejected with the following response:
Thank you for the feature request to add a Linear to GitHub integration. However, this task is a bit too broad and open-ended for our AI assistant Sweep to implement directly. Integrating two complex systems like Linear and GitHub requires careful planning of the authentication, data flow, API interactions and user experience. To move this forward, I'd suggest breaking it down into smaller, more targeted tasks that focus on specific code changes needed. For example, one task could be to add a new webhook endpoint to receive events from Linear. Another could be to write the logic to translate those events into calls to the GitHub API. It would also help to provide more detailed requirements on exactly how the integration should behave - what specific user workflows should be supported, what data needs to be synced between the systems, etc. If you're able to provide those additional details and decompose this into bite-sized development tasks, I'm happy to pass those along to Sweep to assist with the implementation. Let me know if you have any other questions!
For bonus GPT-4 tickets, please report this bug on Discord (tracking ID: c8d68b83d1
).
💡 To recreate the pull request edit the issue title or description.
This is an automated message generated by Sweep AI.
95e604d53d
)[!TIP] I can email you when I complete this pull request if you set up your email here!
I am currently looking into this ticket! I will update the progress of the ticket in this comment. I am currently searching through your code, looking for relevant snippets.
I'm searching for relevant snippets in your repository. If this is your first time using Sweep, I'm indexing your repository. You can monitor the progress using the progress dashboard
💡 To recreate the pull request edit the issue title or description. Something wrong? Let us know.
42c071e995
)[!TIP] I can email you when I complete this pull request if you set up your email here!
I am currently looking into this ticket! I will update the progress of the ticket in this comment. I am currently searching through your code, looking for relevant snippets.
I'm searching for relevant snippets in your repository. If this is your first time using Sweep, I'm indexing your repository. You can monitor the progress using the progress dashboard
💡 To recreate the pull request edit the issue title or description. Something wrong? Let us know.
The issue was rejected with the following response:
Thanks for submitting this issue to be resolved by Sweep. Adding a webhook endpoint to receive events from Linear is something Sweep should be able to assist with. However, to make the task even clearer, it would be helpful if you could provide a few additional details: 1. What programming language and framework is being used for the existing codebase where this webhook endpoint will be added? The example provided uses Node.js/Express, but please confirm if that matches your stack. 2. Where should the webhook secret be stored and accessed from within the codebase? Providing the location will help Sweep integrate the secret correctly. 3. What specific action should be invoked when a Linear issue is tagged with the "Sweep" label? Please provide more details on how Sweep should handle that scenario. With those extra bits of information, Sweep will be well-equipped to implement the Linear webhook integration for you. Let me know if you have any other questions!
For bonus GPT-4 tickets, please report this bug on Discord (tracking ID: 7a4c53f7a0
).
💡 To recreate the pull request edit the issue title or description.
This is an automated message generated by Sweep AI.
88f911c529
)[!TIP] I can email you when I complete this pull request if you set up your email here!
I am currently looking into this ticket! I will update the progress of the ticket in this comment. I am currently searching through your code, looking for relevant snippets.
I'm searching for relevant snippets in your repository. If this is your first time using Sweep, I'm indexing your repository. You can monitor the progress using the progress dashboard
💡 To recreate the pull request edit the issue title or description. Something wrong? Let us know.
The issue was rejected with the following response:
Thank you for submitting this issue. While it's an important feature to add, the current description is a bit too broad for Sweep to handle independently. To make it more suitable for Sweep, please consider providing the following additional details: 1. Specify the exact file path or location in the codebase where the new webhook endpoint should be added. 2. Include the necessary API tokens, secrets, and webhook URL directly in the issue description so Sweep can access them without needing to retrieve them from external sources. 3. Provide more specific instructions on how the webhook payload should be processed and what actions Sweep should take when the "Sweep" label is added to a Linear ticket. With these clarifications, Sweep will be better equipped to implement the required changes within the codebase. Please let me know if you have any further questions or need assistance in refining the issue description.
For bonus GPT-4 tickets, please report this bug on Discord (tracking ID: d2d53723c5
).
💡 To recreate the pull request edit the issue title or description.
This is an automated message generated by Sweep AI.
c1f2999e8a
)[!TIP] I can email you next time I complete a pull request if you set up your email here!
I found the following snippets in your repository. I will now analyze these snippets and come up with a plan.
sweepai/on_linear_ticket.py
✗ https://github.com/sweepai/sweep/commit/fd8b029536c5fb63633d5025b73d9ecc36653faa Edit
Create sweepai/on_linear_ticket.py with contents: Create a new file `on_linear_ticket.py` in the `sweepai` directory to contain the logic for processing Linear tickets.
import os
from gql import gql, Client
from gql.transport.requests import RequestsHTTPTransport
from sweepai.handlers.on_ticket import on_ticket
LINEAR_API_KEY = os.environ.get("LINEAR_API_KEY")
def handle_linear_ticket(event_data):
# Check if the event is for an Issue resource
if event_data["type"] == "Issue":
# Check if the Sweep label was added
if event_data["action"] == "labeled" and "Sweep" in event_data["data"]["labels"]:
issue_id = event_data["data"]["id"]
# Make a GraphQL query to retrieve the full issue details
transport = RequestsHTTPTransport(
url="https://api.linear.app/graphql",
headers={
"Authorization": LINEAR_API_KEY,
"Content-Type": "application/json",
},
)
client = Client(transport=transport)
query = gql(
"""
query ($id: String!) {
issue(id: $id) {
id
title
description
# Add other fields as needed
}
}
"""
)
result = client.execute(query, variable_values={"id": issue_id})
issue = result["issue"]
# Transform the Linear issue data into the format expected by on_ticket
ticket_data = {
"title": issue["title"],
"summary": issue["description"],
# Map other fields as needed
}
# Invoke the Sweep issue processing workflow
on_ticket(**ticket_data)
This file imports the necessary libraries, retrieves the LINEAR_API_KEY
from the environment variables, and defines the handle_linear_ticket
function.
The function checks if the incoming event is for an Issue resource and if the "Sweep" label was added. If so, it retrieves the full issue details using a GraphQL query to the Linear API.
It then transforms the Linear issue data into the format expected by the on_ticket
function, and invokes on_ticket
to process the issue using the standard Sweep workflow.
sweepai/api.py
✓ https://github.com/sweepai/sweep/commit/fd8b029536c5fb63633d5025b73d9ecc36653faa Edit
Modify sweepai/api.py with contents: Add a new webhook endpoint to receive events from Linear.
This code adds a new /linear_webhook
endpoint to receive events from Linear.
It first verifies the webhook signature by generating an HMAC hash of the raw request body using the LINEAR_WEBHOOK_SECRET
as the key, and comparing it to the signature sent in the Linear-Signature
header. If the signatures don't match, it raises a 400 Bad Request error.
If the signature is valid, it parses the JSON payload from the raw request body.
It then processes the event payload in a new thread by calling the handle_linear_ticket
function with the parsed event data.
Finally, it returns a 200 OK response to acknowledge receipt of the event.
sweepai/config/server.py
✓ https://github.com/sweepai/sweep/commit/fd8b029536c5fb63633d5025b73d9ecc36653faa Edit
Modify sweepai/config/server.py with contents: Add new environment variables for the Linear integration.
This code adds two new environment variables for the Linear integration:
LINEAR_WEBHOOK_SECRET
: The secret key used to verify the signature of incoming webhooks from Linear.LINEAR_API_KEY
: The API key used to authenticate requests to the Linear API.These variables are retrieved using os.environ.get()
and will be None
if not set.
I have finished reviewing the code for completeness. I did not find errors for sweep/add_a_new_webhook_endpoint_to_receive_ev
.
💡 To recreate the pull request edit the issue title or description. Something wrong? Let us know.
This is an automated message generated by Sweep AI.
[!TIP] I can email you next time I complete a pull request if you set up your email here!
I'm sorry, but it looks like an error has occurred due to a planning failure. The error message is handle_file_change_requests() got an unexpected keyword argument 'issue_number'. Feel free to add more details to the issue description so Sweep can better address it. Alternatively, reach out to Kevin or William for help at https://community.sweep.dev/.
For bonus GPT-4 tickets, please report this bug on Discourse (tracking ID: 02be73c968
).
Please look at the generated plan. If something looks wrong, please add more details to your issue.
File Path | Proposed Changes |
---|---|
sweepai/handlers/on_linear_ticket.py |
Create sweepai/handlers/on_linear_ticket.py with contents: Create a new file on_linear_ticket.py in the sweepai/handlers directory to handle incoming Linear webhook events.` `python<br/>from sweepai.handlers.on_ticket import on_ticket<br/><br/>def handle_linear_ticket(event):<br/> """Handle an incoming Linear webhook event."""<br/> <br/> # Extract relevant information from the event payload<br/> ticket_id = event["data"]["id"]<br/> ticket_title = event["data"]["title"]<br/> ticket_description = event["data"]["description"]<br/> ticket_labels = event["data"]["labels"]<br/> <br/> # Check if the ticket has the Sweep label<br/> if any(label["name"].lower() == LINEAR_LABEL_NAME.lower() for label in ticket_labels):<br/> # Invoke the Sweep workflow<br/> on_ticket(<br/> title=ticket_title,<br/> summary=ticket_description,<br/> issue_number=ticket_id,<br/> issue_url=f"https://linear.app/issue/{ticket_id}",<br/> username=event["data"]["creator"]["name"],<br/> repo_full_name="", # TODO: Map Linear project to GitHub repo<br/> repo_description="",<br/> installation_id=0, # TODO: Get GitHub app installation ID<br/> )<br/>\```<br/><br/>Import the on_ticketfunction from on_ticket.pyto start the Sweep workflow.<br/><br/>Use the LINEAR_LABEL_NAMEenvironment variable from server.pyto check if the ticket has the Sweep label.<br/><br/>TODO: <br/>- Map the Linear project to the corresponding GitHub repository to populate the repo_full_nameand repo_descriptionfields.<br/>- Get the GitHub app installation ID associated with the Linear project to populate the installation_id` field. |
sweepai/api.py |
Modify sweepai/api.py with contents: Add a new endpoint to receive webhook events from Linear.br/><br/><original_code><br/>@app.post("/jira")<br/def jira_webhook( request_dict: dict = Body(...), ) -> None: def call_jira_ticket(*args, kwargs): thread = threading.Thread(target=handle_jira_ticket, args=args, kwargs=kwargs) thread.start() call_jira_ticket(event=request_dict) # Set up cronjob for thisbr/></original_code><br/><br/><new_code><br/>@app.post("/jira")<br/def jira_webhook( request_dict: dict = Body(...), ) -> None: def call_jira_ticket(*args, *kwargs): thread = threading.Thread(target=handle_jira_ticket, args=args, kwargs=kwargs) thread.start() call_jira_ticket(event=request_dict) @app.post("/linear") def linear_webhook( request_dict: dict = Body(...), ) -> None: def call_linear_ticket(args, kwargs): thread = threading.Thread(target=handle_linear_ticket, args=args, kwargs=kwargs) thread.start() call_linear_ticket(event=request_dict) # Set up cronjob for this Add a new /linear endpoint alongside the existing /jira endpoint.Import the handle_linear_ticket function from the new on_linear_ticket.py file.Use a similar structure as the /jira endpoint to parse the incoming request payload and pass it to the handle_linear_ticket function in a new thread. |
sweepai/api.py |
Modify sweepai/api.py with contents: Import the handle_linear_ticket function.from sweepai.handlers.on_jira_ticket import handle_jira_ticket from sweepai.handlers.on_jira_ticket import handle_jira_ticket from sweepai.handlers.on_linear_ticket import handle_linear_ticket |
sweepai/config/server.py |
Modify sweepai/config/server.py with contents: Add environment variables for configuring the Linear integration. JIRA_USER_NAME = os.environ.get("JIRA_USER_NAME", None) JIRA_API_TOKEN = os.environ.get("JIRA_API_TOKEN", None) JIRA_URL = os.environ.get("JIRA_URL", None) SLACK_API_KEY = os.environ.get("SLACK_API_KEY", None) JIRA_USER_NAME = os.environ.get("JIRA_USER_NAME", None) JIRA_API_TOKEN = os.environ.get("JIRA_API_TOKEN", None) JIRA_URL = os.environ.get("JIRA_URL", None) LINEAR_API_KEY = os.environ.get("LINEAR_API_KEY", None) LINEAR_LABEL_NAME = os.environ.get("LINEAR_LABEL_NAME", "sweep") SLACK_API_KEY = os.environ.get("SLACK_API_KEY", None) Add LINEAR_API_KEY to store the API key for authenticating requests to the Linear API.Add LINEAR_LABEL_NAME to store the name of the label in Linear that should trigger the Sweep workflow. Default it to "sweep". |
💡 To recreate the pull request edit the issue title or description.
This is an automated message generated by Sweep AI.
[!TIP] I can email you next time I complete a pull request if you set up your email here!
I'm sorry, but it looks like an error has occurred due to a planning failure. The error message is . Feel free to add more details to the issue description so Sweep can better address it. Alternatively, reach out to Kevin or William for help at https://community.sweep.dev/.
For bonus GPT-4 tickets, please report this bug on Discourse (tracking ID: 5ea89248bd
).
Please look at the generated plan. If something looks wrong, please add more details to your issue.
File Path | Proposed Changes |
---|---|
sweepai/handlers/on_linear_ticket.py |
Create sweepai/handlers/on_linear_ticket.py with contents: Create a new file on_linear_ticket.py in the sweepai/handlers directory to handle incoming Linear webhook events.` `python<br/>from sweepai.handlers.on_ticket import on_ticket<br/><br/>def handle_linear_ticket(event):<br/> """Handle an incoming Linear webhook event."""<br/> <br/> # Extract relevant information from the event payload<br/> ticket_id = event["data"]["id"]<br/> ticket_title = event["data"]["title"]<br/> ticket_description = event["data"]["description"]<br/> ticket_labels = event["data"]["labels"]<br/> <br/> # Check if the ticket has the Sweep label<br/> if any(label["name"].lower() == LINEAR_LABEL_NAME.lower() for label in ticket_labels):<br/> # Invoke the Sweep workflow<br/> on_ticket(<br/> title=ticket_title,<br/> summary=ticket_description,<br/> issue_number=ticket_id,<br/> issue_url=f"https://linear.app/issue/{ticket_id}",<br/> username=event["data"]["creator"]["name"],<br/> repo_full_name="", # TODO: Map Linear project to GitHub repo<br/> repo_description="",<br/> installation_id=0, # TODO: Get GitHub app installation ID<br/> )<br/>\```<br/><br/>Import the on_ticketfunction from on_ticket.pyto start the Sweep workflow.<br/><br/>Use the LINEAR_LABEL_NAMEenvironment variable from server.pyto check if the ticket has the Sweep label.<br/><br/>TODO: <br/>- Map the Linear project to the corresponding GitHub repository to populate the repo_full_nameand repo_descriptionfields.<br/>- Get the GitHub app installation ID associated with the Linear project to populate the installation_id` field. |
sweepai/api.py |
Modify sweepai/api.py with contents: Add a new endpoint to receive webhook events from Linear.br/><br/><original_code><br/>@app.post("/jira")<br/def jira_webhook( request_dict: dict = Body(...), ) -> None: def call_jira_ticket(*args, kwargs): thread = threading.Thread(target=handle_jira_ticket, args=args, kwargs=kwargs) thread.start() call_jira_ticket(event=request_dict) # Set up cronjob for thisbr/></original_code><br/><br/><new_code><br/>@app.post("/jira")<br/def jira_webhook( request_dict: dict = Body(...), ) -> None: def call_jira_ticket(*args, *kwargs): thread = threading.Thread(target=handle_jira_ticket, args=args, kwargs=kwargs) thread.start() call_jira_ticket(event=request_dict) @app.post("/linear") def linear_webhook( request_dict: dict = Body(...), ) -> None: def call_linear_ticket(args, kwargs): thread = threading.Thread(target=handle_linear_ticket, args=args, kwargs=kwargs) thread.start() call_linear_ticket(event=request_dict) # Set up cronjob for this Add a new /linear endpoint alongside the existing /jira endpoint.Import the handle_linear_ticket function from the new on_linear_ticket.py file.Use a similar structure as the /jira endpoint to parse the incoming request payload and pass it to the handle_linear_ticket function in a new thread. |
sweepai/api.py |
Modify sweepai/api.py with contents: Import the handle_linear_ticket function.from sweepai.handlers.on_jira_ticket import handle_jira_ticket from sweepai.handlers.on_jira_ticket import handle_jira_ticket from sweepai.handlers.on_linear_ticket import handle_linear_ticket |
sweepai/config/server.py |
Modify sweepai/config/server.py with contents: Add environment variables for configuring the Linear integration. JIRA_USER_NAME = os.environ.get("JIRA_USER_NAME", None) JIRA_API_TOKEN = os.environ.get("JIRA_API_TOKEN", None) JIRA_URL = os.environ.get("JIRA_URL", None) SLACK_API_KEY = os.environ.get("SLACK_API_KEY", None) JIRA_USER_NAME = os.environ.get("JIRA_USER_NAME", None) JIRA_API_TOKEN = os.environ.get("JIRA_API_TOKEN", None) JIRA_URL = os.environ.get("JIRA_URL", None) LINEAR_API_KEY = os.environ.get("LINEAR_API_KEY", None) LINEAR_LABEL_NAME = os.environ.get("LINEAR_LABEL_NAME", "sweep") SLACK_API_KEY = os.environ.get("SLACK_API_KEY", None) Add LINEAR_API_KEY to store the API key for authenticating requests to the Linear API.Add LINEAR_LABEL_NAME to store the name of the label in Linear that should trigger the Sweep workflow. Default it to "sweep". |
💡 To recreate the pull request edit the issue title or description.
This is an automated message generated by Sweep AI.
I'm sorry, but it looks like an error has occurred due to a planning failure. The error message is handle_file_change_requests() got an unexpected keyword argument 'base_branch'. Feel free to add more details to the issue description so Sweep can better address it. Alternatively, reach out to Kevin or William for help at https://community.sweep.dev/.
For bonus GPT-4 tickets, please report this bug on Discourse (tracking ID: 8af71f052f
).
Please look at the generated plan. If something looks wrong, please add more details to your issue.
File Path | Proposed Changes |
---|---|
sweepai/api.py |
Modify sweepai/api.py with contents: Add a new webhook endpoint to receive events from Linear.br/><br/><original_code><br/>@app.post("/jira")<br/def jira_webhook( request_dict: dict = Body(...), ) -> None: def call_jira_ticket(*args, *kwargs): thread = threading.Thread(target=handle_jira_ticket, args=args, kwargs=kwargs) thread.start() call_jira_ticket(event=request_dict) from sweepai.handlers.on_linear_ticket import handle_linear_ticket @app.post("/linear") def linear_webhook( request_dict: dict = Body(...), ) -> None: def call_linear_ticket( thread = threading.Thread(target=handle_linear_ticket, args=args, kwargs=kwargs) thread.start() call_linear_ticket(event=request_dict) |
sweepai/handlers/on_linear_ticket.py |
Create sweepai/handlers/on_linear_ticket.py with contents: Implement the logic to handle Linear webhook events. import os from typing import Any, Dict from loguru import logger LINEAR_LABEL_NAME = os.environ.get("LINEAR_LABEL_NAME", "sweep") def handle_linear_ticket(event: Dict[str, Any]): try: ticket_data = event["data"] ticket_labels = ticket_data.get("labels", []) if any(label["name"].lower() == LINEAR_LABEL_NAME.lower() for label in ticket_labels): logger.info(f"Sweep label detected on Linear ticket {ticket_data['id']}") # TODO: Implement Sweep workflow logic here # Reference on_jira_ticket.py for how to process the ticket and kick off Sweep else: logger.info(f"Sweep label not found on Linear ticket {ticket_data['id']}") except Exception as e: logger.exception(f"Error processing Linear webhook event: {e}") |
sweepai/config/server.py |
Modify sweepai/config/server.py with contents: Add new environment variables for Linear integration. JIRA_USER_NAME = os.environ.get("JIRA_USER_NAME", None) JIRA_API_TOKEN = os.environ.get("JIRA_API_TOKEN", None) JIRA_URL = os.environ.get("JIRA_URL", None) JIRA_USER_NAME = os.environ.get("JIRA_USER_NAME", None) JIRA_API_TOKEN = os.environ.get("JIRA_API_TOKEN", None) JIRA_URL = os.environ.get("JIRA_URL", None) LINEAR_API_KEY = os.environ.get("LINEAR_API_KEY", None) LINEAR_LABEL_NAME = os.environ.get("LINEAR_LABEL_NAME", "sweep") |
💡 To recreate the pull request edit the issue title or description.
This is an automated message generated by Sweep AI.
4e814c9050
)[!TIP] I can email you next time I complete a pull request if you set up your email here!
I found the following snippets in your repository. I will now analyze these snippets and come up with a plan.
sweepai/api.py
✓ https://github.com/sweepai/sweep/commit/480395ae96abeb1874b8d5290a7d47c088bb18f4 Edit
Modify sweepai/api.py with contents: Add a new webhook endpoint to receive events from Linear.
sweepai/handlers/on_linear_ticket.py
✗ https://github.com/sweepai/sweep/commit/480395ae96abeb1874b8d5290a7d47c088bb18f4 Edit
Create sweepai/handlers/on_linear_ticket.py with contents: Implement the logic to handle Linear webhook events.
sweepai/config/server.py
✓ https://github.com/sweepai/sweep/commit/480395ae96abeb1874b8d5290a7d47c088bb18f4 Edit
Modify sweepai/config/server.py with contents: Add new environment variables for Linear integration.
I have finished reviewing the code for completeness. I did not find errors for sweep/add_a_new_webhook_endpoint_to_receive_ev_9d46f
.
💡 To recreate the pull request edit the issue title or description. Something wrong? Let us know.
This is an automated message generated by Sweep AI.
I'm sorry, but it looks like an error has occurred due to a planning failure. The error message is . Feel free to add more details to the issue description so Sweep can better address it. Alternatively, reach out to Kevin or William for help at https://community.sweep.dev/.
For bonus GPT-4 tickets, please report this bug on Discourse (tracking ID: 597fdf1c08
).
Please look at the generated plan. If something looks wrong, please add more details to your issue.
File Path | Proposed Changes |
---|---|
sweepai/api.py |
Modify sweepai/api.py with contents: Add a new webhook endpoint to receive events from Linear.br/><br/><original_code><br/>@app.post("/jira")<br/def jira_webhook( request_dict: dict = Body(...), ) -> None: def call_jira_ticket(*args, *kwargs): thread = threading.Thread(target=handle_jira_ticket, args=args, kwargs=kwargs) thread.start() call_jira_ticket(event=request_dict) from sweepai.handlers.on_linear_ticket import handle_linear_ticket @app.post("/linear") def linear_webhook( request_dict: dict = Body(...), ) -> None: def call_linear_ticket( thread = threading.Thread(target=handle_linear_ticket, args=args, kwargs=kwargs) thread.start() call_linear_ticket(event=request_dict) |
sweepai/handlers/on_linear_ticket.py |
Create sweepai/handlers/on_linear_ticket.py with contents: Implement the logic to handle Linear webhook events. import os from typing import Any, Dict from loguru import logger LINEAR_LABEL_NAME = os.environ.get("LINEAR_LABEL_NAME", "sweep") def handle_linear_ticket(event: Dict[str, Any]): try: ticket_data = event["data"] ticket_labels = ticket_data.get("labels", []) if any(label["name"].lower() == LINEAR_LABEL_NAME.lower() for label in ticket_labels): logger.info(f"Sweep label detected on Linear ticket {ticket_data['id']}") # TODO: Implement Sweep workflow logic here # Reference on_jira_ticket.py for how to process the ticket and kick off Sweep else: logger.info(f"Sweep label not found on Linear ticket {ticket_data['id']}") except Exception as e: logger.exception(f"Error processing Linear webhook event: {e}") |
sweepai/config/server.py |
Modify sweepai/config/server.py with contents: Add new environment variables for Linear integration. JIRA_USER_NAME = os.environ.get("JIRA_USER_NAME", None) JIRA_API_TOKEN = os.environ.get("JIRA_API_TOKEN", None) JIRA_URL = os.environ.get("JIRA_URL", None) JIRA_USER_NAME = os.environ.get("JIRA_USER_NAME", None) JIRA_API_TOKEN = os.environ.get("JIRA_API_TOKEN", None) JIRA_URL = os.environ.get("JIRA_URL", None) LINEAR_API_KEY = os.environ.get("LINEAR_API_KEY", None) LINEAR_LABEL_NAME = os.environ.get("LINEAR_LABEL_NAME", "sweep") |
💡 To recreate the pull request edit the issue title or description.
This is an automated message generated by Sweep AI.
I'm sorry, but it looks like an error has occurred due to a planning failure. The error message is . Feel free to add more details to the issue description so Sweep can better address it. Alternatively, reach out to Kevin or William for help at https://community.sweep.dev/.
For bonus GPT-4 tickets, please report this bug on Discourse (tracking ID: ff665e9888
).
Please look at the generated plan. If something looks wrong, please add more details to your issue.
File Path | Proposed Changes |
---|---|
sweepai/api.py |
Modify sweepai/api.py with contents: Add a new webhook endpoint to receive events from Linear.br/><br/><original_code><br/>@app.post("/jira")<br/def jira_webhook( request_dict: dict = Body(...), ) -> None: def call_jira_ticket(*args, *kwargs): thread = threading.Thread(target=handle_jira_ticket, args=args, kwargs=kwargs) thread.start() call_jira_ticket(event=request_dict) from sweepai.handlers.on_linear_ticket import handle_linear_ticket @app.post("/linear") def linear_webhook( request_dict: dict = Body(...), ) -> None: def call_linear_ticket( thread = threading.Thread(target=handle_linear_ticket, args=args, kwargs=kwargs) thread.start() call_linear_ticket(event=request_dict) |
sweepai/handlers/on_linear_ticket.py |
Create sweepai/handlers/on_linear_ticket.py with contents: Implement the logic to handle Linear webhook events. import os from typing import Any, Dict from loguru import logger LINEAR_LABEL_NAME = os.environ.get("LINEAR_LABEL_NAME", "sweep") def handle_linear_ticket(event: Dict[str, Any]): try: ticket_data = event["data"] ticket_labels = ticket_data.get("labels", []) if any(label["name"].lower() == LINEAR_LABEL_NAME.lower() for label in ticket_labels): logger.info(f"Sweep label detected on Linear ticket {ticket_data['id']}") # TODO: Implement Sweep workflow logic here # Reference on_jira_ticket.py for how to process the ticket and kick off Sweep else: logger.info(f"Sweep label not found on Linear ticket {ticket_data['id']}") except Exception as e: logger.exception(f"Error processing Linear webhook event: {e}") |
sweepai/config/server.py |
Modify sweepai/config/server.py with contents: Add new environment variables for Linear integration. JIRA_USER_NAME = os.environ.get("JIRA_USER_NAME", None) JIRA_API_TOKEN = os.environ.get("JIRA_API_TOKEN", None) JIRA_URL = os.environ.get("JIRA_URL", None) JIRA_USER_NAME = os.environ.get("JIRA_USER_NAME", None) JIRA_API_TOKEN = os.environ.get("JIRA_API_TOKEN", None) JIRA_URL = os.environ.get("JIRA_URL", None) LINEAR_API_KEY = os.environ.get("LINEAR_API_KEY", None) LINEAR_LABEL_NAME = os.environ.get("LINEAR_LABEL_NAME", "sweep") |
💡 To recreate the pull request edit the issue title or description.
This is an automated message generated by Sweep AI.
I'm sorry, but it looks like an error has occurred due to a planning failure. The error message is . Feel free to add more details to the issue description so Sweep can better address it. Alternatively, reach out to Kevin or William for help at https://community.sweep.dev/.
For bonus GPT-4 tickets, please report this bug on Discourse (tracking ID: 98f0e5a471
).
Please look at the generated plan. If something looks wrong, please add more details to your issue.
File Path | Proposed Changes |
---|---|
sweepai/api.py |
Modify sweepai/api.py with contents: Add a new webhook endpoint to receive events from Linear.br/><br/><original_code><br/>@app.post("/jira")<br/def jira_webhook( request_dict: dict = Body(...), ) -> None: def call_jira_ticket(*args, *kwargs): thread = threading.Thread(target=handle_jira_ticket, args=args, kwargs=kwargs) thread.start() call_jira_ticket(event=request_dict) from sweepai.handlers.on_linear_ticket import handle_linear_ticket @app.post("/linear") def linear_webhook( request_dict: dict = Body(...), ) -> None: def call_linear_ticket( thread = threading.Thread(target=handle_linear_ticket, args=args, kwargs=kwargs) thread.start() call_linear_ticket(event=request_dict) |
sweepai/handlers/on_linear_ticket.py |
Create sweepai/handlers/on_linear_ticket.py with contents: Implement the logic to handle Linear webhook events. import os from typing import Any, Dict from loguru import logger LINEAR_LABEL_NAME = os.environ.get("LINEAR_LABEL_NAME", "sweep") def handle_linear_ticket(event: Dict[str, Any]): try: ticket_data = event["data"] ticket_labels = ticket_data.get("labels", []) if any(label["name"].lower() == LINEAR_LABEL_NAME.lower() for label in ticket_labels): logger.info(f"Sweep label detected on Linear ticket {ticket_data['id']}") # TODO: Implement Sweep workflow logic here # Reference on_jira_ticket.py for how to process the ticket and kick off Sweep else: logger.info(f"Sweep label not found on Linear ticket {ticket_data['id']}") except Exception as e: logger.exception(f"Error processing Linear webhook event: {e}") |
sweepai/config/server.py |
Modify sweepai/config/server.py with contents: Add new environment variables for Linear integration. JIRA_USER_NAME = os.environ.get("JIRA_USER_NAME", None) JIRA_API_TOKEN = os.environ.get("JIRA_API_TOKEN", None) JIRA_URL = os.environ.get("JIRA_URL", None) JIRA_USER_NAME = os.environ.get("JIRA_USER_NAME", None) JIRA_API_TOKEN = os.environ.get("JIRA_API_TOKEN", None) JIRA_URL = os.environ.get("JIRA_URL", None) LINEAR_API_KEY = os.environ.get("LINEAR_API_KEY", None) LINEAR_LABEL_NAME = os.environ.get("LINEAR_LABEL_NAME", "sweep") |
💡 To recreate the pull request edit the issue title or description.
This is an automated message generated by Sweep AI.
39ea285ff5
)[!TIP] I can email you next time I complete a pull request if you set up your email here!
I found the following snippets in your repository. I will now analyze these snippets and come up with a plan.
sweepai/api.py
✓ https://github.com/sweepai/sweep/commit/a566ba8906d159106a6c89de185ce38abe7cccb9 Edit
Modify sweepai/api.py with contents: Add a new webhook endpoint to receive events from Linear.
sweepai/handlers/on_linear_ticket.py
✓ https://github.com/sweepai/sweep/commit/a566ba8906d159106a6c89de185ce38abe7cccb9 Edit
Create sweepai/handlers/on_linear_ticket.py with contents: Implement the logic to handle Linear webhook events.
sweepai/config/server.py
✓ https://github.com/sweepai/sweep/commit/a566ba8906d159106a6c89de185ce38abe7cccb9 Edit
Modify sweepai/config/server.py with contents: Add new environment variables for Linear integration.
I have finished reviewing the code for completeness. I did not find errors for sweep/add_a_new_webhook_endpoint_to_receive_ev_07d73
.
💡 To recreate the pull request edit the issue title or description. Something wrong? Let us know.
This is an automated message generated by Sweep AI.
e14f6a4c91
)[!TIP] I can email you next time I complete a pull request if you set up your email here!
I found the following snippets in your repository. I will now analyze these snippets and come up with a plan.
sweepai/api.py
✓ https://github.com/sweepai/sweep/commit/f4d67f2fc4b368884b52a9fc67b59a34cd8f6153 Edit
Modify sweepai/api.py with contents: Add a new webhook endpoint to receive events from Linear.
sweepai/handlers/on_linear_ticket.py
✓ https://github.com/sweepai/sweep/commit/f4d67f2fc4b368884b52a9fc67b59a34cd8f6153 Edit
Create sweepai/handlers/on_linear_ticket.py with contents: Implement the logic to handle Linear webhook events.
sweepai/config/server.py
✓ https://github.com/sweepai/sweep/commit/f4d67f2fc4b368884b52a9fc67b59a34cd8f6153 Edit
Modify sweepai/config/server.py with contents: Add new environment variables for Linear integration.
I have finished reviewing the code for completeness. I did not find errors for sweep/add_a_new_webhook_endpoint_to_receive_ev_8d40b
.
💡 To recreate the pull request edit the issue title or description. Something wrong? Let us know.
This is an automated message generated by Sweep AI.
[!TIP] I can email you next time I complete a pull request if you set up your email here!
I'm sorry, but it looks like an error has occurred due to a planning failure. The error message is . Feel free to add more details to the issue description so Sweep can better address it. Alternatively, reach out to Kevin or William for help at https://community.sweep.dev/.
For bonus GPT-4 tickets, please report this bug on Discourse (tracking ID: 6d8a059d91
).
Please look at the generated plan. If something looks wrong, please add more details to your issue.
File Path | Proposed Changes |
---|---|
sweepai/api.py |
Modify sweepai/api.py with contents: Add a new webhook endpoint to receive events from Linear.br/><br/><original_code><br/>@app.post("/jira")<br/def jira_webhook( request_dict: dict = Body(...), ) -> None: def call_jira_ticket(*args, *kwargs): thread = threading.Thread(target=handle_jira_ticket, args=args, kwargs=kwargs) thread.start() call_jira_ticket(event=request_dict) from sweepai.handlers.on_linear_ticket import handle_linear_ticket @app.post("/linear") def linear_webhook( request_dict: dict = Body(...), ) -> None: def call_linear_ticket( thread = threading.Thread(target=handle_linear_ticket, args=args, kwargs=kwargs) thread.start() call_linear_ticket(event=request_dict) |
sweepai/handlers/on_linear_ticket.py |
Create sweepai/handlers/on_linear_ticket.py with contents: Implement the logic to handle Linear webhook events. import os from typing import Any, Dict from loguru import logger LINEAR_LABEL_NAME = os.environ.get("LINEAR_LABEL_NAME", "sweep") def handle_linear_ticket(event: Dict[str, Any]): try: ticket_data = event["data"] ticket_labels = ticket_data.get("labels", []) if any(label["name"].lower() == LINEAR_LABEL_NAME.lower() for label in ticket_labels): logger.info(f"Sweep label detected on Linear ticket {ticket_data['id']}") # TODO: Implement Sweep workflow logic here # Reference on_jira_ticket.py for how to process the ticket and kick off Sweep else: logger.info(f"Sweep label not found on Linear ticket {ticket_data['id']}") except Exception as e: logger.exception(f"Error processing Linear webhook event: {e}") |
sweepai/config/server.py |
Modify sweepai/config/server.py with contents: Add new environment variables for Linear integration. JIRA_USER_NAME = os.environ.get("JIRA_USER_NAME", None) JIRA_API_TOKEN = os.environ.get("JIRA_API_TOKEN", None) JIRA_URL = os.environ.get("JIRA_URL", None) JIRA_USER_NAME = os.environ.get("JIRA_USER_NAME", None) JIRA_API_TOKEN = os.environ.get("JIRA_API_TOKEN", None) JIRA_URL = os.environ.get("JIRA_URL", None) LINEAR_API_KEY = os.environ.get("LINEAR_API_KEY", None) LINEAR_LABEL_NAME = os.environ.get("LINEAR_LABEL_NAME", "sweep") |
💡 To recreate the pull request edit the issue title or description.
This is an automated message generated by Sweep AI.
[!TIP] I can email you next time I complete a pull request if you set up your email here!
I'm sorry, but it looks like an error has occurred due to a planning failure. The error message is unsupported operand type(s) for |: 'str' and 'NoneType'. Feel free to add more details to the issue description so Sweep can better address it. Alternatively, reach out to Kevin or William for help at https://community.sweep.dev/.
For bonus GPT-4 tickets, please report this bug on Discourse (tracking ID: de0135bfbf
).
Please look at the generated plan. If something looks wrong, please add more details to your issue.
File Path | Proposed Changes |
---|---|
sweepai/api.py |
Modify sweepai/api.py with contents: Add a new webhook endpoint to receive events from Linear.br/><br/><original_code><br/>@app.post("/jira")<br/def jira_webhook( request_dict: dict = Body(...), ) -> None: def call_jira_ticket(*args, *kwargs): thread = threading.Thread(target=handle_jira_ticket, args=args, kwargs=kwargs) thread.start() call_jira_ticket(event=request_dict) from sweepai.handlers.on_linear_ticket import handle_linear_ticket @app.post("/linear") def linear_webhook( request_dict: dict = Body(...), ) -> None: def call_linear_ticket( thread = threading.Thread(target=handle_linear_ticket, args=args, kwargs=kwargs) thread.start() call_linear_ticket(event=request_dict) |
sweepai/handlers/on_linear_ticket.py |
Create sweepai/handlers/on_linear_ticket.py with contents: Implement the logic to handle Linear webhook events. import os from typing import Any, Dict from loguru import logger LINEAR_LABEL_NAME = os.environ.get("LINEAR_LABEL_NAME", "sweep") def handle_linear_ticket(event: Dict[str, Any]): try: ticket_data = event["data"] ticket_labels = ticket_data.get("labels", []) if any(label["name"].lower() == LINEAR_LABEL_NAME.lower() for label in ticket_labels): logger.info(f"Sweep label detected on Linear ticket {ticket_data['id']}") # TODO: Implement Sweep workflow logic here # Reference on_jira_ticket.py for how to process the ticket and kick off Sweep else: logger.info(f"Sweep label not found on Linear ticket {ticket_data['id']}") except Exception as e: logger.exception(f"Error processing Linear webhook event: {e}") |
sweepai/config/server.py |
Modify sweepai/config/server.py with contents: Add new environment variables for Linear integration. JIRA_USER_NAME = os.environ.get("JIRA_USER_NAME", None) JIRA_API_TOKEN = os.environ.get("JIRA_API_TOKEN", None) JIRA_URL = os.environ.get("JIRA_URL", None) JIRA_USER_NAME = os.environ.get("JIRA_USER_NAME", None) JIRA_API_TOKEN = os.environ.get("JIRA_API_TOKEN", None) JIRA_URL = os.environ.get("JIRA_URL", None) LINEAR_API_KEY = os.environ.get("LINEAR_API_KEY", None) LINEAR_LABEL_NAME = os.environ.get("LINEAR_LABEL_NAME", "sweep") |
💡 To recreate the pull request edit the issue title or description.
This is an automated message generated by Sweep AI.
e6030bce87
)[!TIP] I can email you next time I complete a pull request if you set up your email here!
I found the following snippets in your repository. I will now analyze these snippets and come up with a plan.
sweepai/api.py
✓ https://github.com/sweepai/sweep/commit/c1f2c0cc8955997caff0a9c1247ceea242b2c52d Edit
Modify sweepai/api.py with contents: Add a new webhook endpoint to receive events from Linear.
sweepai/handlers/on_linear_ticket.py
✓ https://github.com/sweepai/sweep/commit/c1f2c0cc8955997caff0a9c1247ceea242b2c52d Edit
Create sweepai/handlers/on_linear_ticket.py with contents: Implement the logic to handle Linear webhook events.
sweepai/config/server.py
✓ https://github.com/sweepai/sweep/commit/c1f2c0cc8955997caff0a9c1247ceea242b2c52d Edit
Modify sweepai/config/server.py with contents: Add new environment variables for Linear integration.
I have finished reviewing the code for completeness. I did not find errors for sweep/add_a_new_webhook_endpoint_to_receive_ev_88311
.
💡 To recreate the pull request edit the issue title or description. Something wrong? Let us know.
This is an automated message generated by Sweep AI.
5d26cf0a5d
)[!TIP] I can email you when I complete this pull request if you set up your email here!
I found the following snippets in your repository. I will now analyze these snippets and come up with a plan.
Working on it...
💡 To recreate the pull request edit the issue title or description. Something wrong? Let us know.
This is an automated message generated by Sweep AI.
1a4d39d77f
)[!TIP] I can email you next time I complete a pull request if you set up your email here!
I found the following snippets in your repository. I will now analyze these snippets and come up with a plan.
sweepai/handlers/on_linear_ticket.py
✓ https://github.com/sweepai/sweep/commit/d2ef91ea9518a55029c165c6d4e73857f54961a9 Edit
Create sweepai/handlers/on_linear_ticket.py with contents: Create a new file `on_linear_ticket.py` in the `sweepai/handlers` directory to handle Linear ticket events.
from typing import Dict
from sweepai.utils.event_logger import logger
def handle_linear_ticket(event: Dict):
"""Handle a Linear ticket event."""
logger.info(f"Received Linear ticket event: {event}")
# Extract relevant information from the event payload
ticket_id = event["data"]["id"]
ticket_title = event["data"]["title"]
ticket_description = event["data"]["description"]
# Check if the ticket has the "Sweep" label
has_sweep_label = any(label["name"] == "Sweep" for label in event["data"]["labels"]["nodes"])
if has_sweep_label:
# Invoke the Sweep workflow for the Linear ticket
logger.info(f"Linear ticket {ticket_id} has the Sweep label, invoking Sweep workflow")
# TODO: Implement Sweep workflow for Linear tickets
else:
logger.info(f"Linear ticket {ticket_id} does not have the Sweep label, ignoring")
sweepai/api.py
✓ https://github.com/sweepai/sweep/commit/d2ef91ea9518a55029c165c6d4e73857f54961a9 Edit
Modify sweepai/api.py with contents:
Add a new FastAPI endpoint to receive Linear webhook events.
sweepai/api.py
✓ https://github.com/sweepai/sweep/commit/d2ef91ea9518a55029c165c6d4e73857f54961a9 Edit
Modify sweepai/api.py with contents:
Import the handle_linear_ticket
function in api.py
.
sweepai/config/server.py
✓ https://github.com/sweepai/sweep/commit/d2ef91ea9518a55029c165c6d4e73857f54961a9 Edit
Modify sweepai/config/server.py with contents:
Add environment variables for Linear integration to server.py
.
I have finished reviewing the code for completeness. I did not find errors for sweep/add_a_new_webhook_endpoint_to_receive_ev_5c6f8
.
💡 To recreate the pull request edit the issue title or description. Something wrong? Let us know.
This is an automated message generated by Sweep AI.
https://developers.linear.app/docs/graphql/webhooks
refer to api.py and on_jira_ticket.py as references. you should add envvars to server.py
Checklist
- [X] Create `sweepai/handlers/on_linear_ticket.py` ✓ https://github.com/sweepai/sweep/commit/d2ef91ea9518a55029c165c6d4e73857f54961a9 [Edit](https://github.com/sweepai/sweep/edit/sweep/add_a_new_webhook_endpoint_to_receive_ev_5c6f8/sweepai/handlers/on_linear_ticket.py) - [X] Modify `sweepai/api.py` ✓ https://github.com/sweepai/sweep/commit/d2ef91ea9518a55029c165c6d4e73857f54961a9 [Edit](https://github.com/sweepai/sweep/edit/sweep/add_a_new_webhook_endpoint_to_receive_ev_5c6f8/sweepai/api.py) - [X] Modify `sweepai/api.py` ✓ https://github.com/sweepai/sweep/commit/d2ef91ea9518a55029c165c6d4e73857f54961a9 [Edit](https://github.com/sweepai/sweep/edit/sweep/add_a_new_webhook_endpoint_to_receive_ev_5c6f8/sweepai/api.py) - [X] Modify `sweepai/config/server.py` ✓ https://github.com/sweepai/sweep/commit/d2ef91ea9518a55029c165c6d4e73857f54961a9 [Edit](https://github.com/sweepai/sweep/edit/sweep/add_a_new_webhook_endpoint_to_receive_ev_5c6f8/sweepai/config/server.py)