feat: use tree_tests_rollup for tree details summary#1842
feat: use tree_tests_rollup for tree details summary#1842gustavobtflores wants to merge 3 commits intokernelci:mainfrom
Conversation
3f95714 to
c003c95
Compare
c003c95 to
3a35e46
Compare
| ROLLUP_TEST_ID = "rollup_test" | ||
|
|
||
|
|
||
| def normalize_build_dict(row_dict: dict) -> dict: |
| ): | ||
| return True | ||
|
|
||
| if len(platform_filters) > 0 and test_platform not in platform_filters: |
There was a problem hiding this comment.
prefer to check if platform_filters instead of using len
| if len(platform_filters) > 0 and test_platform not in platform_filters: | ||
| return True | ||
|
|
||
| if len(origin_filters) > 0 and test_origin not in origin_filters: |
| origin_summary = instance.test_summary["origins"] | ||
| typed_summary = instance.test_summary_typed | ||
|
|
||
| arch_key = "%s-%s" % (build_arch, build_compiler) |
There was a problem hiding this comment.
can we use a tuple as a key here?
| lab_entry = typed_summary.labs.setdefault(test_lab, StatusCount()) | ||
| setattr(lab_entry, status_name, getattr(lab_entry, status_name) + count) | ||
|
|
||
| if is_status_failure(status_name): |
There was a problem hiding this comment.
nit: we can avoid this conditional, and just use the value:
has_status_failure |= is_status_failure(status_name)
There was a problem hiding this comment.
Or even simpler, just add current test_platform to platforms_failing here
| issue_comment: Optional[str], | ||
| issue_report_url: Optional[str], | ||
| starting_count_status: Optional[DatabaseStatusValues], | ||
| autoincrement: bool = True, |
There was a problem hiding this comment.
Do we need to add this flag? Cant it be the default behaviour?
There was a problem hiding this comment.
it still behaves as before because the flag defaults to True. however, I needed to reuse this function for rollup aggregations in the view, and in that context it's not appropriate to increment the status after creating the IssueTyped.
this also highlights some technical debt: a function named create_issue_typed having a hidden side effect (incrementing status values) is confusing.
Description
Tree details summary now reads pre-aggregated test and boot data from tree_tests_rollup instead of scanning per-test rows from a single large query. Builds still come from a dedicated builds query. This matches the denormalized rollup model and should reduce work for the summary endpoint.
Changes
How to test
Closes #1801