Summary of What Needs to be Done:
The predict method in sla_prediction_service.py uses DEFAULT_SLA_HOURS.get(priority, 72) which silently accepts invalid priority values. An invalid priority like 'invalid' would use default 72 hours instead of raising an error.
Changes that Need to be Made:
- Add validation at the start of predict method
- Check that priority is in DEFAULT_SLA_HOURS keys
- Raise ValueError for unknown priorities
- Update _risk_level to also validate thresholds dict
Changes to be made in backend/services/sla_prediction_service.py:
- Add priority validation before processing
- Raise clear error message for invalid priority
Impact that it would Provide:
- Fail fast for invalid priority values
- Help catch configuration errors early
- Make behavior explicit rather than silently using defaults
- Improve debuggability
Please assign this issue to me so I can implement it.
Summary of What Needs to be Done:
The predict method in sla_prediction_service.py uses DEFAULT_SLA_HOURS.get(priority, 72) which silently accepts invalid priority values. An invalid priority like 'invalid' would use default 72 hours instead of raising an error.
Changes that Need to be Made:
Changes to be made in backend/services/sla_prediction_service.py:
Impact that it would Provide:
Please assign this issue to me so I can implement it.