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

Better tracking when candidates for PR assignment are filtered out #1895

Merged

Conversation

apiraino
Copy link
Contributor

@apiraino apiraino commented Jan 29, 2025

This PR contains:

  • adds more logging when no candidates for a PR assignment are found
  • split and logs the exact reason why a user was filtered out from a list of possible candidates

Besides these changes, nothing in the PR assignment changes. Overall, this should help us getting more insights from the logs. I've tried splitting the changes in commits to make the review easier.

Thanks!

r? @Kobzol or @jackh726

@@ -508,7 +510,10 @@ pub(super) async fn handle_command(
{
// This is a comment, so there must already be a reviewer assigned. No need to assign anyone else.
issue
.post_comment(&ctx.github, &on_vacation_msg(&username))
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the deletion of on_vacation_msg is in 82c549a (sorry)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I find the functions better than the consts, because with the function you cannot forget to pass the required placeholders, with the static string you can easily just use it without replacing the placeholder.

// return Err(FindReviewerError::AllReviewersFiltered {
// initial: names.to_vec(),
// filtered: names.to_vec(),
// });
}

log::info!("Filtered list of candidates: {:?}", filtered_candidates);
log::info!(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should really migrate to tracing and use spans to get have proper log context :)

@@ -508,7 +510,10 @@ pub(super) async fn handle_command(
{
// This is a comment, so there must already be a reviewer assigned. No need to assign anyone else.
issue
.post_comment(&ctx.github, &on_vacation_msg(&username))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I find the functions better than the consts, because with the function you cannot forget to pass the required placeholders, with the static string you can easily just use it without replacing the placeholder.

Copy link
Contributor

@Kobzol Kobzol left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR should hopefully only improve logging, so let's ship it.

@Kobzol Kobzol merged commit fedb383 into rust-lang:master Jan 30, 2025
2 checks passed
@apiraino apiraino deleted the track-reasons-filtered-out-candidates branch January 30, 2025 21:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants