Commit 99544822 authored by Sean McGivern's avatar Sean McGivern

Merge branch...

Merge branch '25250-can-t-use-quick-action-to-set-milestone-when-the-project-only-has-milestones-from-parent-group' into 'master'

Fix milestone quick action for ancestor group milestones

See merge request gitlab-org/gitlab!22231
parents a5bbf487 019c882b
......@@ -84,7 +84,9 @@ module QuickActions
# rubocop: enable CodeReuse/ActiveRecord
def find_milestones(project, params = {})
MilestonesFinder.new(params.merge(project_ids: [project.id], group_ids: [project.group&.id])).execute
group_ids = project.group.self_and_ancestors.select(:id) if project.group
MilestonesFinder.new(params.merge(project_ids: [project.id], group_ids: group_ids)).execute
end
def parent
......
---
title: Fix milestone quick action to handle ancestor group milestones
merge_request: 22231
author:
type: fixed
......@@ -856,9 +856,10 @@ describe QuickActions::InterpretService do
end
context 'only group milestones available' do
let(:group) { create(:group) }
let(:ancestor_group) { create(:group) }
let(:group) { create(:group, parent: ancestor_group) }
let(:project) { create(:project, :public, namespace: group) }
let(:milestone) { create(:milestone, group: group, title: '10.0') }
let(:milestone) { create(:milestone, group: ancestor_group, title: '10.0') }
it_behaves_like 'milestone command' do
let(:content) { "/milestone %#{milestone.title}" }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment