Skip to content

Commit

Permalink
fix(quietperiod): Fixup config props (#885)
Browse files Browse the repository at this point in the history
My change in #784 caused issues for anyone who had the quiet period properties set as I removed the setters
This change fixes that
  • Loading branch information
marchello2000 committed May 6, 2020
1 parent dbe6de9 commit 46127ea
Showing 1 changed file with 25 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,31 @@
import org.slf4j.LoggerFactory;
import org.springframework.boot.context.properties.ConfigurationProperties;

@ConfigurationProperties(prefix = "quiet-period")
/**
* Configuration properties for QuietPeriodIndicator
*
* <p>CAVEAT: These properties are a bit weird in that they have only one setter (for
* suppressedTriggerTypes) This is because all these properties are always queried from the
* DynamicConfigService, which will use Spring properties as one of the sources so no setter is
* needed. This is also why we include ignoreInvalidFields = true on the annotation below
*
* <p>The expectation is that quiet period can be changed easily at runtime without re-deploying.
*
* <p>Example of properties:
*
* <pre>
* quietPeriod:
* enabled: true
* startIso: 2020-02-09T21:00:00Z
* endIso: 2020-02-10T13:00:00Z
* suppressedTriggerTypes:
* - cron
* - docker
* - git
* - jenkins
* </pre>
*/
@ConfigurationProperties(prefix = "quiet-period", ignoreInvalidFields = true)
public class QuietPeriodIndicatorConfigurationProperties {

private List<String> suppressedTriggerTypes = new ArrayList<>();
Expand Down

0 comments on commit 46127ea

Please sign in to comment.