Toggle built_in_project_templates_enabled group setting via REST API

What does this MR do and why?

Toggle built_in_project_templates_enabled group setting via REST API

Expose built_in_project_templates_enabled and lock_built_in_project_templates_enabled on the namepsace entity, allowing those attributes to be updated through the namespace settings 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 group has a premium or ultimate license, and you are an owner of the group
  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 /groups/<group_id>
curl --request GET \
  --header "PRIVATE-TOKEN: <token>" \
  --url "http://localhost:3000/api/v4/groups/<group_id>"
  1. built_in_project_templates_enabled and lock_built_in_project_templates_enabled are not updated by PUT /groups/<group_id>
curl --request PUT \
  --header "PRIVATE-TOKEN: <token>" \
  --url "http://localhost:3000/api/v4/groups/<group_id>" \
  --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/groups/<group_id>"

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/groups/<group_id>" \
  --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