docs: write on how to use feature flags within templates

Signed-off-by: djamaile <rdjamaile@gmail.com>
This commit is contained in:
djamaile
2022-03-14 19:06:32 +01:00
parent 8ed8e26247
commit 41f51ad5d5
@@ -254,6 +254,43 @@ use `ui:widget: password` or set some properties of `ui:backstage`:
show: false # wont print any info about 'hidden' property on Review Step
```
### Remove sections or fields based on feature flags
Based on feature flags you can hide sections or even only fields of your
template. This is a good use case if you want to test experimental parameters in
a production environment. To use it let's look at the following template:
```yaml
spec:
type: website
owner: team-a
parameters:
- name: Enter some stuff
description: Enter some stuff
backstage:featureFlag: experimental-feature
properties:
inputString:
type: string
title: string input test
inputObject:
type: object
title: object input test
description: a little nested thing never hurt anyone right?
properties:
first:
type: string
title: first
backstage:featureFlag: nested-experimental-feature
second:
type: number
title: second
```
If you have a feature flag `experimental-feature` active then
your first step would be shown. The same goes for the nested properties in the
spec. Make sure to use the key `backstage:featureFlag` in your templates if
you want to use this functionality.
### The Repository Picker
In order to make working with repository providers easier, we've built a custom