Currently, you can set your leak period to a random string, and it will be interpreted as a version, whether or not that version actually exists in your project. A subsequent analysis against that bad leak value results in no leak period.
Instead, we should fail fast if the leak setting is not one of
- valid, in-the-past date
- positive integer (number of days)
- an existing project version
The analysis error should be:
Invalid new code period. "[leak string]" is not one of: positive integer, date in the past, "previous_version", or version string that exists in the project.
Because it's currently possible to have projects with empty new code period values, we'll do a DB migration to reset such projects to use previous_version.