-
Notifications
You must be signed in to change notification settings - Fork 5
refactor lifecycle retention policies around quantity_to_keep #88
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
refactor lifecycle retention policies around quantity_to_keep #88
Conversation
…nm/refactor-and-fix-lifecycle-retention-policies # Conflicts: # octopusdeploy_framework/resource_lifecycle_retention_test.go
…nm/refactor-and-fix-lifecycle-retention-policies
…nm/refactor-and-fix-lifecycle-retention-policies
…nm/refactor-and-fix-lifecycle-retention-policies
…icies # Conflicts: # octopusdeploy_framework/resource_lifecycle_retention_test.go
// do not throw an error for backwards compatability. | ||
} else { | ||
resp.Diagnostics.AddAttributeError( | ||
// replaces a confusing state change to "unit = Items" error at the api |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm guessing this is to deal with the case sensitive API error response for "Items", but the error message is not related to this at all, which is confusing. Could you explain what you mean here by this comment?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When the user puts days in when the strategy isn't set to count, the server will return "unexpected result, unit was Days but is now Items" because the server returns items no matter what when a forever or default strategy is set.
It won't error when people use "items" even though items isn't needed so I thought it would be good to not break instances that are doing this (even though its an unnecessary field)
I was told to use (stringvalidator.OneOfCaseInsensitive("Days", "Items")) in the schema instead of letting the validation logic be in the external validator so that's why lines 233 and 234 are deleted below
Background
In preparation for adding a "strategy" attribute, a refactor of the lifecycle retention policies was done.
Validation logic previously centered around "should_keep_forever" which will be made deprecated. Validation logic is now centered around "quantity_to_keep"
[sc-121144]
Results
Defaults from the schema were removed as these were overridden by other parts of the code and had no effect on the behaviour.