-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Expose maximum assignee limit #10554
Conversation
Welcome @kanishkarj! It looks like this is your first PR to kubernetes/test-infra 🎉🎉 |
Thanks for your pull request. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please follow instructions at https://git.k8s.io/community/CLA.md#the-contributor-license-agreement to sign the CLA. It may take a couple minutes for the CLA signature to be fully registered; after that, please reply here with a new comment and we'll verify. Thanks.
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
Hi @kanishkarj. Thanks for your PR. I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
Signed. |
Welcome. 🎉 I think the issue is that Github API silently fails and doesn't return an error when attempting to assign more than 10 people to the issue/PR, so we can't tell if the failure was because the user is not an org member or becuase we exceeded the limit. We should add some explanation to the current error message instead of replacing it as it's still valid. |
prow/plugins/assign/assign.go
Outdated
addFailureResponse := func(mu github.MissingUsers) string { | ||
return fmt.Sprintf("GitHub didn't allow me to assign the following users: %s.\n\nNote that only [%s members](https://github.com/orgs/%s/people) and repo collaborators can be assigned. \nFor more information please see [the contributor guide](https://git.k8s.io/community/contributors/guide/#issue-assignment-in-github)", strings.Join(mu.Users, ", "), org, org) | ||
return "Note that only a maximum of 10 members and repo collaborators can be assigned" |
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'd suggest the following:
return fmt.Sprintf("GitHub didn't allow me to assign the following users: %s.\n\nNote that only [%s members](https://github.com/orgs/%s/people) and repo collaborators can be assigned and that issues/PRs can only have 10 assignees at the same time.\nFor more information please see [the contributor guide](https://git.k8s.io/community/contributors/guide/#issue-assignment-in-github)", strings.Join(mu.Users, ", "), org, org)
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.
Okay, I shall put that up.
@ibrasho yes I do agree with it. But I am not able to understand why it is failing, so I don't know any other alternative. Any suggestions on how to go about it? |
@ibrasho I have made another commit, check it out! |
@kanishkarj Added a comment here: #10391 (comment). |
@kanishkarj Can you also update the PR title to be more descriptive of the change? Something like So that it's easier for people to understand at a first glance what the PR does. :) |
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.
Nice!
prow/plugins/assign/assign_test.go
Outdated
assigned: []string{"user1", "user2", "user3", "user4", "user5", "user6", "user7", "user8", "user9", "user10", "user11"}, | ||
}, | ||
{ | ||
name: "assign >10 users", |
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.
This name seems incorrect
@@ -188,7 +188,7 @@ type handler struct { | |||
func newAssignHandler(e github.GenericCommentEvent, gc githubClient, log *logrus.Entry) *handler { | |||
org := e.Repo.Owner.Login | |||
addFailureResponse := func(mu github.MissingUsers) string { | |||
return fmt.Sprintf("GitHub didn't allow me to assign the following users: %s.\n\nNote that only [%s members](https://github.com/orgs/%s/people) and repo collaborators can be assigned. \nFor more information please see [the contributor guide](https://git.k8s.io/community/contributors/guide/#issue-assignment-in-github)", strings.Join(mu.Users, ", "), org, org) | |||
return fmt.Sprintf("GitHub didn't allow me to assign the following users: %s.\n\nNote that only [%s members](https://github.com/orgs/%s/people) and repo collaborators can be assigned and that issues/PRs can only have 10 assignees at the same time.\nFor more information please see [the contributor guide](https://git.k8s.io/community/contributors/guide/#issue-assignment-in-github)", strings.Join(mu.Users, ", "), org, org) |
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.
Maybe
Note that only ten or fewer [%s members...
?
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.
(this is a nit-pick)
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.
Can't we also detect the >10 case here and make the error message specific to the error that happened?
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.
Assigning 11+ people at the same time seems like an edge case. How do you feel about only mentioning this fact if a) more than 10 people were attempted to be assigned and b) github returns an error?
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.
Actually given @ibrasho comments above that isn't going to work.
/ok-to-test |
I have updated the tests, go through them, please. |
It can be merged right? |
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 adding tests
/lgtm
LGTM label has been added. Git tree hash: d6cc338b297b24944a22d75a78190a67d0549351
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: fejta, kanishkarj The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
@kanishkarj FYI we generally avoid merge commits in PR branches to make the git history easier to understand. |
Fix to the issue #10391.