mindersec / minder

Software Supply Chain Security Platform
https://minder-docs.stacklok.dev/
Apache License 2.0
258 stars 37 forks source link

Change defaults for pull request rules #4773

Closed eleftherias closed 2 days ago

eleftherias commented 2 days ago

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:

eleftherias commented 2 days ago

I have manually tested locally with the latest frontend to ensure the bug is fixed. Tested with both a nil ecosystem_config and an empty array ecosystem_config.