Skip to content

Backport Group 2 utility extractions to 1.13#30020

Open
shah-harshit wants to merge 9 commits into
1.13from
ui/backport-28672-feed-utils-1.13
Open

Backport Group 2 utility extractions to 1.13#30020
shah-harshit wants to merge 9 commits into
1.13from
ui/backport-28672-feed-utils-1.13

Conversation

@shah-harshit

@shah-harshit shah-harshit commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Summary

Testing

  • organize-imports-cli on all changed UI source files
  • eslint --fix on all changed UI source files
  • prettier --write on all changed UI source files
  • git diff --check

Greptile Summary

This PR backports utility extraction work for the 1.13 UI branch. The main changes are:

  • New pure utility modules for feed, table, tags, services, data quality, data insight, data products, entity diffs, and entity versions.
  • Existing utility files re-export extracted helpers for compatibility.
  • Entity version pages now load version components through the version class base.
  • Feed utility changes keep the 1.13 feed count and thread-header behavior.

Confidence Score: 5/5

This looks safe to merge.

  • No blocking issues found in the changed code.
  • The feed compatibility fixes remove the missing API and model references covered by the earlier review.
  • The remaining feed count path uses the branch-compatible feed count aggregation.

Important Files Changed

Filename Overview
openmetadata-ui/src/main/resources/ui/src/utils/FeedUtilsPure.ts Adds extracted feed helpers using the branch-compatible feed count API.
openmetadata-ui/src/main/resources/ui/src/utils/FeedUtils.tsx Keeps UI-specific feed rendering helpers and re-exports the extracted feed utilities.
openmetadata-ui/src/main/resources/ui/src/pages/EntityVersionPage/EntityVersionPage.component.tsx Switches entity version component loading to the version class base with suspense wrapping.

Reviews (6): Last reviewed commit: "fix(ui): scope feed count helpers for 1...." | Re-trigger Greptile

Context used (3)

  • Context used - CLAUDE.md (source)
  • Context used - openmetadata-ui-core-components/CLAUDE.md (source)
  • Context used - AGENTS.md (source)

* 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 <noreply@anthropic.com>

* fix checkstyle

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
@shah-harshit shah-harshit requested a review from a team as a code owner July 14, 2026 06:53
@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 Jul 14, 2026
@shah-harshit shah-harshit self-assigned this Jul 14, 2026
Comment thread openmetadata-ui/src/main/resources/ui/src/utils/FeedUtilsPure.ts Outdated
Comment thread openmetadata-ui/src/main/resources/ui/src/utils/FeedUtils.tsx Outdated
Comment thread openmetadata-ui/src/main/resources/ui/src/utils/FeedUtils.tsx Outdated
Comment thread openmetadata-ui/src/main/resources/ui/src/utils/FeedUtilsPure.ts Outdated
* 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 <noreply@anthropic.com>

* fix checkstyle

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown
Contributor

The Python checkstyle failed.

Please run make py_format and py_format_check in the root of your repository and commit the changes to this PR.
You can also use pre-commit to automate the Python code formatting.

You can install the pre-commit hooks with make install_test precommit_install.

shah-harshit and others added 3 commits July 14, 2026 12:30
…lityPureUtils (#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 <noreply@anthropic.com>

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

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
* 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 <noreply@anthropic.com>

* Fix checkstyle

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
… 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 <noreply@anthropic.com>

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

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix checkstyle

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

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* fix checkstyle

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
@shah-harshit shah-harshit changed the title Backport FeedUtilsPure extraction to 1.13 Backport Group 2 utility extractions to 1.13 Jul 14, 2026
@github-actions

Copy link
Copy Markdown
Contributor

The Python checkstyle failed.

Please run make py_format and py_format_check in the root of your repository and commit the changes to this PR.
You can also use pre-commit to automate the Python code formatting.

You can install the pre-commit hooks with make install_test precommit_install.

@github-actions

Copy link
Copy Markdown
Contributor

The Python checkstyle failed.

Please run make py_format and py_format_check in the root of your repository and commit the changes to this PR.
You can also use pre-commit to automate the Python code formatting.

You can install the pre-commit hooks with make install_test precommit_install.

Comment thread openmetadata-ui/src/main/resources/ui/src/utils/FeedUtilsPure.ts Outdated
Comment thread openmetadata-ui/src/main/resources/ui/src/utils/FeedUtilsPure.ts Outdated
@github-actions

github-actions Bot commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

🟡 Playwright Results — all passed (1 flaky)

✅ 290 passed · ❌ 0 failed · 🟡 1 flaky · ⏭️ 4 skipped

Shard Passed Failed Flaky Skipped
🟡 Shard 1 290 0 1 4
✅ Shard 2 0 0 0 0
🟡 1 flaky test(s) (passed on retry)
  • Flow/Metric.spec.ts › Verify Granularity Update (shard 1, 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

@github-actions

github-actions Bot commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Jest test Coverage

UI tests summary

Lines Statements Branches Functions
Coverage: 64%
64.27% (61910/96315) 44.67% (33229/74380) 47.7% (10071/21109)

@github-actions

Copy link
Copy Markdown
Contributor

The Python checkstyle failed.

Please run make py_format and py_format_check in the root of your repository and commit the changes to this PR.
You can also use pre-commit to automate the Python code formatting.

You can install the pre-commit hooks with make install_test precommit_install.

@gitar-bot

gitar-bot Bot commented Jul 14, 2026

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

Backports Group 2 utility extractions to 1.13, resolving import discrepancies and aligning API contracts for feed and versioning logic. No issues found.

✅ 3 resolved
Bug: Backport imports APIs/types that don't exist in 1.13

📄 openmetadata-ui/src/main/resources/ui/src/utils/FeedUtilsPure.ts:42-47 📄 openmetadata-ui/src/main/resources/ui/src/utils/FeedUtilsPure.ts:562-576 📄 openmetadata-ui/src/main/resources/ui/src/utils/FeedUtils.tsx:27 📄 openmetadata-ui/src/main/resources/ui/src/utils/FeedUtils.tsx:370-384
FeedUtilsPure.ts imports getEntityActivityByFqn from '../rest/feedsAPI' and getTaskCounts from '../rest/tasksAPI', and FeedUtils.tsx imports ActivityEventType from '../generated/entity/activity/activityEvent'. None of these exist in the 1.13 branch: rest/tasksAPI.ts and generated/entity/activity/activityEvent.ts are absent, and neither getEntityActivityByFqn nor getTaskCounts is exported anywhere (the only references are inside the new file itself). These are TypeScript compile errors that will break the UI build. The activity-event feature/API these depend on must be backported first, or getFeedCounts/fetchEntityActivityCountInto/fetchEntityTaskCountsInto and getActivityEventHeaderText must be reimplemented against the APIs that actually exist in 1.13 (e.g., the older getFeedCount/task-count endpoints).

Performance: fetchEntityTaskCountsInto fetches all feed counts unfiltered

📄 openmetadata-ui/src/main/resources/ui/src/utils/FeedUtilsPure.ts:613-616 📄 openmetadata-ui/src/main/resources/ui/src/utils/FeedUtilsPure.ts:610 📄 openmetadata-ui/src/main/resources/ui/src/utils/FeedUtilsPure.ts:640
getFeedCount() is called with no entityLink, so it hits /feed/count unscoped and returns counts for every entity in the deployment, which are then filtered client-side to a single entityFqn. On large instances this transfers and processes a potentially huge payload just to read one entity's task counts. Since this helper only receives entityFqn (not entityType), consider passing an entityLink built from the FQN, or a backend-scoped filter, instead of fetching everything and filtering in JS.

Bug: Dead else branch: getFeedCount always returns an array

📄 openmetadata-ui/src/main/resources/ui/src/utils/FeedUtilsPure.ts:595-601
getFeedCount returns response.data.data (an EntityFieldThreadCount[]) which is always truthy — even an empty result is [], never null/undefined. Therefore if (counts) { ... } else { throw ... } never reaches the else branch, so the intended error path for a missing/empty response is dead code. If the goal is to error when no counts come back, check counts?.length or handle the empty case explicitly; otherwise drop the else.

Options

Display: compact → Showing less information.

Comment with these commands to change the behavior for this request:

Compact
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Gitar

@github-actions

Copy link
Copy Markdown
Contributor

The Python checkstyle failed.

Please run make py_format and py_format_check in the root of your repository and commit the changes to this PR.
You can also use pre-commit to automate the Python code formatting.

You can install the pre-commit hooks with make install_test precommit_install.

@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