Move all FF for archived search to user actors
What does this MR do and why?
Noticed during roll out of search_projects_hide_archived
in #413821 (closed)
The backend feature flags are not gated to an actor. The frontend code (for projects) and eventually for the other flagged scopes sends a user actor.
This MR:
- updates the flag check on the backend to add a
current_user
actor - fixes rubocop todos for
lib/gitlab/search_results.rb
(1 todo was not fixable easily so I left it)
Screenshots or screen recordings
N/A
How to set up and validate locally
FF_NAME | SCOPE | TAB | BASIC GROUP SEARCH? |
---|---|---|---|
:search_commits_hide_archived_projects |
commits | Commits | |
:search_merge_requests_hide_archived_projects |
merge_requests | Merge Requests | |
:search_notes_hide_archived_projects |
notes | Comments | |
:search_projects_hide_archived |
projects | Projects |
For each Feature Flag, verify using the steps below.
- Archive one project in a group (or use an existing archived project)
- Enable elasticsearch in gdk (if not already enabled)
- index everything using
gitlab:elastic:index
rake task - enable search with advanced search
- index everything using
- Find a value to search for in the scope
- In rails console fully disable then enable
FF_NAME
for one userFeature.disable(:FF_NAME) Feature.enable(:FF_NAME, User.first)
- Search for SCOPE in that group example: http://gdk.test:3000/search?scope=SCOPE&search=aut&group_id=46
- Verify results are not returned from the archived project
- Search for SCOPE in that group, but first add
&include_archived=true
onto the end of the URL example: http://gdk.test:3000/search?scope=SCOPE&search=aut&group_id=46&include_archived=true - Verify results are returned from the archived project
- Repeat the steps above for Basic Search if supported. To force basic search add
&basic_search=true
to the URL or disable Search with Advanced Search from the Admin Settings
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Edited by Terri Chu