Make searching issues/MRs by IID even easier/more discoverable
What does this MR do?
Prior to this change you were required to prepend your search with #
or
!
(like an Issue/MR link) to trigger the search by IID behaviour. This
changes things so that it's even simpler to search by IID. As long as
the input is just a number we'll ensure that the IID field is included
in search query. This also won't prevent you from searching for the
number as part of an issue title or description since we also query
those fields but we give higher weight to the IID so exact IID matches
should appear as the first result.
This should make the searching a bit more approachable/serendipitous since it should "just work".
This MR also includes some refactoring to improve the tests.
Specifically some of the tests for searching by IID were passing by
accident before. It also refactors them to use contain_exactly
since
this makes them more concise.
I opted not to add any docs for this change since the existing feature of searching by IID doesn't seem to be documented and in general it doesn't seem like there is actually a good place to document that you can search for a number that would actually add any value. If someone has a good suggestion of where to put the docs and how to present that in a useful way I'd happily add them.
Screenshots
Does this MR meet the acceptance criteria?
Conformity
-
Changelog entry - [-] Documentation (if required)
-
Code review guidelines -
Merge request performance guidelines -
Style guides -
Database guides -
Separation of EE specific content
Availability and Testing
-
Review and add/update tests for this feature/bug. Consider all test levels. See the Test Planning Process. -
Tested in all supported browsers -
Informed Infrastructure department of a default or new setting change, if applicable per definition of done
Security
If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:
-
Label as security and @ mention @gitlab-com/gl-security/appsec
-
The MR includes necessary changes to maintain consistency between UI, API, email, or other methods -
Security reports checked/validated by a reviewer from the AppSec team