We had previously added a function that defaulted the rule configuration if it was empty, in order to make the experience smoother for the UI user.
Since then, the UI has made a change that doesn't send an empty configuration by default, and instead sets some of the fields.
This change ensures that any fields that are unset get a default value.
We should consider moving default values to the rule schema itself, and marking the field as required, but that will be done as part of a larger rule validation epic.
I have manually tested locally with the latest frontend to ensure the bug is fixed. Tested with both a nilecosystem_config and an empty array ecosystem_config.
Summary
We had previously added a function that defaulted the rule configuration if it was empty, in order to make the experience smoother for the UI user. Since then, the UI has made a change that doesn't send an empty configuration by default, and instead sets some of the fields.
This change ensures that any fields that are unset get a default value.
We should consider moving default values to the rule schema itself, and marking the field as required, but that will be done as part of a larger rule validation epic.
Fixes https://github.com/mindersec/minder-rules-and-profiles/issues/184
Change Type
Mark the type of change your PR introduces:
Testing
Outline how the changes were tested, including steps to reproduce and any relevant configurations. Attach screenshots if helpful.
Review Checklist: