- 
                Notifications
    You must be signed in to change notification settings 
- Fork 158
plugin/label: Improve error when adding/removing a restricted label #469
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
base: main
Are you sure you want to change the base?
Conversation
| [APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: stephenfin The full list of commands accepted by this bot can be found here. 
Needs approval from an approver in each of these files:
 Approvers can indicate their approval by writing  | 
| ✅ Deploy Preview for k8s-prow ready!
 To edit notification comments on pull requests, go to your Netlify project configuration. | 
| /test pull-prow-integration That...doesn't look related... | 
| /retest-required 
 
 | 
| I see no reason why the message can't display the allowed teams and (a subset of) the allowed users as well. You can format a GH message so that it hides content by default to be expanded, maybe if the list is longer than 5 or so you can put an ellipsis, and hide the rest behind it. I am not sure that I would bother with returning random users. In situations where there are 20+ users, maybe just return the first 20... WDYT? | 
| 
 If you're happy, I'm happy. I'll bump the limit to 20 now. | 
d77cd16    to
    e22fd79      
    Compare
  
    | The Kubernetes project currently lacks enough contributors to adequately respond to all PRs. This bot triages PRs according to the following rules: 
 You can: 
 Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle stale | 
| /remove-lifecycle stale | 
Signed-off-by: Stephen Finucane <[email protected]>
It's confusing. We also unify the error message with other similar errors messages and modify existing tests to validate the actual string. Signed-off-by: Stephen Finucane <[email protected]>
Provide a breadcrumb to users if they are unable to assign a label *and* there are no allowed_teams configured. Signed-off-by: Stephen Finucane <[email protected]>
e22fd79    to
    c4d5b43      
    Compare
  
    | /cc | 
Currently, if you attempt to add a restricted label and
allowed_teamsis unset/empty, you get the following unhelpful message.Improve this so that we no longer suggest being a member of no team and instead suggest reaching out to one of the users in
allowed_usersinstead:We also improve the common path where
allowed_teamsis populated, aligning the error message with those of other errors paths:Note
I suspect dumping a list of users could get "chatty", so I've intentionally avoided formatting these as links (i.e. we emit
user, not@user)and only print up to 3 users. In most cases, this code should not be triggered since projects will usually make use ofEDIT: I've now bumped this to 20, per feedback, which should allow us to dump all but the largest list of users.allowed_teams.Note
I'm still not entirely happy with this either. For example, see here. That error messages suggests only a member of
openshift-staff-engineerscan set the label, when in reality there are many users that can set it. Perhaps we should reword this as either-or ("you must be a member of these groups: xyz. Alternatively, consider assigning one of these members: abc"). Open to idea here.