Skip to content
Snippets Groups Projects

Trim whitespace from milestone title

Resolves Issue #3428 (closed)

Merge request reports

Pipeline #260534 failed

Pipeline failed on szechyjs:feature/chomp_milestone_title

Closed by avatar (Apr 24, 2025 1:52am UTC)

Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
107 107 end
108 108
109 109 def milestone_params
110 params.require(:milestone).permit(:title, :description, :due_date, :state_event)
110 permitted = params.require(:milestone).permit(:title, :description, :due_date, :state_event)
111 params[:milestone][:title].strip! if params[:milestone][:title]
112 permitted
111 113 end
  • Ideally this would happen in a before_save callback on the MergeRequest itself, so that it's applied for MRs created using the API as well. Would you mind implementing it like that? By the way, if you add it on Issuable, it will apply to Issue titles as well ;)

  • Hi @DouweM , @szechyjs . Do you mind if i take over this one?

    @DouweM i think this could go inside Milestones::CreateService or Milestones::BaseService so it applies to update action too.

  • @jcorcuera Go for it. I think it makes more sense on the model itself, for what it's worth.

  • @jcorcuera i don't mind at all, i've been rather busy. thanks!

  • username-removed-2900 Status changed to closed

    Status changed to closed

  • Please register or sign in to reply
    Loading