-
Notifications
You must be signed in to change notification settings - Fork 3
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
Refactor: Change issues from unknown to uncategorized #925
Conversation
ec2a467
to
14041a3
Compare
@@ -283,7 +284,11 @@ def __init__(self, data: Dict, process_body=False) -> None: | |||
self.filterTestPath = "" | |||
self.filterBootPath = "" | |||
self.filterBuildValid = set() | |||
self.filterIssues = {"build": set(), "boot": set(), "test": set()} | |||
self.filterIssues: Dict[PossibleTabs, Set[str, Optional[int]]] = { |
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.
Is Set[str, Optional[int]]
a valid type? I couldn't find anything to support this annotation. You might have forgot a Union
here, I'm not sure
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.
I forgot a thing here but it's not an Union, it's a Tuple
|
||
return Response(response) | ||
return Response(valid_response.model_dump(), status=HTTPStatus.OK) |
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.
Response
already defaults status to OK
https://www.django-rest-framework.org/api-guide/responses/#response
Renames unknown issues to Uncategorized issues Changes the behavior of the filters to return a flag for if it has uncategorized issues, instead of considering them as a normal issue Refactors TreeDetailsView and TreeDetailsSummaryView to use pydantic models directly Closes #910
14041a3
to
0241a71
Compare
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 job!! Just a comment
@@ -283,7 +299,11 @@ def __init__(self, data: Dict, process_body=False) -> None: | |||
self.filterTestPath = "" | |||
self.filterBootPath = "" | |||
self.filterBuildValid = set() | |||
self.filterIssues = {"build": set(), "boot": set(), "test": set()} | |||
self.filterIssues: dict[PossibleTabs, set[tuple[str, Optional[int]]]] = { |
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.
self.filterIssues: dict[PossibleTabs, set[tuple[str, Optional[int]]]] = { | |
self.filterIssues: dict[PossibleTabs, set[Tuple[str, Optional[int]]]] = { |
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.
This is being used to start following #930
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 call. Since this ticket is not a priority we shouldn't change what we've already done but I think we should stop to use the deprecated typing for new code
@@ -1,5 +1,7 @@ | |||
from typing import Dict |
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.
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.
Worked well on my tests
How to test
Go to a tree or hardware details page where there are builds/boots/tests with uncategorized issues
Filter them through the issues list and through the filter modal
Check if everything is being filtered as intended
Closes #910