-
Notifications
You must be signed in to change notification settings - Fork 23
[Hygiene] Remove severity check #1030
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
Conversation
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.
Now that everything has been migrated, removing this check sounds good, but we should also IMO avoid introducing in the future any more of those cases.
The easiest way to do so would probably be to remove the severity
parameter in record_fail
and raise an exception if the severity is not set in the documentation:
monitoring/monitoring/uss_qualifier/scenarios/scenario.py
Lines 113 to 128 in 2f4a376
def record_failed( | |
self, | |
summary: str, | |
severity: Optional[Severity] = None, | |
details: str = "", | |
query_timestamps: Optional[List[datetime]] = None, | |
additional_data: Optional[dict] = None, | |
) -> None: | |
self._outcome_recorded = True | |
if severity is None: | |
if "severity" in self._documentation and self._documentation.severity: | |
severity = self._documentation.severity | |
else: | |
raise ValueError( | |
f"Severity of check '{self._documentation.name}' was not specified at failure time and is not documented in scenario documentation" | |
) |
The problem is that is still used for some legit reasons, like test and severity not in the documentation :/ Would renaming it to something else would do the trick ? Like |
I cannot find any use of the parameter anywhere else than in unit tests. Am I missing some? |
Ha correct, mixed up contexts between |
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.
Nice thanks!
Should close #404 at this point :)
Mostly a revert of #968 (expect the rights fix)