-
Notifications
You must be signed in to change notification settings - Fork 86
Pick reviewer who is not previous assignee when r? group #1958
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
Conversation
Thanks for the PR! I think that we should first discuss the design though. I'm not sure if rerolling based on the diff is the most intuitive solution in all cases. If someone did I opened a topic about this on Zulip: https://rust-lang.zulipchat.com/#narrow/channel/224082-triagebot/topic/.40rustbot.20reroll/with/514122139. |
I modified the logic: I'll comment my changes in the code. |
Can you please update the description with a detailed explanation of what is changing. From the title it is not clear to me what this is doing. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now that I think about it, remembering the previous requested name (r? name
) would be required for rustbot reroll
, but it shouldn't be required at all when we are just modifying the request logic to skip the existing reviewer.
In other words, you can get the current assignee directly from the issue
passed to the handler. Then we should modify the assignment logic to ignore the previous assignee if a team (not a specific user) was requested.
As discussed in #triagebot > @rustbot reroll @ 💬, I optimized the logic for However. the use of |
|
Hmm, I was thinking that we only ignore the current reviewer, not all previously assigned reviewers 🤔 I'll ask others on Zulip. |
OK, can the description be updated to include that? Or, if the design hasn't been concluded, can this be marked as a draft until it is ready? Also, this doesn't seem like it would close #1762, would it? That seems like a different thing of the ability to say "I want triagebot to pick someone else". |
FWIW, we have been discussing this in https://rust-lang.zulipchat.com/#narrow/channel/224082-triagebot/topic/.40rustbot.20reroll/with/514415765, and me and Jieyou Xu thought that having an explicit reroll command might not be needed if we make this change to the assignment logic. |
Failed to set assignee to
|
1 similar comment
Failed to set assignee to
|
Failed to set assignee to
|
Failed to set assignee to
|
cbbb5af
to
b0574b6
Compare
bb063a7
to
5692b37
Compare
I rebase this PR to the newest version of master branch that is compatible with the latest |
Hi, just wanted to note that I'll be at https://rustweek.org/, so I might not be able to take a look at this for a few days, but it's at the top of my TODO list :) |
It looks great. Have fun! I don't think the demand for this pr is so urgent. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, thank you. Could you please also add some tests? You could add a method to AssignCtx
that will store a set of previously assigned names into the DB, and then check that these names will be ignored when expanded from a group/team, and will not be ignored when requested directly.
write!( | ||
f, | ||
"{}", | ||
REVIEWER_ASSIGNED_BEFORE.replace("{username}", username) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
REVIEWER_ASSIGNED_BEFORE
doesn't seem to contain {username}
? It shouldn't need any replacement.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For more information, I add {username}
in REVIEWER_ASSIGNED_BEFORE
, but it does not seem to matter because REVIEWER_ASSIGNED_BEFORE
will never show in comments, instead it could only return FindReviewerError::NoReviewer
in candidate_reviewers_from_names
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I meant that we don't need to fill the username in this error message, as you said, it won't be shown in the comments.
Thanks for your time! No problem, I'll apply the above suggestions in the last few days when I'm free. |
This commit optimized the logic for `r? group`. Each time an assignee is set, it is stored in the database, and when we use an r? group, such as `r? compiler`, it will take out the previously assigned reviewers from the database to avoid to assign a previous assignee. Signed-off-by: xizheyin <[email protected]>
e5f03bd
to
4a4ba37
Compare
Signed-off-by: xizheyin <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I add three tests:
r? team
, while there exists people who have not previous assigned inteam
r? compiler
, however, all the people inteam
have been previously assigned.r? @user
, regardless of whetheruser
has been assigned or not.
write!( | ||
f, | ||
"{}", | ||
REVIEWER_ASSIGNED_BEFORE.replace("{username}", username) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For more information, I add {username}
in REVIEWER_ASSIGNED_BEFORE
, but it does not seem to matter because REVIEWER_ASSIGNED_BEFORE
will never show in comments, instead it could only return FindReviewerError::NoReviewer
in candidate_reviewers_from_names
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the tests! Left some more comments.
Signed-off-by: xizheyin <[email protected]>
For ease of review, I added the changes to a new commit and it passed CI. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you! Let's see how does this work in practice.
Closes #1762
This PR implements similar functionality to the reroll, and based on the discussion #triagebot > @rustbot reroll on zulip, it is not necessary for us to implement a separate reroll.
I optimized the logic for
r? group
. Each time an assignee is set, it is stored in the database, and when we use anr? group
, such asr? compiler
, I will take out the previously assigned reviewer from the database to avoid to assign a previous assignee.However. the use of
r? @reviewer
to specify a specific assignee does not exclude the previous assignee, as this is explicitly specified.