Skip to content

Implement enhanced validation for threshold parameters #668

@coderabbitai

Description

@coderabbitai

Description

The current validator doesn't support validation for threshold parameters that require:

  • Ensuring values are positive numbers
  • Validating relative ordering between related thresholds

This enhancement is needed before adding validation for ReportedStateManager threshold parameters.

Requirements

The validator should support validation rules for:

  1. Positive number validation: Ensure threshold values are greater than zero
  2. Relative ordering validation: Ensure that related thresholds maintain correct ordering (e.g., unavailableThreshold < stoppedThreshold)

Context

This issue arose from the ReportedStateManager implementation where:

  • unavailableThreshold and stoppedThreshold need to be positive values
  • unavailableThreshold must be less than stoppedThreshold

Currently, these validations would need to be handled at the constructor level, but the preference is to handle validation at the configuration level for consistency.

Acceptance Criteria

  • Add support for positive number validation in the validator
  • Add support for relative ordering validation between related parameters
  • Update validation schema to support these new validation types
  • Document the new validation capabilities

Related

Requested by: @petermasking

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions