Skip to content

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 to labels
  • 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 to false 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 this IssuableBaseService#filter_params decides on an issuable_subject depending on the state of the issuable. I'm not sure if this is the right approach.

Screenshots (if relevant)

public_labels public_assignable_from_sidebar public_assignable_with_radio_buttons

Does this MR meet the acceptance criteria?

What are the relevant issue numbers?

Closes #19397 (moved)

Merge request reports