Feature Toggles: Create API for updating feature toggle state from the feature toggle admin page (#73022)

* create roles for writing feature toggles

* create update endpoint / handler

* api changes

* add feature toggle validations

* hide toggles based on their state

* make FlagFeatureToggle read only

* add username log

* add username string

* refactor for better readability

* refactor unit tests so we can do more validations

* some skeletoning for the set tests

* write unit tests for updater

* break helper functions out

* update sample ini to match defaults

* add more logic to ReadOnly label

* add user documentation

* fix lint issue

* Update docs/sources/setup-grafana/configure-grafana/_index.md

Co-authored-by: J Stickler <julie.stickler@grafana.com>

* Update docs/sources/setup-grafana/configure-grafana/_index.md

Co-authored-by: J Stickler <julie.stickler@grafana.com>

* Update docs/sources/setup-grafana/configure-grafana/_index.md

Co-authored-by: J Stickler <julie.stickler@grafana.com>

* Update docs/sources/setup-grafana/configure-grafana/_index.md

Co-authored-by: J Stickler <julie.stickler@grafana.com>

* Update docs/sources/setup-grafana/configure-grafana/_index.md

Co-authored-by: J Stickler <julie.stickler@grafana.com>

* Update docs/sources/setup-grafana/configure-grafana/_index.md

Co-authored-by: J Stickler <julie.stickler@grafana.com>

---------

Co-authored-by: IbrahimCSAE <ibrahim.mdev@gmail.com>
Co-authored-by: J Stickler <julie.stickler@grafana.com>
This commit is contained in:
Michael Mandrus
2023-08-09 11:32:28 -04:00
committed by GitHub
parent d9695eb507
commit 779e0fe311
11 changed files with 629 additions and 92 deletions

View File

@@ -2257,6 +2257,36 @@ For more information about Grafana Enterprise, refer to [Grafana Enterprise]({{<
Keys of alpha features to enable, separated by space.
<hr>
## [feature_management]
The options in this section configure the experimental Feature Toggle Admin Page feature, which is enabled using the `featureToggleAdminPage` feature toggle. Grafana Labs offers support on a best-effort basis, and breaking changes might occur prior to the feature being made generally available.
Please see [Configure feature toggles]({{< relref "/feature-toggles" >}}) for more information.
### allow_editing
Lets you switch the feature toggle state in the feature management page. The default is `false`.
### update_controller_url
Set the URL of the controller that manages the feature toggle updates. If not set, feature toggles in the feature management page will be read-only.
{{% admonition type="note" %}}
The API for feature toggle updates has not been defined yet.
{{% /admonition %}}
### hidden_toggles
Hide additional specific feature toggles from the feature management page. By default, feature toggles in the `unknown`, `experimental`, and `private preview` stages are hidden from the UI. Use this option to hide toggles in the `public preview`, `general availability`, and `deprecated` stages.
### read_only_toggles
Use to disable updates for additional specific feature toggles in the feature management page. By default, feature toggles can only be updated if they are in the `general availability` and `deprecated`stages. Use this option to disable updates for toggles in those stages.
<hr>
## [date_formats]
{{% admonition type="note" %}}