feat: keep flakiness in table and user server-side pagination for flakiness overview#920
feat: keep flakiness in table and user server-side pagination for flakiness overview#920
Conversation
Coverage summary from CodacySee diff coverage on Codacy
Coverage variation details
Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: Diff coverage details
Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: See your quality gate settings Change summary preferences |
There was a problem hiding this comment.
Pull request overview
This PR addresses performance issues in the Flakiness Overview by persisting flakiness metrics in a dedicated DB table and switching the overview endpoint + UI to server-side pagination/filtering/sorting.
Changes:
- Add
test_case_flakinesstable + JPA entity/repository and recompute/update it after test statistics updates. - Update flaky tests overview endpoint/service to query the precomputed table with pagination + filters and return
filteredCount. - Update Angular Flakiness Overview page to use lazy server-side pagination/filtering/sorting and align OpenAPI-generated client types.
Reviewed changes
Copilot reviewed 21 out of 21 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| server/application-server/src/main/resources/db/migration/V38__add_test_case_flakiness.sql | Adds new table + index to persist flakiness metrics efficiently. |
| server/application-server/src/main/java/de/tum/cit/aet/helios/tests/TestCaseStatisticsService.java | Implements flakiness persistence + paged overview query from the new table. |
| server/application-server/src/main/java/de/tum/cit/aet/helios/tests/TestResultProcessor.java | Triggers recomputation/persistence after statistics updates. |
| server/application-server/src/main/java/de/tum/cit/aet/helios/tests/TestResultController.java | Extends /api/tests/flaky with pagination/filter/search params. |
| server/application-server/src/main/java/de/tum/cit/aet/helios/tests/FlakyTestOverviewDto.java | Adjusts DTO to match server-side paging (filteredCount) and new storage model. |
| server/application-server/openapi.yaml | Documents new query params and updated response shape. |
| client/src/app/pages/flaky-tests-overview/* | Moves Flakiness Overview table to server-side lazy loading and updates UI accordingly. |
| server/client tests & OpenAPI generated files | Updates tests and generated client types for the API change. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
client/src/app/pages/flaky-tests-overview/flaky-tests-overview.component.html
Outdated
Show resolved
Hide resolved
.../application-server/src/main/java/de/tum/cit/aet/helios/tests/TestCaseStatisticsService.java
Outdated
Show resolved
Hide resolved
.../application-server/src/main/java/de/tum/cit/aet/helios/tests/TestCaseStatisticsService.java
Outdated
Show resolved
Hide resolved
.../application-server/src/main/java/de/tum/cit/aet/helios/tests/TestCaseStatisticsService.java
Outdated
Show resolved
Hide resolved
.../application-server/src/main/java/de/tum/cit/aet/helios/tests/TestCaseStatisticsService.java
Outdated
Show resolved
Hide resolved
client/src/app/pages/flaky-tests-overview/flaky-tests-overview.component.ts
Show resolved
Hide resolved
client/src/app/pages/flaky-tests-overview/flaky-tests-overview.component.ts
Show resolved
Hide resolved
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: fab952bb97
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
server/application-server/src/main/resources/db/migration/V38__add_test_case_flakiness.sql
Show resolved
Hide resolved
server/application-server/src/main/java/de/tum/cit/aet/helios/tests/TestCaseFlakiness.java
Show resolved
Hide resolved
… and enhance test cases
… for non-zero scores
Motivation
After deploying Flakiness Overview feature to test environment, I realized that calculating flakiness score on the fly causes critical performance issue, even Java Heap Out of Memory error. Therefore, it is essential to keep flakiness score in the database and using server side pagination in flakiness overview implementation.
Description
test_case_flakinesstable which keepsflakiness_score, default_branch_failure_rate, combined_failure_rate.test_case_flakinesstable is updated inTestResultProcessorafter updatingtest_case_statistics.getFlakyTestsOverviewservice, which returns results in pages and sorted by flakiness_score.Testing Instructions
Prerequisites:
Flow:
test_case_flakinessis empty. Run a test workflow to calculate flaky tests.4.1. Table loads successfully.
4.2. Search and severity filter still update the displayed page.
4.3. Pagination controls behave consistently with server-side results.
Screenshots
Checklist
General
Server
Client