feat(config): Add Validation to Several Config Fields#664
Conversation
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit ebd653a. Configure here.
|
one thing to think about: https://github.com/Keats/validator/blob/master/README.md#struct-level-validation |
…eorge/feat/config-validation
| // Use "__" for nested configurations via environment variables, like `TASKBROKER_KAFKA_TOPICS__PROFILES__CLUSTER` | ||
| builder = builder.merge(Env::prefixed("TASKBROKER_").split("__")); | ||
| let mut config: Config = builder.extract()?; | ||
|
|
There was a problem hiding this comment.
@george-sentry I think we should not have two of these functions. normalize_and_validate is called from tests, and in those tests we should call validate too IMO

Linear
Refs STREAM-843
Description
Some configuration options have specific requirements, like they must be greater than zero or a power of two. Until now, we've relied on ad hoc assertions and calls to functions like
max(1)to enforce these constraints. I think it would be better to guarantee these constraints immediately on startup because ad hoc checks can easily be forgotten.