Application Settings API - Move JS to CE
What does this MR do and why?
Discovered as part of !131090 (merged)
The Application Settings API is available for all tiers per the documentation. Originally there was some confusion since this doc is located in the ee/
directory of the docs. However, this is actually a misrepresentation per this issue: gitlab-docs#1081 (closed)
Additionally when looking at the implementation of the API in rails you will find it in the ce/
directory.
Now prior to the effort where this was discovered linked above all implementations in the code base for this endpoint were in ee/
features and thus the API implementation in JS lived in ee/api
without any issues. Now that a ce/
feature will be using it we need to refactor it into a ce/
domain. As well as to the rest_api.js
file per the API refactor.
Impacted Usages/Changes
- Geo Settings
- JS code refactored to use new import
- Jest code mocks axios directly so no updates needed
- Maintenance Mode
- JS code refactored to use new import
- Jest code mocks axios directly so no updates needed
- Git Abuse Settings
- JS code refactored to use new import
- Jest code refactored to use new import
Screenshots or screen recordings
Videos of all features continuing to work
Geo Settings | Maintenance Mode | Git Abuse Settings |
---|---|---|
Geo | MM | Abuse |
How to set up and validate locally
Testing CE endpoints
- Setup a GDK with no license
- Hit the GET path
api/v4/application/settings
- Ensure data is returned
- Hit the PUT path (w/ postman/curl/etc.) to update a setting
api/v4/application/settings
- Ensure data is updated
Geo Settings
- Setup Geo by following the 1-line installation in the Easy Installation section (How to setup Geo)
- Navigate to Geo Settings (
/admin/geo/settings
) - Ensure you can update settings in the UI and it retains changes after refresh
Maintenance Mode
- Setup Premium/Ultimate license
- Navigate to Admin > Settings > General
- Find the the maintenance mode panel
- Enable and add message, click save changes
- Refresh a few times, it takes the instance a second to enable
- Ensure the alert shows up and your settings are retained
Git Abuse Settings
- Setup Ultimate license
- Navigate to Admin > Settings > Reporting
- Find the Git Abuse panel
- Ensure you can update settings in the UI and it retains changes after refresh
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.