Add search column to application settings
What does this MR do and why?
Add a new column search
of the type jsonb
in the application_settings
table. This jsonb
column can have six attributes (listed below) in ee and three (global_search_merge_requests_enabled and global_search_users_enabled global_search_work_items_enabled) in CE.
- global_search_code_enabled
- global_search_commits_enabled
- global_search_merge_requests_enabled
- global_search_wiki_enabled
- global_search_users_enabled
- global_search_snippet_titles_enabled
- global_search_work_items_enabled
This column can be used to show the settings in the admin panel and eventually, few global search ops feature flags can be deprecated.
All three attributes have the default value of true
. In the follow-up MRs the backfilling of this column will happen.
References
Please include cross links to any resources that are relevant to this MR. This will give reviewers and future readers helpful context to give an efficient review of the changes introduced.
- Documentation Link related to adding application settings: https://docs.gitlab.com/ee/development/application_settings.html
MR acceptance checklist
Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
Screenshots or screen recordings
Screenshots are required for UI changes, and strongly recommended for all other merge requests.
Before | After |
---|---|
How to set up and validate locally
Numbered steps to set up and validate the change are strongly suggested.
- Check out the branch and run the DB migrations using
bin/rails db:migrate
- Open the rails console
bin/rails c
- Check the existing
ApplicationSetting
record. The value ofsearch
should be{}
ApplicationSetting.last.search
- Check the new
ApplicationSetting
record. The value ofsearch
should be{"global_search_code_enabled"=>true, "global_search_commits_enabled"=>true, "global_search_merge_requests_enabled"=>true, "global_search_wiki_enabled"=>true, "global_search_users_enabled"=>true, "global_search_snippet_titles_enabled"=>true}
ApplicationSetting.new.search
Related to #511347 (closed)