Skip to content

feat(KONFLUX-5817): paginate the ecResults to improve performance #159

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

Closed
wants to merge 1 commit into from

Conversation

testcara
Copy link
Member

@testcara testcara commented Mar 18, 2025

Fixes

KONFLUX-5817

Description

When the application has more than 100 components, the size of ecResult would be larger than 23M and its length of records is larger than 4000, then UI crashes. The patch would paginate the ecResults to ensure UI can handle it well.

Besides above improvement, the patch also decrease the time of the component render to ensure just when ecResult really changes, pages would be rendered.

FYI. I would create PR for hac-dev after the patch is merged.

Type of change

  • Feature
  • Bugfix
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • Documentation content changes
  • Other (please describe):

Screen shots / Gifs for design review

security for pipelinerun and taskrun:
Screenshot 2025-03-17 at 13 33 28

Screenshot 2025-03-18 at 13 05 45
Screenshot 2025-03-18 at 13 06 18

Screen.Recording.2025-03-18.at.13.03.14.mov

How to test or reproduce?

  • security for pipelinerun and taskrun can be shown well for different components

Browser conformance:

  • Chrome
  • Firefox
  • Safari
  • Edge

Copy link

codecov bot commented Mar 18, 2025

Codecov Report

Attention: Patch coverage is 85.89744% with 11 lines in your changes missing coverage. Please review.

Project coverage is 80.70%. Comparing base (7ef8921) to head (d4eaf4e).
Report is 51 commits behind head on main.

Files with missing lines Patch % Lines
...nterpriseContractTable/EnterpriseContractTable.tsx 84.61% 6 Missing ⚠️
...terpriseContract/SecurityEnterpriseContractTab.tsx 90.62% 3 Missing ⚠️
src/utils/enterprise-contract-utils.tsx 66.66% 2 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #159      +/-   ##
==========================================
+ Coverage   80.64%   80.70%   +0.06%     
==========================================
  Files         556      555       -1     
  Lines       21654    21666      +12     
  Branches     5126     5125       -1     
==========================================
+ Hits        17462    17485      +23     
+ Misses       4167     4156      -11     
  Partials       25       25              
Flag Coverage Δ
unittests 80.70% <85.89%> (+0.06%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
.../EnterpriseContractTable/EnterpriseContractRow.tsx 91.52% <100.00%> (ø)
...seContract/useEnterpriseContractResultFromLogs.tsx 94.73% <ø> (ø)
...mponents/TaskRunDetailsView/TaskRunDetailsView.tsx 84.61% <ø> (ø)
src/utils/enterprise-contract-utils.tsx 86.84% <66.66%> (+86.84%) ⬆️
...terpriseContract/SecurityEnterpriseContractTab.tsx 86.04% <90.62%> (-0.05%) ⬇️
...nterpriseContractTable/EnterpriseContractTable.tsx 87.77% <84.61%> (-2.89%) ⬇️

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7ef8921...d4eaf4e. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

const extractedLogs = logs.match(/(\[report-json\] ).+/g);
const json = JSON.parse(extractedLogs.map((l) => l.replace('[report-json] ', '')).join(''));
return json;
const EC_REPORT_JSON_REGEX = /((?<=step-report-json\s*:-\s*)(\{.*?\})(?=\s*step-|$))/g;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes of utils is duplicated with #84. :-). We can focus on changes of the component.

Copy link
Member

@StanislavJochman StanislavJochman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Member

@sahil143 sahil143 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@testcara We should be using virtualized table instead of paginated table here. The default <Table> Component we use for every list page supports virtualization.

// We add pagination support here to avoid large ecResult.
// When one application has more than 100 components, the size of ecResult is more than
// 23M and the length of records is more than 50000. The browser cannot show it in one page.
// More, we cannot enjoy the shared virtualized table for inconsisitent parameters.
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sahil143 , i have tried the visualized table when enjoyed by pipelinerun and others but failed for inconsistent parameters. would you like to double-confirm?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you mean by inconsistent parameters here?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The visualized table is supporting the infinite scroll scenarios like the pipelineruns and other lists.
For this log parts, it does not match that scenario.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would try to enjoy the visualized table, thank you for pointing it out. :-)

Copy link
Member

@StanislavJochman StanislavJochman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Member

@sahil143 sahil143 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we close this PR in favor of #200

@testcara testcara closed this Apr 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants