Allow negating terms in IssuableFinder
What does this MR do?
Adds a not
param to the Issues API endpoint that allows users to negate searches using all the currently-available params (milestone, labels, etc). In order to allow this we add a not
param to IssuableFinder
that can be used in order to negate things. This allows for multiple NOTs, but is a bit dirty in its implementation. Follow-up issue for refactor: gitlab-foss#33356 (moved)
While currently there's ONLY support for Issues API, this will soon also support API endpoints for MergeRequests (gitlab-foss#66352 (moved) ) and Epics (#13680 ).
We'll also soon add frontend support, but since the functionality was added to `IssuableFinder` directly, manually writing the params will work (update: doesn't work anymore as strong params will filter them out).
For example going to http://localhost:3000/gitlab-org/gitlab-test/issues?scope=all&utf8=%E2%9C%93&state=opened¬[label_name][]=a
will show all issues without the label a
http://localhost:3000/gitlab-org/gitlab-test/issues?scope=all&utf8=%E2%9C%93&state=opened¬[author_username]=user0
will show all issues for which user0
is not the author
Does this MR meet the acceptance criteria?
Conformity
-
Changelog entry for user-facing changes, or community contribution. Check the link for other scenarios. -
Documentation created/updated or follow-up review issue created -
Code review guidelines -
Merge request performance guidelines -
Style guides -
Database guides -
Separation of EE specific content
Performance 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
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
Refs gitlab-foss#64213 (moved) and #18059 (closed)