Skip to content

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

Merged
shah-harshit merged 4 commits into
mainfrom
feat/extract-service-pure-utils
Jun 5, 2026
Merged

shah-harshit merged 4 commits into
mainfrom
feat/extract-service-pure-utils

Conversation

@shah-harshit

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

Copy link
Copy Markdown
Contributor

Summary

  • Extract 16 pure functions from ServiceUtils.tsx → ServicePureUtils.ts
  • Extract 7 pure functions from ServiceInsightsTabUtils.tsx → ServiceInsightsTabPureUtils.ts
  • Extract getServiceInsightsWidgetPlaceholder component → ServiceInsightsWidgets.tsx
  • Extract getDatabaseConfig + schema loaders from DatabaseServiceUtils.tsx → DatabaseServicePureUtils.ts
  • All original files re-export moved symbols — zero breaking import paths

Extracted Modules

ServicePureUtils.ts (16 functions)

getIngestionName, shouldTestConnection, getServiceType, getServiceTypesFromServiceCategory, getServiceRouteFromServiceType, getSearchIndexForService, getResourceEntityFromServiceCategory, getCountLabel, getTestConnectionName, getServiceCategoryFromEntityType, getEntityTypeFromServiceCategory, getServiceDisplayNameQueryFilter, getServiceNameQueryFilter, getActiveFieldNameForAppDocs, getReadableCountString, getSearchIndexFromService

ServiceInsightsTabPureUtils.ts (7 functions)

getAssetsByServiceType, getTitleByChartType, getChartTypeForWidget, getPlatformInsightsChartDataFormattingMethod, filterDistributionChartItem, getChartsDataFromWidgetName, getAutoPilotIngestionPipelines

ServiceInsightsWidgets.tsx (1 component)

getServiceInsightsWidgetPlaceholder

DatabaseServicePureUtils.ts (1 export + private helpers)

getDatabaseConfig, databaseSchemaLoaders, resolveSchemaModule

Retained (impure/JSX)

Function File Reason
getOptionalFields ServiceUtils.tsx Returns JSX
getLinkForFqn ServiceUtils.tsx Uses entityUtilClassBase singleton
getAddServiceEntityBreadcrumb ServiceUtils.tsx Depends on RouterUtils
searchServiceByExactName ServiceUtils.tsx Async API call
validateServiceName ServiceUtils.tsx Async API call
processDocMarkdown ServiceUtils.tsx Uses MarkdownToHTMLConverter
getFormattedTotalAssetsDataFromSocketData ServiceInsightsTabUtils.tsx Uses getEntityIcon (JSX)
ExtraDatabaseServiceDropdownOptions DatabaseServiceUtils.tsx Uses hooks + JSX

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

Test plan

  • npx tsc --noEmit — 0 errors in changed files
  • All 39 existing unit tests pass (ServiceUtils, ServiceInsightsTabUtils, DatabaseServiceUtils)
  • No circular dependencies — new files never import from originals
  • Re-exports verified — existing import paths unbroken

🤖 Generated with Claude Code

@shah-harshit
shah-harshit requested a review from a team as a code owner June 4, 2026 06:58
@shah-harshit shah-harshit self-assigned this Jun 4, 2026
@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
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]>
@github-actions

github-actions Bot commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

Hi there 👋 Thanks for your contribution!

The OpenMetadata team will review the PR shortly! Once it has been labeled as safe to test, the CI workflows
will start executing and we'll be able to make sure everything is working as expected.

Let us know if you need any help!

@shah-harshit
shah-harshit force-pushed the feat/extract-service-pure-utils branch from 8bb24f1 to 0d8b2e9 Compare June 4, 2026 06:59
@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.41% (67269/106077) 44.31% (36975/83440) 46.63% (11026/23645)

@github-actions

github-actions Bot commented Jun 4, 2026 •

Copy link
Copy Markdown
Contributor

🟡 Playwright Results — all passed (16 flaky)

✅ 4264 passed · ❌ 0 failed · 🟡 16 flaky · ⏭️ 88 skipped

Shard Passed Failed Flaky Skipped
✅ Shard 1 301 0 0 4
🟡 Shard 2 803 0 1 9
🟡 Shard 3 804 0 1 8
🟡 Shard 4 848 0 7 12
🟡 Shard 5 719 0 2 47
🟡 Shard 6 789 0 5 8
🟡 16 flaky test(s) (passed on retry)
  • Features/Glossary/GlossaryWorkflow.spec.ts › should display correct status badge color and icon (shard 2, 1 retry)
  • Features/KnowledgeCenter.spec.ts › User Mentions in article and redirect should work of Knowledge Center page (shard 3, 1 retry)
  • Pages/CustomProperties.spec.ts › Create custom property and configure search for Dashboard (shard 4, 1 retry)
  • Pages/CustomProperties.spec.ts › Entity Reference (shard 4, 1 retry)
  • Pages/CustomProperties.spec.ts › Timestamp (shard 4, 2 retries)
  • Pages/CustomProperties.spec.ts › Date Time (shard 4, 2 retries)
  • Pages/CustomProperties.spec.ts › Entity Reference List (shard 4, 2 retries)
  • Pages/CustomProperties.spec.ts › Set enum custom property on column and verify in UI (shard 4, 2 retries)
  • Pages/DataContracts.spec.ts › Contract Status badge should be visible on condition if Contract Tab is present/hidden by Persona (shard 4, 1 retry)
  • Pages/Entity.spec.ts › User as Owner with unsorted list (shard 5, 1 retry)
  • Pages/Entity.spec.ts › User as Owner with unsorted list (shard 5, 1 retry)
  • Features/AutoPilot.spec.ts › Create Service and check the AutoPilot status (shard 6, 1 retry)
  • Pages/Glossary.spec.ts › Glossary Term Update in Glossary Page should persist tree (shard 6, 1 retry)
  • Pages/Lineage/LineageFilters.spec.ts › Verify lineage service filter selection (shard 6, 1 retry)
  • Pages/Lineage/LineageFilters.spec.ts › Verify lineage schema filter selection (shard 6, 1 retry)
  • Pages/UserDetails.spec.ts › Create team with domain and verify visibility of inherited domain in user profile after team removal (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 merged commit 026222f into main Jun 5, 2026
48 of 49 checks passed
@shah-harshit
shah-harshit deleted the feat/extract-service-pure-utils branch June 5, 2026 04:43
@gitar-bot

gitar-bot Bot commented Jun 5, 2026

Copy link
Copy Markdown
Code Review ✅ Approved

Refactors service utilities and widgets into pure modules to improve code maintainability. No issues were found and backward compatibility is maintained via existing file re-exports.

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
* 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]>
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 — 124e24e2 Deployed Jun 4, 2026 by shah-harshit via playwright-ci-postgresql (6, 6) #49842
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