Toggle built_in_project_templates_enabled instance setting via REST API

What does this MR do and why?

Toggle built_in_project_templates_enabled instance setting via REST API

Expose built_in_project_templates_enabled and lock_built_in_project_templates_enabled on the application_setting entity, allowing those attributes to be updated through the application setting REST API update endpoint.

EE: true

Documentation to follow and tracked by #596907 (closed)

References

Contributes to #593619 (closed)

Screenshots or screen recordings

Before After

How to set up and validate locally

  1. Make sure your instance has a premium or ultimate license
  2. Feature.disable(:use_built_in_project_templates_enabled)
  3. built_in_project_templates_enabled and lock_built_in_project_templates_enabled are not returned from GET /application/settings
curl --request GET \
  --header "PRIVATE-TOKEN: <token>" \
  --url "http://localhost:3000/api/v4/application/settings"
  1. built_in_project_templates_enabled and lock_built_in_project_templates_enabled are not updated by PUT /application/settings
curl --request PUT \
  --header "PRIVATE-TOKEN: <token>" \
  --url "http://localhost:3000/api/v4/application/settings" \
  --data "built_in_project_templates_enabled=true" \
  --data "lock_built_in_project_templates_enabled=true"
  1. Feature.enable(:use_built_in_project_templates_enabled)
  2. built_in_project_templates_enabled and lock_built_in_project_templates_enabled are returned from GET /application/settings
curl --request GET \
  --header "PRIVATE-TOKEN: <token>" \
  --url "http://localhost:3000/api/v4/application/settings"

6.built_in_project_templates_enabled and lock_built_in_project_templates_enabled are updated by PUT /application/settings

curl --request PUT \
  --header "PRIVATE-TOKEN: <token>" \
  --url "http://localhost:3000/api/v4/application/settings" \
  --data "built_in_project_templates_enabled=true" \
  --data "lock_built_in_project_templates_enabled=true"

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.

Edited by Fred Reinink

Merge request reports

Loading