-
- Downloads
Add a `/disabled_filters` route to the dependencies controllers
Context ------------------------- We have some filters that we disable when certain conditions are met, for example if a group has too many vulnerabilities. Currently, if you try filtering with a disabled filter, you will get a "too many vulnerabilities" error response. We would like to give a tool-tip in the UI to explain the filter is disabled ahead of any error response. We have done that for a few filters by injecting booleans into the page on load. As we continue adding filters that need to be disabled in certain circumstances, we are looking for a way frontend could reliably know what filters are disabled for a given `vulnerable`. We achieve this via a graphql extension. Future work ------------------------- rather than calculating these disabled filters every time, we could have frontend request specific "filter hints" and only build the array if requested This change ------------------------- 1. Adds a `disabled_filters` array to the graphql response if the vulnerability resolver is invoked - behind a de-risk FF 2. DRYs up the code that disables the identifier search epic: &13340 related to: #517915 resolves: #517925 MR: !180973 Changelog: changed EE: truewe have some filters that we disable when certain conditions are met, for example if a group has too many vulnerabilities.
Showing
- ee/app/controllers/concerns/security/group_identifier_search.rb 26 additions, 0 deletions.../controllers/concerns/security/group_identifier_search.rb
- ee/app/graphql/resolvers/vulnerabilities/identifier_search_resolver.rb 4 additions, 8 deletions...l/resolvers/vulnerabilities/identifier_search_resolver.rb
- ee/app/graphql/resolvers/vulnerabilities_resolver.rb 17 additions, 10 deletionsee/app/graphql/resolvers/vulnerabilities_resolver.rb
- ee/app/graphql/resolvers/vulnerability_filterable.rb 2 additions, 12 deletionsee/app/graphql/resolvers/vulnerability_filterable.rb
- ee/config/feature_flags/gitlab_com_derisk/return_disabled_vulnerability_graphql_filters.yml 9 additions, 0 deletions..._derisk/return_disabled_vulnerability_graphql_filters.yml
- ee/spec/graphql/api/vulnerabilities_spec.rb 65 additions, 1 deletionee/spec/graphql/api/vulnerabilities_spec.rb
- ee/spec/graphql/resolvers/vulnerabilities_resolver_spec.rb 1 addition, 1 deletionee/spec/graphql/resolvers/vulnerabilities_resolver_spec.rb
- ee/spec/graphql/resolvers/vulnerability_severities_count_resolver_spec.rb 1 addition, 1 deletion...resolvers/vulnerability_severities_count_resolver_spec.rb
Loading
Please register or sign in to comment