-
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
feat: consider env_misc.platform as hardware #703
Conversation
@@ -281,7 +281,7 @@ def handle_test(self, record, tests): | |||
|
|||
if status == "ERROR" or status == "FAIL" or status == "MISS": | |||
tests["platformsFailing"].add( | |||
extract_platform(record["environment_misc"]) | |||
handle_environment_misc(record["environment_misc"]).get("platform") |
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 had no idea we were already getting platform faililng in hardware
@@ -0,0 +1,27 @@ | |||
import json | |||
from typing import Union, TypedDict, Optional | |||
from kernelCI_app.helpers.filters import UNKNOWN_STRING |
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.
filters
is probably not the best place for UNKNOWN_STRING
maybe helper.constants
but I know it is not being introduced by this PR
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 agree with you. I can change this as well if you think it would be better
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.
lets not worry for this for today, we need this quick
platform: str | ||
|
||
|
||
def handle_environment_misc(misc: Union[str, dict, None]) -> Optional[EnvironmentMisc]: |
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.
the return here is not Optional
, it is always returning
try: | ||
misc = json.loads(misc) | ||
except json.JSONDecodeError: | ||
return parsed_misc |
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.
maybe it is a good idea to add the log_message
here, for now it just prints but in the future will be doing something 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.
And keep returning the default value?
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.
omg that was lack of attention, make it the return value back to optional and make it return None
environmentCompatible={{ | ||
...data.testEnvironmentCompatible, | ||
...data.testEnvironmentMisc, | ||
}} |
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.
useMemo
especially when you have to spreads
76ae7f1
to
38cd3a0
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.
it worked on my tests
@@ -218,8 +220,13 @@ def _process_rows(self, rows: Dict) -> None: | |||
sanitized_rows = self.sanitize_rows(rows) | |||
|
|||
for row in sanitized_rows: | |||
hardware_filter = row["hardware_compatibles"] | |||
if hardware_filter is None or hardware_filter == UNKNOWN_STRING: |
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.
the sanitized rows are simply the original rows but as an object, the row["hardware_compatibles"]
hasn't been sanitized to receive UNKNOWN_STRING
yet. In other words, the comparison hardware_filter == UNKNOWN_STRING
will never be true unless the original row in the database is literally "Unknown", so I think this comparison is not needed
@@ -218,8 +220,13 @@ def _process_rows(self, rows: Dict) -> None: | |||
sanitized_rows = self.sanitize_rows(rows) | |||
|
|||
for row in sanitized_rows: | |||
hardware_filter = row["hardware_compatibles"] |
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.
isn't this variable referring to the current hardware of a row? I don't think hardware_filter is a good name for it
self.hardwareUsed.add(test_environment_compatible) | ||
else: | ||
hardware_filter = test_environment_misc.get("platform") |
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.
ditto about hardware_filter var name
Add a new logic to the backend where `environment_misc.platform` will work as a fallback case for when the `environment_compatabile` field is null in the database. When `environment_misc.plaftorm` is null, we'll use `build.misc.platform`, but the logic of the Hardware filter will be kept the same, meaning that the builds returned will be first the build associated with the tests that have that hardware. This means that even if `build.misc.platform` is null but the build is associated with a test that have `environment_compatible` or `environment_misc.platform` not null, it will also be added when filtering for that hardware Closes #692
38cd3a0
to
457bcce
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.
Worked well on my tests, just a note to split the commits into the feature and the formatter refactor for better reviewing
Add a new logic to the backend where
environment_misc.platform
will work as a fallback case for when theenvironment_compatabile
field is null in the database. Whenenvironment_misc.plaftorm
is null, we'll usebuild.misc.platform
, but the logic of the Hardware filter will be kept the same, meaning that the builds returned will be first the build associated with the tests that have that hardware. This means that even ifbuild.misc.platform
is null but the build is associated with a test that haveenvironment_compatible
orenvironment_misc.platform
not null, it will also be added when filtering for that hardwareThis drastically lowers the number of Unknown hardware but they can still occur if both
environment_compatible
andenvironment_misc.platform
andbuild.misc.platform
are null.Closes #692
How to test
acer-R721T-grunt
) from the Hardware Used card, Hardware Tested card and Filter modal and make the same verifications as above, if the status are showing correctly (comparing the values in the Hardware Tested card and the value shown in the pie chart) and if the commit graph is working.