Add virtual registry setting toggle and call graphql query and mutation
What does this MR do and why?
This MR adds in a toggle to the package and registries setting to enable/disable the virtual registry feature.
This is an EE only feature.
This feature is enabled by default due to the default value for enabled being set to true.
This is the last MR for this feature #554069
Latest design, which includes the beta badge #569623[BetaBadge.png]
Main changes are:
- add new EE virtual registries setting component
- add mutation
- new EE component is imported into the existing
group_settings_app
page. - Updated the existing query to use fragments, so that in FOSS mode the query doesn't include the virtual registries settings, but does include the virtual registries settings query in EE. I saw a couple of different implementations in the codebase, and thought this way was a neat way to approach this.
- Added a separate
group_settings_app
test coverage in EE. This contributes to the larger size MR. I thought this was the simplest cleanest way to test EE and FOSS separately. But open to other suggestions.
Note: The MR is on the larger side, I looked at splitting this out into backend and frontend changes, but that wouldn't make a big impact as the backend changes are quite small (pushing abilities and adding search section). The frontend changes all really need to go in together to work. Happy to try a different approach if this is too hard to review.
References
Screenshots or screen recordings
Before | After |
---|---|
![]() |
![]() |
. | ![]() |
![]() |
![]() |
![]() |
|
![]() |
How to set up and validate locally
Setup:
[2] pry(main)> ::Feature.enabled?(:maven_virtual_registry)
=> true
Validate persistence to db, links and popover:
- Run
gdk psql
select * from virtual_registries_settings;
- There will be no entries initially. The setting is enabled by defailt.
- Go to http://gdk.test:3000/groups/twitter/-/settings/packages_and_registries
- Under enable virtual registry
- Disable toggle
- Check psql and there will be an entry for that group, with enabled false.
Accessibility:
- On a mac you can press command + F5 to enable screen reader
- Go to http://gdk.test:3000/groups/twitter/-/settings/packages_and_registries
- Tab to virtual registry toggle, should be enabled.
FOSS mode:
- Run
export FOSS_ONLY=true
- Restart your gdk
gdk restart
- Go to
http://gdk.test:3000/groups/twitter/-/settings/packages_and_registries
- The virtual registry setting should not be showing and all other settings continue to work.
Validation of the impact of disabling this toggle (i.e graphql queries, apis, views) has been done in this MR !204305 (merged)
MR acceptance checklist
Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
Related to #562237