Skip to content

Corpus Management validations

- requested to merge 342583-corpus-management-validations into master

What does this MR do and why?

Adds form validations to corpus uploads on the corpus management page, and also updates the apollo caching logic to fix #349844 (closed)

Describe in detail what your merge request does and why.

Screenshots or screen recordings

These are strongly recommended to assist reviewers and reduce the time to merge your change.

How to set up and validate locally

  • From the gitlab repo open a rails console and enable the :corpus_management AND :corpus_management_ui feature flag
bundle exec rails c

then

[4] pry(main)> Feature.enable(:corpus_management)
[4] pry(main)> Feature.enable(:corpus_management_ui)
  • Generate a large file above 5 GB by running the following in the command line
mkfile 6G bigfile.zip

Navigate to:

http://172.16.123.1:3000/<group>/<project>/-/security/configuration/corpus_management

File too large

  • Click on New Corpus.
  • Attempt to upload the large file
  • VERIFY you see file too large warning

Screen_Shot_2022-01-22_at_6.40.31_AM

Invalid corpus name

  • Click on New Corpus.
  • Attempt to upload a corpus with forbidden characters. Try something like foo$bar
  • VERIFY you see validation message with proper formatting

Screen_Shot_2022-01-22_at_6.40.17_AM

Blank corpus name

  • Click on New Corpus.
  • Attach file
  • VERIFY upload file is disabled
  • Add a corpus name
  • VERIFY upload file is enabled

Screen_Shot_2022-01-22_at_6.40.38_AM

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #342583 (closed)

Edited by -

Merge request reports