Skip to content

Migrate corpus management UI to use seperate feature flag

- requested to merge 349014-corpus-management-ui-flag into master

What does this MR do and why?

Note: The entire page and feature is behind the corpus_management_ui feature flag. This is not a feature flag that enables partially new functionality, it enables the entire page.

Feature

This is the feature uses the :corpus_management_ui feature flag!

This the frontend feature flag to compliment the backend feature flag :corpus_management here #328418 (closed)

Why two feature flags?

The existing corpus_management feature flag controls both backend (graphql/REST) endpoints and frontend. We are forced to use a global feature flag scope for backend.

Because graphQL query feature flags run before the database context is loaded. We can't use any kind of permissions based feature flag logic to scope the flag to a project, group or user.

Instead, we enable the graphQL endpoint globally with the existing feature flag, and then enable the frontend feature flag in production for a particular project.

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

  • With corpus_management_ui feature flag disabled, navigate to http://172.16.123.1:3000///-/security/configuration/corpus_management

  • VERIFY you see a 404 page

bundle exec rails c

then

[4] pry(main)> Feature.enable(:corpus_management)
[4] pry(main)> Feature.disable(:corpus_management_ui)

Navigate to:

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

  • VERIFY you see a 404

bundle exec rails c

then

[4] pry(main)> Feature.enable(:corpus_management)
[4] pry(main)> Feature.enable(:corpus_management_ui)

Navigate to:

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

Click on New Corpus, upload any zip file

Click "Add", should see the corpus added to the table

Click the download button from the table row

Verify the unzipped file contents match your original file (Note, downloaded file will be named after the package name you uploaded, not the original file name, but the contents should remain the same)

Numbered steps to set up and validate the change are strongly suggested.

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 #349014 (closed)

Edited by -

Merge request reports