Skip to content

perf(ui): split task and data quality utilities#29181

Open
shah-harshit wants to merge 2 commits into
feat/dashboard-lcp-parentfrom
feat/dashboard-lcp-05-tasks-dq
Open

perf(ui): split task and data quality utilities#29181
shah-harshit wants to merge 2 commits into
feat/dashboard-lcp-parentfrom
feat/dashboard-lcp-05-tasks-dq

Conversation

@shah-harshit

@shah-harshit shah-harshit commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Splits task/data-quality helpers into focused modules so task and incident flows load only when needed.
  • Split from the dashboard LCP optimization work so it can be reviewed independently.

Testing

  • Not run; tests will be fixed separately for this PR.

Ref: https://github.com/open-metadata/openmetadata-collate/issues/4230

Greptile Summary

This PR splits the monolithic TasksUtils.ts (~1320 lines) into six focused utility modules — TaskActionUtils, TaskAssigneeUtils, TaskEntityFetchUtils, TaskFieldUtils, TaskNavigationUtils, and TaskPayloadUtils — so task and incident flows can load only the helpers they need. The original TasksUtils.ts is retained as a barrel re-exporter, preserving backward compatibility for existing consumers.

  • Barrel re-export: TasksUtils.ts now re-exports from all six sub-modules; callers that still import from TasksUtils continue to work without changes.
  • Consumer updates: Task page components (RequestDescriptionPage, UpdateDescriptionPage, RequestTagPage, UpdateTagPage, shared components) and data-quality components (IncidentManagerPageHeader, TestCaseStatusModal, SqlQueryTab) are updated to import directly from the new focused modules.
  • Additional changes: SqlQueryTab lazily loads QueryViewer and AddSqlQueryFormModal via withSuspenseFallback, and ContractSemanticFormTab gains the required CSS side-effect import for @react-awesome-query-builder/antd.

Confidence Score: 5/5

Safe to merge — this is a pure module-split refactoring with no behavioral changes and a barrel re-export that keeps all existing import paths working.

Every function previously in TasksUtils.ts is accounted for in one of the six new modules and is re-exported from the barrel. Consumer files updated in this PR import from the correct focused modules, and the remaining consumers that still point at TasksUtils continue to receive the same exports through the barrel. No logic was changed, only code organization.

No files require special attention. Test updates in TaskTabNew.component.test.tsx involve redundant double-mocking of isRecognizerFeedbackTask across both TasksUtils and TaskActionUtils, but this is harmless given the barrel re-export relationship.

Important Files Changed

Filename Overview
openmetadata-ui/src/main/resources/ui/src/utils/TasksUtils.ts Reduced to a pure barrel re-export of all six new sub-modules; preserves backward compatibility for existing consumers.
openmetadata-ui/src/main/resources/ui/src/utils/TaskEntityFetchUtils.ts New file holding fetchEntityDetail and getBreadCrumbList; logic moved from TasksUtils.ts without behavioral changes.
openmetadata-ui/src/main/resources/ui/src/utils/TaskFieldUtils.ts New file with entity column, field path, and task message utilities extracted from TasksUtils.ts; logic is unchanged.
openmetadata-ui/src/main/resources/ui/src/utils/TaskNavigationUtils.ts New file with navigation path helpers and task status utilities; minor cleanup replacing isUndefined with !== undefined (functionally equivalent).
openmetadata-ui/src/main/resources/ui/src/utils/TaskActionUtils.ts New file with action constants, task type predicates, and DAR utilities split from TasksUtils.ts.
openmetadata-ui/src/main/resources/ui/src/utils/TaskPayloadUtils.ts New file with getDescriptionDiff and getNormalizedTaskPayload split from TasksUtils.ts; logic is unchanged.
openmetadata-ui/src/main/resources/ui/src/utils/TaskAssigneeUtils.ts New file with fetchOptions and generateOptions for assignee lookup, extracted from TasksUtils.ts without changes.
openmetadata-ui/src/main/resources/ui/src/components/DataQuality/IncidentManager/SqlQueryTab/SqlQueryTab.component.tsx QueryViewer and AddSqlQueryFormModal are now lazy-loaded with withSuspenseFallback to reduce initial bundle size.
openmetadata-ui/src/main/resources/ui/src/components/Entity/Task/TaskTab/TaskTabNew.component.test.tsx Tests updated to mock isRecognizerFeedbackTask from TaskActionUtils; both TasksUtils and TaskActionUtils mocks are kept in beforeEach, which is redundant but harmless given the barrel re-export.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    TU["TasksUtils.ts\n(barrel re-export)"]

    TU --> TAU["TaskActionUtils.ts\nAction constants, type predicates\nisDarApprovalActive, isRecognizerFeedbackTask"]
    TU --> TASU["TaskAssigneeUtils.ts\nfetchOptions, generateOptions"]
    TU --> TEFU["TaskEntityFetchUtils.ts\nfetchEntityDetail, getBreadCrumbList"]
    TU --> TFU["TaskFieldUtils.ts\nColumn/field path helpers\ngetTaskMessage, getTaskAssignee"]
    TU --> TNU["TaskNavigationUtils.ts\nRoute path builders\ngetTaskDetailPath, getTaskDisplayId"]
    TU --> TPU["TaskPayloadUtils.ts\ngetDescriptionDiff\ngetNormalizedTaskPayload"]

    RDP["RequestDescriptionPage"] --> TASU
    RDP --> TEFU
    RDP --> TFU

    UDP["UpdateDescriptionPage"] --> TASU
    UDP --> TEFU
    UDP --> TFU

    RTP["RequestTagPage"] --> TASU
    RTP --> TEFU
    RTP --> TFU

    UTP["UpdateTagPage"] --> TASU
    UTP --> TEFU
    UTP --> TFU

    ET["EntityTasks"] --> TFU
    ET --> TNU

    IH["IncidentManagerPageHeader"] --> TNU
    TC["TestCaseStatusModal"] --> TASU

    LEGACY["Existing consumers\n(ActivityFeed, Glossary, Tags…)"] --> TU
Loading
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
flowchart TD
    TU["TasksUtils.ts\n(barrel re-export)"]

    TU --> TAU["TaskActionUtils.ts\nAction constants, type predicates\nisDarApprovalActive, isRecognizerFeedbackTask"]
    TU --> TASU["TaskAssigneeUtils.ts\nfetchOptions, generateOptions"]
    TU --> TEFU["TaskEntityFetchUtils.ts\nfetchEntityDetail, getBreadCrumbList"]
    TU --> TFU["TaskFieldUtils.ts\nColumn/field path helpers\ngetTaskMessage, getTaskAssignee"]
    TU --> TNU["TaskNavigationUtils.ts\nRoute path builders\ngetTaskDetailPath, getTaskDisplayId"]
    TU --> TPU["TaskPayloadUtils.ts\ngetDescriptionDiff\ngetNormalizedTaskPayload"]

    RDP["RequestDescriptionPage"] --> TASU
    RDP --> TEFU
    RDP --> TFU

    UDP["UpdateDescriptionPage"] --> TASU
    UDP --> TEFU
    UDP --> TFU

    RTP["RequestTagPage"] --> TASU
    RTP --> TEFU
    RTP --> TFU

    UTP["UpdateTagPage"] --> TASU
    UTP --> TEFU
    UTP --> TFU

    ET["EntityTasks"] --> TFU
    ET --> TNU

    IH["IncidentManagerPageHeader"] --> TNU
    TC["TestCaseStatusModal"] --> TASU

    LEGACY["Existing consumers\n(ActivityFeed, Glossary, Tags…)"] --> TU
Loading

Reviews (2): Last reviewed commit: "fix(ui): resolve tasks data quality lazy..." | Re-trigger Greptile

@shah-harshit shah-harshit requested a review from a team as a code owner June 18, 2026 10:32
@shah-harshit shah-harshit added UI UI specific issues safe to test Add this label to run secure Github workflows on PRs skip-pr-checks Bypass PR metadata validation check labels Jun 18, 2026
@shah-harshit shah-harshit self-assigned this Jun 18, 2026
@shah-harshit shah-harshit changed the base branch from main to feat/dashboard-lcp-parent June 18, 2026 10:59
@gitar-bot

gitar-bot Bot commented Jun 18, 2026

Copy link
Copy Markdown
Code Review ✅ Approved 1 resolved / 1 findings

Refactors monolithic task utilities into six focused modules to optimize UI loading, while resolving the build error caused by an incorrect import in FailedTestCaseSampleData.component.tsx.

✅ 1 resolved
Bug: Import from non-existent module EntityDisplayPureUtils

📄 openmetadata-ui/src/main/resources/ui/src/components/DataQuality/IncidentManager/FailedTestCaseSampleData/FailedTestCaseSampleData.component.tsx:36
In FailedTestCaseSampleData.component.tsx the import of getEntityDeleteMessage was changed from ../../../../utils/EntityDisplayUtils to ../../../../utils/EntityDisplayPureUtils:

import { getEntityDeleteMessage } from '../../../../utils/EntityDisplayPureUtils';

However, no EntityDisplayPureUtils module exists in the codebase. The only file is src/utils/EntityDisplayUtils.tsx, which is where getEntityDeleteMessage is actually defined and where every other call site still imports it from. This unresolved module import will break the build (module-not-found) and crash the IncidentManager FailedTestCaseSampleData flow at load time.

This change also appears unrelated to the stated purpose of the PR (splitting task/data-quality utilities). Either revert the import back to EntityDisplayUtils, or create the EntityDisplayPureUtils module and move getEntityDeleteMessage there (updating all other importers accordingly).

Options

Display: compact → Showing less information.

Comment with these commands to change:

Compact
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Gitar

@github-actions

Copy link
Copy Markdown
Contributor

Jest test Coverage

UI tests summary

Lines Statements Branches Functions
Coverage: 62%
62.28% (66637/106981) 44.04% (37261/84607) 45.38% (11189/24655)

@sonarqubecloud

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

safe to test Add this label to run secure Github workflows on PRs skip-pr-checks Bypass PR metadata validation check UI UI specific issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant