Allow search operation in EnvironmentsFinder only for 3 or more characters
Having lesser number of characters in the environments search string operation affects performance of the database for larger projects and this was discussed in the earlier feature implementation MR.
Creating this issue to follow up the fix for it, as limiting it to 3 or more characters in finder will be a breaking change on the public api.
I implemented the limit, but did so on the controller level(see the last commit).
I did it on the controller level because:
- the problem with these
count(*)
is very specific to this controller- I'm afraid of breaking things if we change the API. I think it would require longer validation period for the feature flag including at least 1 release to validate it on self-managed.
- It feels like a breaking change, so ideally I would do in on the major release.
Implementation Proposal
- Have a FF scoped by project
- When the FF is set, allow search operation only for term of length >= 3 characters. For less then 3 characters, the validation and status code returned can follow the same one that is used for limiting note/comment body in GitLab.
- The FF will be enabled on
gitlab.com
following a gradual percentage based rollout monitoring errors. - For On-Premise since it can be a breaking change on the api , default enable of FF should be done in %16.0. After completion of step 3, create a follow up issue for default enabling FF in 16.0 and close the current issue.
Edited by Bala Kumar