Skip to content

feat(ui): extract EntityVersion/Diff pure utils and lazy-load version components - #28687

Merged
shah-harshit merged 5 commits into
mainfrom
feat/extract-entity-version-utils
Jun 5, 2026
Merged

shah-harshit merged 5 commits into
mainfrom
feat/extract-entity-version-utils

Conversation

@shah-harshit

@shah-harshit shah-harshit commented Jun 4, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Split monolithic EntityVersionUtils.tsx (~1420 lines) into 4 focused modules:
    • EntityDiffPureUtils.ts — 8 pure diff accessor functions (no React dependencies)
    • EntityDiffUtils.tsx — 9 JSX diff rendering functions
    • EntityVersionUtilsPure.ts — 31 pure version processing functions
    • EntityVersionClassBase.ts — lazy-load component registry for version pages
  • Slimmed EntityVersionUtils.tsx to ~340 lines with re-exports for backward compatibility
  • Migrated EntityVersionPage to use lazy-loaded components via EntityVersionClassBase + Suspense
  • Updated 6 consumer files to import directly from new modules

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

Test plan

  • Verify version pages render correctly for all entity types (Table, Topic, Dashboard, Pipeline, etc.)
  • Verify version diff highlighting works (added/removed/updated fields)
  • Verify version timeline and summary display correctly
  • Verify lazy-loaded components show loader fallback during chunk loading
  • Run existing unit tests: yarn test
  • Run TypeScript type check: npx tsc --noEmit

🤖 Generated with Claude Code

… components

Split monolithic EntityVersionUtils.tsx (~1420 lines) into focused modules:
- EntityDiffPureUtils.ts: pure diff accessor functions (no React deps)
- EntityDiffUtils.tsx: JSX diff rendering functions
- EntityVersionUtilsPure.ts: pure version processing logic
- EntityVersionClassBase.ts: lazy-load registry for version components
EntityVersionUtils.tsx re-exports all symbols for backward compatibility.
EntityVersionPage now uses lazy-loaded components via EntityVersionClassBase.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
@shah-harshit
shah-harshit requested a review from a team as a code owner June 4, 2026 05:59
@shah-harshit shah-harshit added UI UI specific issues safe to test Add this label to run secure Github workflows on PRs labels Jun 4, 2026
@shah-harshit shah-harshit self-assigned this Jun 4, 2026
@github-actions

github-actions Bot commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

Jest test Coverage

UI tests summary

Lines Statements Branches Functions
Coverage: 63%
63.27% (66932/105787) 44.21% (36896/83451) 46.28% (10934/23621)

@github-actions

github-actions Bot commented Jun 4, 2026 •

Copy link
Copy Markdown
Contributor

🟡 Playwright Results — all passed (17 flaky)

✅ 4256 passed · ❌ 0 failed · 🟡 17 flaky · ⏭️ 88 skipped

Shard Passed Failed Flaky Skipped
✅ Shard 1 299 0 0 4
✅ Shard 2 803 0 0 9
🟡 Shard 3 801 0 3 8
🟡 Shard 4 846 0 8 12
✅ Shard 5 720 0 0 47
🟡 Shard 6 787 0 6 8
🟡 17 flaky test(s) (passed on retry)
  • Features/KnowledgeCenterTextEditor.spec.ts › Rich Text Editor - Text Formatting (shard 3, 1 retry)
  • Features/RTL.spec.ts › Verify Following widget functionality (shard 3, 1 retry)
  • Features/TestSuitePipelineRedeploy.spec.ts › Re-deploy all test-suite ingestion pipelines (shard 3, 1 retry)
  • Flow/PersonaFlow.spec.ts › Set default persona for team should work properly (shard 4, 1 retry)
  • Pages/CustomProperties.spec.ts › String (shard 4, 1 retry)
  • Pages/CustomProperties.spec.ts › Sql Query (shard 4, 1 retry)
  • Pages/CustomProperties.spec.ts › Entity Reference List (shard 4, 1 retry)
  • Pages/CustomProperties.spec.ts › Set & Update all CP types on apiCollection (shard 4, 1 retry)
  • Pages/CustomProperties.spec.ts › Sql Query (shard 4, 1 retry)
  • Pages/CustomProperties.spec.ts › Time (shard 4, 1 retry)
  • Pages/DataContractInheritance.spec.ts › Edit Asset Contract - Add SLA when inheriting SLA from Data Product (PATCH should use /add not /replace) (shard 4, 1 retry)
  • Pages/Lineage/LineageFilters.spec.ts › Verify lineage schema filter selection (shard 6, 1 retry)
  • Pages/Lineage/LineageRightPanel.spec.ts › Verify custom properties tab IS visible for supported type: searchIndex (shard 6, 1 retry)
  • Pages/Lineage/PlatformLineage.spec.ts › Verify domain platform view (shard 6, 1 retry)
  • Pages/LogsViewer.spec.ts › Logs page shows breadcrumb, summary, and log viewer or empty state after opening from bundle suite pipeline tab (shard 6, 1 retry)
  • Pages/ServiceEntity.spec.ts › Team as Owner Add, Update and Remove (shard 6, 1 retry)
  • Pages/Users.spec.ts › Reset Password for Data Consumer (shard 6, 1 retry)

📦 Download artifacts

How to debug locally
# Download playwright-test-results-<shard> artifact and unzip
npx playwright show-trace path/to/trace.zip    # view trace

@sonarqubecloud

sonarqubecloud Bot commented Jun 4, 2026

Copy link
Copy Markdown

@shah-harshit
shah-harshit enabled auto-merge (squash) June 4, 2026 16:08
@shah-harshit
shah-harshit merged commit e6371dd into main Jun 5, 2026
48 of 49 checks passed
@shah-harshit
shah-harshit deleted the feat/extract-entity-version-utils branch June 5, 2026 04:44
@gitar-bot

gitar-bot Bot commented Jun 5, 2026

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

Refactors the monolithic EntityVersionUtils into modular, lazy-loaded components and type-safe utilities. The transition to VersionComponentType resolves the previous use of 'any' generics.

✅ 1 resolved
✅ Quality: Use of any in EntityVersionClassBase generics

📄 openmetadata-ui/src/main/resources/ui/src/utils/EntityVersionClassBase.ts:19-21 📄 openmetadata-ui/src/main/resources/ui/src/utils/EntityVersionClassBase.ts:116-120
EntityVersionClassBase types its component registry and getter with ComponentType<any> (componentMap: Partial<Record<EntityType, LazyExoticComponent<ComponentType<any>>>> and getEntityVersionComponent(): LazyExoticComponent<ComponentType<any>> | null). The project's frontend conventions explicitly disallow any (prefer unknown + guards, or a typed prop contract). Since all registered version components share the same prop shape (backHandler, currentVersionData, deleted, domains, entityPermissions, isVersionLoading, owners, tier, version, versionHandler, versionList, etc.), a shared props interface would be more accurate and type-safe than any. Functionally this works, but it weakens type checking at every call site in EntityVersionPage and conflicts with the stated lint rule.

Options

Display: compact → Showing less information.

Comment with these commands to change:

Compact
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Gitar

shah-harshit added a commit that referenced this pull request Jul 14, 2026
… components (#28687)

* feat(ui): extract EntityVersion/Diff pure utils and lazy-load version components

Split monolithic EntityVersionUtils.tsx (~1420 lines) into focused modules:
- EntityDiffPureUtils.ts: pure diff accessor functions (no React deps)
- EntityDiffUtils.tsx: JSX diff rendering functions
- EntityVersionUtilsPure.ts: pure version processing logic
- EntityVersionClassBase.ts: lazy-load registry for version components
EntityVersionUtils.tsx re-exports all symbols for backward compatibility.
EntityVersionPage now uses lazy-loaded components via EntityVersionClassBase.

Co-Authored-By: Claude Opus 4.6 <[email protected]>

* fix(ui): replace ComponentType<any> with typed VersionComponentType in EntityVersionClassBase

Co-Authored-By: Claude Opus 4.6 <[email protected]>

* fix checkstyle

* fix(pr5): convert type-only imports to import type across all changed files

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>

* fix checkstyle

---------

Co-authored-by: Claude Opus 4.6 <[email protected]>
shah-harshit added a commit that referenced this pull request Jul 14, 2026
* feat(ui): extract FeedUtilsPure from FeedUtils (#28672)

* feat(ui): extract FeedUtilsPure from FeedUtils

Move 31 non-JSX functions from FeedUtils.tsx to FeedUtilsPure.ts.
FeedUtils.tsx re-exports all moved symbols for backward compatibility.

Co-Authored-By: Claude Opus 4.6 <[email protected]>

* fix checkstyle

---------

Co-authored-by: Claude Opus 4.6 <[email protected]>

* feat(ui): extract TablePureUtils and TagsPureUtils (#28673)

* feat(ui): extract TablePureUtils and TagsPureUtils

Move 43 pure functions from TableUtils.tsx to TablePureUtils.ts and
5 functions from TagsUtils.tsx to TagsPureUtils.ts. Both original files
re-export all moved symbols for backward compatibility.

Co-Authored-By: Claude Opus 4.6 <[email protected]>

* fix checkstyle

---------

Co-authored-by: Claude Opus 4.6 <[email protected]>

* feat(ui): extract DataProductPureUtils, DataInsightPureUtils, DataQualityPureUtils (#28701)

* feat(ui): extract DataProductPureUtils, DataInsightPureUtils, DataQualityPureUtils

Move pure (no-JSX, no-API, no-singleton) functions from DataProductUtils.tsx,
DataInsightUtils.tsx, and DataQualityUtils.tsx into dedicated *PureUtils.ts files.
Originals re-export all moved symbols for backward compat.

- DataProductPureUtils.ts: convertDataProductsToEntityReferences,
  convertEntityReferencesToDataProducts, getQueryFilterForDataProductPorts
- DataInsightPureUtils.ts: getEntryFormattedValue, getGraphDataByEntityType,
  getFormattedActiveUsersData, getDisabledDates, getDataInsightPathWithFqn,
  getOptionalDataInsightTabFlag, sortEntityByValue, getRandomHexColor,
  isPercentageSystemGraph, getQueryFilterForDataInsightChart (+ 3 private helpers)
- DataQualityPureUtils.ts: 27 symbols including buildTestCaseParams,
  createUpdatedTestCasePatch, buildDataQualityDashboardFilters, getDimensionIcon,
  calculateTestCaseStatusCounts, transformToTestCaseStatusByDimension, etc.

All type-only imports use import type. 78 existing tests still pass.

Co-Authored-By: Claude Opus 4.6 <[email protected]>

* chore(ui): apply prettier formatting to PR7 pure utils files

Co-Authored-By: Claude Opus 4.6 <[email protected]>

---------

Co-authored-by: Claude Opus 4.6 <[email protected]>

* feat(ui): extract pure service utils and widget components (#28692)

* feat(ui): extract pure service utils and widget components

Extract 26 pure functions from ServiceUtils.tsx, ServiceInsightsTabUtils.tsx,
and DatabaseServiceUtils.tsx into dedicated pure util modules. Promote
getServiceInsightsWidgetPlaceholder to standalone component file. All original
files re-export moved symbols for backward compatibility.

Co-Authored-By: Claude Opus 4.6 <[email protected]>

* Fix checkstyle

---------

Co-authored-by: Claude Opus 4.6 <[email protected]>

* feat(ui): extract EntityVersion/Diff pure utils and lazy-load version components (#28687)

* feat(ui): extract EntityVersion/Diff pure utils and lazy-load version components

Split monolithic EntityVersionUtils.tsx (~1420 lines) into focused modules:
- EntityDiffPureUtils.ts: pure diff accessor functions (no React deps)
- EntityDiffUtils.tsx: JSX diff rendering functions
- EntityVersionUtilsPure.ts: pure version processing logic
- EntityVersionClassBase.ts: lazy-load registry for version components
EntityVersionUtils.tsx re-exports all symbols for backward compatibility.
EntityVersionPage now uses lazy-loaded components via EntityVersionClassBase.

Co-Authored-By: Claude Opus 4.6 <[email protected]>

* fix(ui): replace ComponentType<any> with typed VersionComponentType in EntityVersionClassBase

Co-Authored-By: Claude Opus 4.6 <[email protected]>

* fix checkstyle

* fix(pr5): convert type-only imports to import type across all changed files

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>

* fix checkstyle

---------

Co-authored-by: Claude Opus 4.6 <[email protected]>

* fix(ui): adapt feed utils backport to 1.13 APIs

* fix(ui): preserve 1.13 utility contracts

* fix(ui): align feed utils test mock with split helper

* fix(ui): scope feed count helpers for 1.13

---------

Co-authored-by: Claude Opus 4.6 <[email protected]>

This branch was previously deployed

1 inactive deployment
test — 55d6feca Deployed Jun 4, 2026 by shah-harshit via playwright-ci-postgresql (3, 6) #49799
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 UI UI specific issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants