Ignore not search params which are not hashes

What does this MR do and why?

Found through errors in staging: https://nonprod-log.gitlab.net/app/r/s/P2hLV

undefined method `each' for "aHR0cDovL2EuZG5zLmFzZHRhZXRhLnh5ei8nIjxibXQ+":String
backtrace
[lib/gitlab/search/params.rb:106:in `convert_not_params', lib/gitlab/search/params.rb:99:in `process_params', lib/gitlab/search/params.rb:21:in `initialize', app/services/search_service.rb:14:in `new', app/services/search_service.rb:14:in `initialize', app/helpers/search_helper.rb:164:in `new', app/helpers/search_helper.rb:164:in `search_service', app/controllers/search_controller.rb:233:in `append_info_to_payload', actionpack (7.0.8.4) lib/action_controller/metal/instrumentation.rb:75:in `ensure in block in process_action', actionpack (7.0.8.4) lib/action_controller/metal/instrumentation.rb:75:in `block in process_action', 

This MR fixes a bug when the not param is sent to search controller as a text string instead of a hash. Now the param will be ignored.

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

N/A

How to set up and validate locally

  1. run a search with a not=test param on master branch and this branch

http://gdk.test:3000/search?repository_ref=main&scope=merge_requests&search=test&not=test

error on master branch

image

Edited by Terri Chu

Merge request reports

Loading