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

Assign PR assignment based on work queue #1786

Merged
merged 3 commits into from
Apr 16, 2024

Conversation

apiraino
Copy link
Contributor

@apiraino apiraino commented Apr 3, 2024

This implements the new way of assigning pull requests reviews (designed in #1753). When this PR is merged, PRs in rust-lang/rust will be assigned based on user preferences. These can be queried from Zulip (see docs).

If no preferences are set, PRs will be just assigned (like always).

There are multiple points where PRs are assigned (via comment or using the GH UI), I've tried to cover all cases, took some time to test them all. The amount of changes reflect that it is not so easy to catch all spots where this happens. I wish I could make a smaller patch but I think this is an all-or-nothing situation where all cases should be handled at once.

Also modified the zulip triagebot command work show to return the # work queue capacity set by the user. This is helpful in case a PR assignment is rejected. A PR to update the documentation will follow-up after merge of this.

If a PR assignment is rejected we will return a message with some context. Examples:

Failed PR assignment to a user:
screenshot-20240403-104629

Failed self-assignment:
screenshot-20240403-104717

r? @jackh726

This check is specifically used when assigning from the Github web UI
Copy link
Member

@jackh726 jackh726 left a comment

Choose a reason for hiding this comment

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

A couple small comments - looks good though. Importantly, this doesn't yet enable people to change their max PRs, which is good. In theory, nothing should change.

src/handlers/assign.rs Outdated Show resolved Hide resolved
src/handlers/assign.rs Outdated Show resolved Hide resolved
src/lib.rs Outdated Show resolved Hide resolved
@apiraino apiraino force-pushed the assign-prs-based-on-work-queue branch from bd923e9 to a8b49b1 Compare April 15, 2024 15:01
@apiraino
Copy link
Contributor Author

@jackh726 I've applied your suggestions, thanks! As discussed, let's leave this here for a moment until we first merge a patch allowing people to set their own workload. Going to prepare it in short.

@apiraino
Copy link
Contributor Author

#1790 is up for review

@jackh726
Copy link
Member

I think you may have misunderstood. I would like to merge this before we enable allowing people to change their setting.

src/handlers/assign.rs Outdated Show resolved Hide resolved
Add checks in multiple points when identifying or finding an assignee.

Filter out team members currently not having capacity, return messages
instructing what to do in case the assignment is rejected.
@apiraino apiraino force-pushed the assign-prs-based-on-work-queue branch from a8b49b1 to 8030301 Compare April 16, 2024 09:54
@apiraino
Copy link
Contributor Author

I think you may have misunderstood. I would like to merge this before we enable allowing people to change their setting.

Yes, I got it the other way around, sorry. Anyway, this patch looks green. If you don't have other suggestions we can move on 👍

@jackh726 jackh726 merged commit 19e3c28 into rust-lang:master Apr 16, 2024
2 checks passed
@apiraino apiraino deleted the assign-prs-based-on-work-queue branch April 16, 2024 12:31
apiraino added a commit to apiraino/triagebot that referenced this pull request Apr 16, 2024
This is a version of rust-lang#1786 that fixes the two following bugs:

There were 2 bugs:

1. the initial migration wasn't formatted correctly and the new schema changes weren't applied

2. The SELECT to find a reviewer would return wrong results when a team member had NULL in the table `review_prefs.max_assigned_prs`
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