Update Customizing Components authored by Slominski, Ryan's avatar Slominski, Ryan
......@@ -27,4 +27,4 @@ ci-gradle:
```
## Unsetting Values
Unfortunately there are a few job parameters that have default values that differ when no value is specified vs an empty value is specified. For example: `rules` and `needs` behave differently if not specified at all vs an empty array `[]`. The yaml file format suggests that a `null` might be want we want to "unset" the value, but this does not work to clear Component inputs. See: https://gitlab.com/gitlab-org/gitlab/-/issues/439524. In the case of `rules`, you can use `[{when: on_success}]` to force the default behavior as if no rules were provided. This isn't the case with `needs` though - you can't clear it.
Unfortunately there are a few job parameters that have default values that differ when no value is specified vs an empty value is specified, and there is currently no way to "unset/clear" an input. For example: `rules` and `needs` behave differently if not specified at all vs an empty array `[]`. The YAML file format suggests that a `null` might be want we want to "unset" the value, but this does not work to clear Component inputs. See: https://gitlab.com/gitlab-org/gitlab/-/issues/439524. In the case of `rules`, you can use `[{when: on_success}]` to force the default behavior as if no rules were provided. This isn't the case with `needs` though - you can't clear it. The work-around is to avoid using "needs" as an input unless it's almost certainly going to be set to something, and if all else fails, users can use `extends` to extend the job defined in the Component as extended jobs can clear fields. See: https://docs.gitlab.com/ci/yaml/yaml_optimization/#exclude-a-key-from-extends