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

Expose maximum assignee limit #10554

Merged
merged 5 commits into from
Jan 7, 2019
Merged

Conversation

kanishkarj
Copy link
Contributor

Fix to the issue #10391.

@k8s-ci-robot
Copy link
Contributor

Welcome @kanishkarj! It looks like this is your first PR to kubernetes/test-infra 🎉🎉

@k8s-ci-robot
Copy link
Contributor

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.

@k8s-ci-robot k8s-ci-robot added the cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. label Dec 25, 2018
@k8s-ci-robot
Copy link
Contributor

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 /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

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.

@k8s-ci-robot k8s-ci-robot added needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Dec 25, 2018
@k8s-ci-robot k8s-ci-robot added the area/prow Issues or PRs related to prow label Dec 25, 2018
@kanishkarj
Copy link
Contributor Author

Signed.

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. and removed cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. labels Dec 25, 2018
@ibrasho
Copy link
Contributor

ibrasho commented Dec 26, 2018

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.

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"
Copy link
Contributor

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)

Copy link
Contributor Author

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.

@kanishkarj
Copy link
Contributor Author

@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?

@kanishkarj
Copy link
Contributor Author

@ibrasho I have made another commit, check it out!

@nikhita
Copy link
Member

nikhita commented Dec 26, 2018

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?

@kanishkarj Added a comment here: #10391 (comment).

@nikhita
Copy link
Member

nikhita commented Dec 26, 2018

@kanishkarj Can you also update the PR title to be more descriptive of the change? Something like prow/assign: update error for more than 10 assignees.

So that it's easier for people to understand at a first glance what the PR does. :)

Copy link
Contributor

@stevekuznetsov stevekuznetsov left a comment

Choose a reason for hiding this comment

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

Nice!

assigned: []string{"user1", "user2", "user3", "user4", "user5", "user6", "user7", "user8", "user9", "user10", "user11"},
},
{
name: "assign >10 users",
Copy link
Contributor

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)
Copy link
Contributor

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...

?

Copy link
Contributor

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)

Copy link
Contributor

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?

Copy link
Contributor

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?

Copy link
Contributor

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.

@stevekuznetsov
Copy link
Contributor

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Dec 26, 2018
@stevekuznetsov stevekuznetsov changed the title Fix for Issue #10391 Expose maximum assignee limit Dec 26, 2018
@kanishkarj
Copy link
Contributor Author

I have updated the tests, go through them, please.

@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Dec 26, 2018
@kanishkarj
Copy link
Contributor Author

It can be merged right?

Copy link
Contributor

@fejta fejta left a 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

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jan 7, 2019
@k8s-ci-robot
Copy link
Contributor

LGTM label has been added.

Git tree hash: d6cc338b297b24944a22d75a78190a67d0549351

@k8s-ci-robot
Copy link
Contributor

[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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jan 7, 2019
@k8s-ci-robot k8s-ci-robot merged commit f7ba412 into kubernetes:master Jan 7, 2019
@cjwagner
Copy link
Member

cjwagner commented Jan 8, 2019

@kanishkarj FYI we generally avoid merge commits in PR branches to make the git history easier to understand.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. area/prow Issues or PRs related to prow cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants