diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-11-17 14:33:21 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-11-17 14:33:21 +0300 |
commit | 7021455bd1ed7b125c55eb1b33c5a01f2bc55ee0 (patch) | |
tree | 5bdc2229f5198d516781f8d24eace62fc7e589e9 /app/controllers/search_controller.rb | |
parent | 185b095e93520f96e9cfc31d9c3e69b498cdab7c (diff) |
Add latest changes from gitlab-org/gitlab@15-6-stable-eev15.6.0-rc42
Diffstat (limited to 'app/controllers/search_controller.rb')
-rw-r--r-- | app/controllers/search_controller.rb | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/app/controllers/search_controller.rb b/app/controllers/search_controller.rb index 7d4dd04c6d4..5351e3e9e77 100644 --- a/app/controllers/search_controller.rb +++ b/app/controllers/search_controller.rb @@ -9,7 +9,11 @@ class SearchController < ApplicationController RESCUE_FROM_TIMEOUT_ACTIONS = [:count, :show, :autocomplete, :aggregations].freeze - track_event :show, name: 'i_search_total', destinations: [:redis_hll, :snowplow] + track_custom_event :show, + name: 'i_search_total', + label: 'redis_hll_counters.search.search_total_unique_counts_monthly', + action: 'executed', + destinations: [:redis_hll, :snowplow] def self.search_rate_limited_endpoints %i[show count autocomplete] @@ -108,7 +112,7 @@ class SearchController < ApplicationController @ref = params[:project_ref] if params[:project_ref].present? @filter = params[:filter] - render json: search_autocomplete_opts(term, filter: @filter).to_json + render json: Gitlab::Json.dump(search_autocomplete_opts(term, filter: @filter)) end def opensearch @@ -140,8 +144,7 @@ class SearchController < ApplicationController def check_single_commit_result? return false if params[:force_search_results] return false unless @project.present? - # download_code project policy grants user the read_commit ability - return false unless Ability.allowed?(current_user, :download_code, @project) + return false unless Ability.allowed?(current_user, :read_code, @project) query = params[:search].strip.downcase return false unless Commit.valid_hash?(query) @@ -243,6 +246,10 @@ class SearchController < ApplicationController search_service.project&.namespace || search_service.group end + def tracking_project_source + search_service.project + end + def search_type 'basic' end |