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

Rework messages and improve logging #132

Merged
merged 1 commit into from
Dec 28, 2024
Merged
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
12 changes: 7 additions & 5 deletions nixpkgs_merge_bot/commands/merge.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def process_pull_request_status(
check_run_result.failed = True
message = f"Check suite {check_run['app']['name']} is {check_run['conclusion']}"
check_run_result.messages.append(message)
log.info(f"{pull_request.number}: message")
log.info(f"{pull_request.number}: {message}")
return check_run_result


Expand Down Expand Up @@ -116,7 +116,7 @@ def merge_command(issue_comment: IssueComment, settings: Settings) -> HttpRespon
pull_request.head_sha,
f"{str(issue_comment.issue_number)};{issue_comment.commenter_id};{issue_comment.commenter_login};{issue_comment.comment_id}",
)
msg = "One or more checks are still pending, please retry after they are done. darwin checks can be ignored."
msg = "One or more checks are still pending, I will retry this after they complete. Darwin checks can be ignored."
log.info(f"{issue_comment.issue_number}: {msg}")
client.create_issue_comment(
issue_comment.repo_owner,
Expand All @@ -134,12 +134,14 @@ def merge_command(issue_comment: IssueComment, settings: Settings) -> HttpRespon
issue_comment.issue_number,
pull_request.head_sha,
)
log.info(f"{issue_comment.issue_number }: Merge completed (#306934)")
log.info(
f"{issue_comment.issue_number }: Merge completed (#306934)"
) # Link Issue to track merges
client.create_issue_comment(
issue_comment.repo_owner,
issue_comment.repo_name,
issue_comment.issue_number,
"Merge completed (#306934)",
"Merge completed (#306934)", # Link Issue to track merges
)
return issue_response("merged")
except GithubClientError as e:
Expand Down Expand Up @@ -194,7 +196,7 @@ def merge_command(issue_comment: IssueComment, settings: Settings) -> HttpRespon
log.info(
f"{issue_comment.issue_number}: No merge stratgey passed, we let the user know"
)
msg = f"@{issue_comment.commenter_login} merge not permitted (#305350): \n"
msg = f"@{issue_comment.commenter_login} merge not permitted (#305350): \n" # Link Issue to track failed merges
for reason in decline_reasons:
msg += f"{reason}\n"

Expand Down
2 changes: 1 addition & 1 deletion nixpkgs_merge_bot/github/Issue.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
class IssueComment:
commenter_id: int
commenter_login: str
text: str
text: str | None
action: str
comment_id: int
comment_type: str
Expand Down
4 changes: 2 additions & 2 deletions nixpkgs_merge_bot/merging_strategies/maintainer_update.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def run(
allowed_users = ["r-ryantm"]
if pull_request.user_login not in allowed_users:
result = False
message = f"pr author is not in restricted authors list, in the list are: {','.join(allowed_users)}"
message = "pr author is not r-ryantm"
decline_reasons.append(message)
log.info(f"{pull_request.number}: {message}")
else:
Expand All @@ -39,7 +39,7 @@ def run(
if not is_maintainer(commenter_id, maintainers):
result = False
message = (
f"github id: {commenter_id} is not in maintainers, valid maintainers are: "
f"github id: {commenter_id} is not a package maintainer, valid maintainers are: "
+ ", ".join(m.name for m in maintainers)
)
decline_reasons.append(message)
Expand Down