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: Fix the pylint issue in api.py (✓ Sandbox Passed) #2850

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions sweepai/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -271,9 +271,9 @@ async def webhook(raw_request: Request):
request.check_run.run_id,
request.installation.id,
)
logs, user_message = clean_logs(logs)
commit_author = request.sender.login
tracking_id = get_hash()
commit_author = request.sender.login if request.sender else 'unknown'
chat_logger = None # Default value in case not set later
stack_pr(
request=f"[Sweep GHA Fix] The GitHub Actions run failed with the following error logs:\n\n```\n\n{logs}\n\n```",
pr_number=pr.number,
Expand All @@ -290,7 +290,6 @@ async def webhook(raw_request: Request):
request.installation.id,
)
logs, user_message = clean_logs(logs)
commit_author = request.sender.login
chat_logger = ChatLogger(
data={
"username": commit_author,
Expand All @@ -305,8 +304,8 @@ async def webhook(raw_request: Request):
installation_id=request_dict["installation"]["id"],
user_token=None,
use_faster_model=chat_logger.use_faster_model(),
username=commit_author,
chat_logger=chat_logger,
username=commit_author if chat_logger else 'unknown',
chat_logger=chat_logger if chat_logger else ChatLogger(),
)
case "pull_request", "opened":
logger.info(f"Received event: {event}, {action}")
Expand Down
2 changes: 1 addition & 1 deletion sweepai/handlers/on_button_click.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ def handle_rules(request_dict, rules, user_token, repo: Repository, gh_client):
tracking_id = hashlib.sha256(str(time.time()).encode()).hexdigest()[:10]
if changes_required:
new_pr = stack_pr(
request=issue_description
issue_description
+ "\n\nThis issue was created to address the following rule:\n"
+ rule,
pr_number=request_dict["issue"]["number"],
Expand Down
Loading