Semi aggregated query for hardware details summary endpoint#1832
Semi aggregated query for hardware details summary endpoint#1832alanpeixinho wants to merge 1 commit intokernelci:mainfrom
Conversation
9c304aa to
11b5c99
Compare
162a78e to
93f201f
Compare
MarceloRobert
left a comment
There was a problem hiding this comment.
Seems like there's some discrepancy between the listing and the details, specially with larger hardware such as kubernetes
| self.origin: str = None | ||
| self.start_datetime: datetime = None | ||
| self.end_datetime: datetime = None | ||
| self.selected_commits: Dict[str, str] = None |
There was a problem hiding this comment.
IMO you should keep at least these values since they are modified by unstable_parse_post_body and also won't have a typehint when used in the post method otherwise.
| summary = Summary( | ||
| builds=builds_summary, boots=boots_summary, tests=tests_summary | ||
| ) | ||
| commons = HardwareCommon(trees=all_trees, compatibles=all_compatibles) | ||
| filters = HardwareDetailsFilters( | ||
| all=all_filters, | ||
| builds=builds_filters, | ||
| boots=boots_filters, | ||
| tests=tests_filters, | ||
| ) | ||
|
|
||
| valid_response = HardwareDetailsSummaryResponse( | ||
| summary=Summary( | ||
| builds=self.builds_summary, | ||
| boots=self.boots_summary, | ||
| tests=self.tests_summary, | ||
| ), | ||
| filters=HardwareDetailsFilters( | ||
| all=GlobalFilters( | ||
| configs=self.global_configs, | ||
| architectures=self.global_architectures, | ||
| compilers=self.global_compilers, | ||
| ), | ||
| builds=LocalFilters( | ||
| issues=list(self.unfiltered_build_issues), | ||
| has_unknown_issue=self.unfiltered_uncategorized_issue_flags[ | ||
| "build" | ||
| ], | ||
| origins=sorted(self.unfiltered_origins["build"]), | ||
| labs=sorted(self.unfiltered_labs["build"]), | ||
| ), | ||
| boots=HardwareTestLocalFilters( | ||
| issues=list(self.unfiltered_boot_issues), | ||
| platforms=list(self.unfiltered_boot_platforms), | ||
| has_unknown_issue=self.unfiltered_uncategorized_issue_flags[ | ||
| "boot" | ||
| ], | ||
| origins=sorted(self.unfiltered_origins["boot"]), | ||
| labs=sorted(self.unfiltered_labs["boot"]), | ||
| ), | ||
| tests=HardwareTestLocalFilters( | ||
| issues=list(self.unfiltered_test_issues), | ||
| platforms=list(self.unfiltered_test_platforms), | ||
| has_unknown_issue=self.unfiltered_uncategorized_issue_flags[ | ||
| "test" | ||
| ], | ||
| origins=sorted(self.unfiltered_origins["test"]), | ||
| labs=sorted(self.unfiltered_labs["test"]), | ||
| ), | ||
| ), | ||
| common=HardwareCommon( | ||
| trees=trees, | ||
| compatibles=self.compatibles, | ||
| ), | ||
| ) | ||
| except ValidationError as e: | ||
| return Response(data=e.json(), status=HTTPStatus.INTERNAL_SERVER_ERROR) | ||
| valid_response = HardwareDetailsSummaryResponse( | ||
| summary=summary, filters=filters, common=commons | ||
| ) |
There was a problem hiding this comment.
I'd wrap all this in a try except just in case we get a ValidationError
There was a problem hiding this comment.
You are correct, as it is, I am changing behavior unnecessarily
|
Good code though, very organized 👍 |
409f8ed to
0002e6c
Compare
0002e6c to
a19b158
Compare
I happened due to a misunderstanding in the filtering of dummy builds. Should be correct now. |
| "base_hardware, filters", | ||
| [ | ||
| (ASUS_HARDWARE, {"config_name": "defconfig+kcidebug+x86-board"}), | ||
| (ASUS_HARDWARE, {"config_name": "defconfig"}), |
There was a problem hiding this comment.
Check if this is change is correct.
| "base_hardware, filters", | ||
| [ | ||
| (ASUS_HARDWARE, {"architecture": "i386"}), | ||
| (ASUS_HARDWARE, {"architecture": "asus-CM1400CXA-dalboz"}), |
There was a problem hiding this comment.
Check if this is change is correct.
Description
This implements performance improvement on the Hardware details summary endpoint.
How to test