Resolve "Allow some labels to be settable by anyone"
What does this MR do?
It allows certain labels to be marked as public_assignable
, allowing users who can create issues and merge requests to assign these open-to-public labels.
This is a work in progress. TODO list:
-
Add public_assignable
tolabels
-
Expose public labels to non-admin issue / merge-request creators -
Prevent non-admin authors from editing / removing admin-assigned non-public labels -
Update labels interface to expose the new public_assignable
boolean (a simple checkbox is available) -
Slash commands should function the same way -
Add more specs / update existing specs related to this feature -
Slash command's label suggestions should list only public labels when appropriate -
Move @assignable_labels
(and more?) into the controller -
Extract components of Issuable form into partials -
Account for labels being altered on Issuable sidebar -
Simplify logic involved in determining whether user can assign labels -
RSpec: Ensure public label is actually the one being displayed to user -
Improve form element used to mark labels as public assignable -
Set public_assignable
tofalse
by default
Are there points in the code the reviewer needs to double check?
- Variables used
issuable/_form.html.haml
are things I'd normally place in a decorator / presenter. However, that pattern isn't applicable here - should these go into the controller? - It turns out that a merge request creator does not have
create_merge_request
permission on a target project, and instead has it on the source project. To account for thisIssuableBaseService#filter_params
decides on anissuable_subject
depending on the state of the issuable. I'm not sure if this is the right approach.
Screenshots (if relevant)
public_assignable_from_sidebar
Does this MR meet the acceptance criteria?
-
CHANGELOG entry added -
Documentation created/updated -
API support added - Tests
-
Added for this feature/bug -
All builds are passing
-
-
Conform by the merge request performance guides -
Conform by the style guides -
Branch has no merge conflicts with master
(if you do - rebase it please) -
Squashed related commits together
What are the relevant issue numbers?
Closes #19397 (moved)