Commit 73af9bed authored by Dylan Griffith's avatar Dylan Griffith

Merge branch '250317-basic-epics-search-rollout' into 'master'

Rollout of basic search for epics

See merge request gitlab-org/gitlab!44269
parents 95e43598 d9b20dbf
---
name: epics_search
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/42456
rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/250317
group: group::global search
type: development
default_enabled: false
\ No newline at end of file
...@@ -223,6 +223,7 @@ backed by the database and allows searching in: ...@@ -223,6 +223,7 @@ backed by the database and allows searching in:
- Merge requests - Merge requests
- Milestones - Milestones
- Users - Users
- Epics (Group only)
- Code (Project only) - Code (Project only)
- Comments (Project only) - Comments (Project only)
- Commits (Project only) - Commits (Project only)
......
...@@ -36,7 +36,7 @@ module EE ...@@ -36,7 +36,7 @@ module EE
override :allowed_scopes override :allowed_scopes
def allowed_scopes def allowed_scopes
return super unless ::Feature.enabled?(:epics_search) && group.feature_available?(:epics) return super unless group.feature_available?(:epics)
strong_memoize(:ee_group_allowed_scopes) do strong_memoize(:ee_group_allowed_scopes) do
super + %w(epics) super + %w(epics)
......
---
title: Add basic search for epics
merge_request: 44269
author:
type: added
...@@ -15,7 +15,6 @@ RSpec.describe 'User searches for epics', :js do ...@@ -15,7 +15,6 @@ RSpec.describe 'User searches for epics', :js do
end end
before do before do
stub_feature_flags(epics_search: true)
stub_licensed_features(epics: true) stub_licensed_features(epics: true)
group.add_maintainer(user) group.add_maintainer(user)
......
...@@ -235,27 +235,25 @@ RSpec.describe Search::GroupService, :elastic do ...@@ -235,27 +235,25 @@ RSpec.describe Search::GroupService, :elastic do
describe '#allowed_scopes' do describe '#allowed_scopes' do
context 'epics scope' do context 'epics scope' do
where(:feature_enabled, :epics_available, :epics_allowed) do let(:allowed_scopes) { described_class.new(user, group, {}).allowed_scopes }
false | false | false
true | false | false before do
false | true | false stub_licensed_features(epics: epics_available)
true | true | true
end end
with_them do context 'epics available' do
let(:allowed_scopes) { described_class.new(user, group, {}).allowed_scopes } let(:epics_available) { true }
before do it 'does include epics to allowed_scopes' do
stub_feature_flags(epics_search: feature_enabled) expect(allowed_scopes).to include('epics')
stub_licensed_features(epics: epics_available)
end end
end
it 'sets correct allowed_scopes' do context 'epics is no available' do
if epics_allowed let(:epics_available) { false }
expect(allowed_scopes).to include('epics')
else it 'does not include epics to allowed_scopes' do
expect(allowed_scopes).not_to include('epics') expect(allowed_scopes).not_to include('epics')
end
end end
end end
end end
......
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