Repository navigation
Fixes 33885: stop the REST layer importing UI modules and enforce it - #33886
Conversation
✅ PR checks passedThe linked issue has a description and all required Shipping project fields set. Thanks! |
✅ Playwright Results — workflow succeededValidated commit ✅ 4603 passed · ❌ 0 failed · 🟡 2 flaky · ⏭️ 1 skipped · 🧰 0 lifecycle flaky PerformanceBlocking targets: ✅ met · Optimization targets: 🟡 in progress Shard-job maxima below are not the full workflow wall time; the linked run includes build, fixture, planning, and reporting. 🕒 Full workflow signal wall (to summary) 39m 12s ⏱️ Max setup 4m 40s · max shard execution 22m 41s · max shard-job elapsed before upload 26m 18s · reporting 22s 🌐 122.46 requests/attempt · 2.24 app boots/UI scenario · 43.13% common-shard skew Optimization targets still in progress:
🟡 2 flaky test(s) (passed on retry)
How to debug locally# Download playwright-test-results-<shard> artifact and unzip
npx playwright show-trace path/to/trace.zip # view trace |
|
Collate side of this change: open-metadata/openmetadata-collate#6831 (draft) repoints Collate's imports of the 8 re-exported types to their new locations. Merge order: this PR first, then #6831, then a small follow-up here deletes the 8 re-exports. |
🔄 Playwright impact map auto-refreshedThis PR touched specs or UI source that changed the source→spec routing map. I regenerated What is this file? It is the auto-generated half of Playwright's PR planner. It routes "if source X changes, run specs Y" by walking spec imports and cross-referencing What if I want to regenerate locally instead? Run this before pushing your next change to skip the bot commit: python3 .github/scripts/generate_playwright_impact_map.py
git add .github/playwright/impact-map.generated.json
git commit --amend --no-edit # or a separate commit |
|
| Count | Rule |
|---|---|
| 547 | react-hooks/exhaustive-deps |
| 74 | no-restricted-imports |
| 40 | openmetadata-imports/no-lower-layer-page-imports |
| 38 | openmetadata-imports/review-sequential-api-calls |
| 19 | openmetadata-imports/no-impure-pure-utils |
| 13 | openmetadata-imports/no-circular-imports |
| 12 | openmetadata-ui-patterns/no-non-adaptive-palette |
| 12 | openmetadata-imports/no-cross-page-imports |
| 6 | openmetadata-imports/no-api-calls-in-iteration |
All findings
| Location | Rule | Message | |
|---|---|---|---|
| 🟡 | src/components/Alerts/AlertDetails/AlertConfigDetails/AlertConfigDetails.tsx:28:1 |
openmetadata-imports/no-lower-layer-page-imports |
Pages are route-level composition modules. Move the shared implementation/type to a lower layer instead of importing a page from here. |
| 🟡 | src/components/Alerts/AlertDetails/AlertConfigDetails/AlertConfigDetails.tsx:107:6 |
react-hooks/exhaustive-deps |
React Hook useCallback has a missing dependency: 't'. Either include it or remove the dependency array. |
| 🟡 | src/components/Alerts/AlertDetails/AlertConfigDetails/AlertConfigDetails.tsx:138:6 |
react-hooks/exhaustive-deps |
React Hook useCallback has missing dependencies: 'getResourcePermission' and 't'. Either include them or remove the dependency array. |
| 🟡 | src/components/Alerts/AlertDetails/AlertConfigDetails/AlertConfigDetails.tsx:144:6 |
react-hooks/exhaustive-deps |
React Hook useEffect has a missing dependency: 'fetchTemplates'. Either include it or remove the dependency array. |
| 🟡 | src/components/Alerts/AlertDetails/AlertConfigDetails/AlertConfigDetails.tsx:148:6 |
react-hooks/exhaustive-deps |
React Hook useEffect has a missing dependency: 'fetchFunctions'. Either include it or remove the dependency array. Outer scope values like 'Fqn' aren't valid de |
| 🟡 | src/components/AppRouter/EntityImportRouter.tsx:72:6 |
react-hooks/exhaustive-deps |
React Hook useEffect has a missing dependency: 'navigate'. Either include it or remove the dependency array. |
| 🟡 | src/components/Chart/ChartDetails/ChartDetails.component.tsx:91:6 |
react-hooks/exhaustive-deps |
React Hook useMemo has a missing dependency: 'chartDetails'. Either include it or remove the dependency array. |
| 🟡 | src/components/Chart/ChartDetails/ChartDetails.component.tsx:123:6 |
react-hooks/exhaustive-deps |
React Hook useEffect has a missing dependency: 't'. Either include it or remove the dependency array. |
| 🟡 | src/components/Chart/ChartDetails/ChartDetails.component.tsx:151:6 |
react-hooks/exhaustive-deps |
React Hook useEffect has missing dependencies: 'fetchActivityCount' and 'fetchTaskCounts'. Either include them or remove the dependency array. |
| 🟡 | src/components/Chart/ChartDetails/ChartDetails.component.tsx:254:6 |
react-hooks/exhaustive-deps |
React Hook useMemo has missing dependencies: 'feedCount', 'fetchChart', 'getEntityFeedCount', and 'viewCustomPropertiesPermission'. Either include them or remov |
| 🟡 | src/components/Chart/ChartDetails/ChartDetails.component.tsx:288:5 |
react-hooks/exhaustive-deps |
React Hook useMemo has a missing dependency: 'tabs'. Either include it or remove the dependency array. |
| 🟡 | src/components/Chart/ChartDetails/ChartDetails.component.tsx:288:6 |
react-hooks/exhaustive-deps |
React Hook useMemo has a complex expression in the dependency array. Extract it to a separate variable so it can be statically checked. |
| 🟡 | src/components/Classifications/ClassificationDetails/ClassificationDetails.tsx:303:8 |
react-hooks/exhaustive-deps |
React Hook useCallback has missing dependencies: 'isVersionView' and 'navigate'. Either include them or remove the dependency array. |
| 🟡 | src/components/Classifications/ClassificationDetails/ClassificationDetails.tsx:467:8 |
react-hooks/exhaustive-deps |
React Hook useMemo has a missing dependency: 't'. Either include it or remove the dependency array. |
| 🟡 | src/components/Classifications/ClassificationDetails/ClassificationDetails.tsx:543:7 |
react-hooks/exhaustive-deps |
React Hook useMemo has a missing dependency: 't'. Either include it or remove the dependency array. |
| 🟡 | src/components/Classifications/ClassificationDetails/ClassificationDetails.tsx:593:8 |
react-hooks/exhaustive-deps |
React Hook useEffect has missing dependencies: 'fetchClassificationChildren', 'handlePageChange', and 'isAddingTag'. Either include them or remove the dependenc |
| 🟡 | src/components/Dashboard/DashboardChartTable/DashboardChartTable.tsx:105:6 |
react-hooks/exhaustive-deps |
React Hook useCallback has a missing dependency: 'getEntityPermission'. Either include it or remove the dependency array. |
| 🟡 | src/components/Dashboard/DashboardChartTable/DashboardChartTable.tsx:130:5 |
react-hooks/exhaustive-deps |
React Hook useCallback has missing dependencies: 'fetchChartPermissions' and 't'. Either include them or remove the dependency array. |
| 🟡 | src/components/Dashboard/DashboardChartTable/DashboardChartTable.tsx:137:6 |
react-hooks/exhaustive-deps |
React Hook useEffect has a missing dependency: 'getAllChartsPermissions'. Either include it or remove the dependency array. |
| 🟡 | src/components/Dashboard/DashboardChartTable/DashboardChartTable.tsx:157:6 |
react-hooks/exhaustive-deps |
React Hook useCallback has a missing dependency: 't'. Either include it or remove the dependency array. |
| 🟡 | src/components/Dashboard/DashboardChartTable/DashboardChartTable.tsx:297:5 |
react-hooks/exhaustive-deps |
React Hook useCallback has an unnecessary dependency: 'chartFilters'. Either exclude it or remove the dependency array. |
| 🟡 | src/components/Dashboard/DashboardChartTable/DashboardChartTable.tsx:408:5 |
react-hooks/exhaustive-deps |
React Hook useMemo has missing dependencies: 'dashboardDetails?.fullyQualifiedName', 'getChartPermissionFlags', 'hasEditGlossaryTermAccess', 't', 'tagFilter.Cla |
| 🟡 | src/components/Dashboard/DashboardDetails/DashboardDetails.component.tsx:97:6 |
react-hooks/exhaustive-deps |
React Hook useMemo has a missing dependency: 'dashboardDetails'. Either include it or remove the dependency array. |
| 🟡 | src/components/Dashboard/DashboardDetails/DashboardDetails.component.tsx:134:6 |
react-hooks/exhaustive-deps |
React Hook useEffect has a missing dependency: 't'. Either include it or remove the dependency array. |
| 🟡 | src/components/Dashboard/DashboardDetails/DashboardDetails.component.tsx:162:6 |
react-hooks/exhaustive-deps |
React Hook useEffect has missing dependencies: 'fetchActivityCount' and 'fetchTaskCounts'. Either include them or remove the dependency array. |
| 🟡 | src/components/Dashboard/DashboardDetails/DashboardDetails.component.tsx:187:5 |
react-hooks/exhaustive-deps |
React Hook useCallback has missing dependencies: 'dashboardDetails' and 'onDashboardUpdate'. Either include them or remove the dependency array. If 'onDashboard |
| 🟡 | src/components/Dashboard/DashboardDetails/DashboardDetails.component.tsx:279:6 |
react-hooks/exhaustive-deps |
React Hook useMemo has missing dependencies: 'customizedPage?.tabs', 'feedCount', 'fetchDashboard', 'getEntityFeedCount', and 'viewCustomPropertiesPermission'. |
| 🟡 | src/components/Dashboard/DashboardDetails/DashboardDetails.component.tsx:312:5 |
react-hooks/exhaustive-deps |
React Hook useMemo has a missing dependency: 'tabs'. Either include it or remove the dependency array. |
| 🟡 | src/components/Dashboard/DashboardDetails/DashboardDetails.component.tsx:312:6 |
react-hooks/exhaustive-deps |
React Hook useMemo has a complex expression in the dependency array. Extract it to a separate variable so it can be statically checked. |
| 🟡 | src/components/Dashboard/DataModel/DataModels/DataModelsTable.tsx:131:5 |
react-hooks/exhaustive-deps |
React Hook useCallback has a missing dependency: 'pageSize'. Either include it or remove the dependency array. |
| 🟡 | src/components/Dashboard/DataModel/DataModels/DataModelsTable.tsx:198:5 |
react-hooks/exhaustive-deps |
React Hook useCallback has a missing dependency: 'handlePagingChange'. Either include it or remove the dependency array. |
| 🟡 | src/components/Dashboard/DataModel/DataModels/DataModelsTable.tsx:242:6 |
react-hooks/exhaustive-deps |
React Hook useEffect has a missing dependency: 'searchDataModels'. Either include it or remove the dependency array. |
| 🟡 | src/components/Dashboard/DataModel/DataModels/DataModelsTable.tsx:255:6 |
react-hooks/exhaustive-deps |
React Hook useEffect has a missing dependency: 'fetchDashboardsDataModel'. Either include it or remove the dependency array. |
| 🟡 | src/components/DataAssetSummaryPanelV1/DataAssetSummaryPanelV1.tsx:396:6 |
react-hooks/exhaustive-deps |
React Hook useMemo has a missing dependency: 'dataAsset'. Either include it or remove the dependency array. |
| 🟡 | src/components/DataAssetSummaryPanelV1/DataAssetSummaryPanelV1.tsx:480:6 |
react-hooks/exhaustive-deps |
React Hook useCallback has a missing dependency: 'entityType'. Either include it or remove the dependency array. |
| 🟡 | src/components/DataAssetSummaryPanelV1/DataAssetSummaryPanelV1.tsx:573:6 |
react-hooks/exhaustive-deps |
React Hook useCallback has a missing dependency: 'dataAsset'. Either include it or remove the dependency array. |
| 🟡 | src/components/DataAssetSummaryPanelV1/DataAssetSummaryPanelV1.tsx:586:6 |
react-hooks/exhaustive-deps |
React Hook useEffect has missing dependencies: 'fetchEntityBasedDetails' and 'fetchTestCases'. Either include them or remove the dependency array. |
| 🟡 | src/components/DataAssetSummaryPanelV1/DataAssetSummaryPanelV1.tsx:980:6 |
react-hooks/exhaustive-deps |
React Hook useMemo has missing dependencies: 'changeSummaryParams.fieldPrefix', 'isColumnEntity', 'renderCommonLayoutSummary', 'renderDataProductSummary', 'rend |
| 🟡 | src/components/DataAssetSummaryPanelV1/DataAssetSummaryPanelV1.tsx:993:6 |
react-hooks/exhaustive-deps |
React Hook useEffect has a missing dependency: 'init'. Either include it or remove the dependency array. |
| 🟡 | src/components/DataAssets/AssetsSelectionModal/AssetSelectionDrawer.tsx:18:1 |
openmetadata-imports/no-lower-layer-page-imports |
Pages are route-level composition modules. Move the shared implementation/type to a lower layer instead of importing a page from here. |
| 🟡 | src/components/DataAssets/AssetsSelectionModal/AssetSelectionModal.interface.ts:52:1 |
openmetadata-imports/no-lower-layer-page-imports |
Pages are route-level composition modules. Move the shared implementation/type to a lower layer instead of importing a page from here. |
| 🟡 | src/components/DataAssets/AssetsSelectionModal/useAssetSelectionState.ts:41:1 |
openmetadata-imports/no-lower-layer-page-imports |
Pages are route-level composition modules. Move the shared implementation/type to a lower layer instead of importing a page from here. |
| 🟡 | src/components/DataAssets/AssetsSelectionModal/useAssetSelectionState.ts:157:5 |
react-hooks/exhaustive-deps |
React Hook useCallback has a missing dependency: 'activeFilter'. Either include it or remove the dependency array. |
| 🟡 | src/components/DataAssets/AssetsSelectionModal/useAssetSelectionState.ts:222:6 |
react-hooks/exhaustive-deps |
React Hook useEffect has a missing dependency: 'fetchEntities'. Either include it or remove the dependency array. |
| 🟡 | src/components/DataAssets/AssetsSelectionModal/useAssetSelectionState.ts:350:15 |
openmetadata-imports/review-sequential-api-calls |
Review these sequential API requests. If they are independent, start them together with Promise.all/Promise.allSettled; keep sequencing only when data-dependent |
| 🟡 | src/components/DataAssets/AssetsSelectionModal/useAssetSelectionState.ts:542:6 |
react-hooks/exhaustive-deps |
React Hook useEffect has missing dependencies: 'onCancel' and 'onSave'. Either include them or remove the dependency array. If 'onSave' changes too often, find |
| 🟡 | src/components/DataAssets/DataAssetsHeader/DataAssetsHeader.component.tsx:253:5 |
react-hooks/exhaustive-deps |
React Hook useMemo has a missing dependency: 'hasFollowers'. Either include it or remove the dependency array. |
| 🟡 | src/components/DataAssets/DataAssetsHeader/DataAssetsHeader.component.tsx:377:6 |
react-hooks/exhaustive-deps |
React Hook useEffect has missing dependencies: 'entityType', 'fetchActiveAnnouncement', 'fetchContainerAncestors', and 'fetchDQFailureCount'. Either include the |
| 🟡 | src/components/DataAssets/DataAssetsHeader/DataAssetsHeader.component.tsx:667:6 |
react-hooks/exhaustive-deps |
React Hook useCallback has a missing dependency: 'dataAsset.fullyQualifiedName'. Either include it or remove the dependency array. |
| 🟡 | src/components/DataAssets/DataAssetsHeader/DataAssetsHeader.component.tsx:743:6 |
react-hooks/exhaustive-deps |
React Hook useEffect has a missing dependency: 'fetchDataContract'. Either include it or remove the dependency array. |
… and 711 more. Run make ui-checkstyle-changed locally for the full list.
Fix locally (fast - only checks files changed in this branch):
make ui-checkstyle-changedQueryVote, QueryVoteType and VotingDataProps are request/response shapes that 18 REST clients need, so they belong below the UI layer rather than inside the table queries and voting component interfaces.
The rest clients imported page, component, context and store modules for the request and response shapes they declare, which points the bottom layer back up at the UI and is how import cycles start — limitsAPI and useLimitsStore were already a cycle. Move those shapes into interface/ (or enums/ for the enums) and repoint every importer, then promote openmetadata-imports/no-rest-ui-imports from warn to error now that the tree is clean.
…the new interface files
…terface Consumers outside this repository import the enum from this module path, so re-export it from its new home in enums/permissions.enum rather than breaking them.
…late openmetadata-collate imports QueryVote, IncidentTimeMetricsType, PagingResponse, AsyncDeleteWebsocketResponse, ExploreSearchIndex, ResourceLimit and EntityChildren from the modules they used to live in. Its CI builds Collate main against this branch, so re-export them from those paths until Collate is repointed at the new locations.
Two donor modules still reference types that now live in interface/, and resolving the rebase conflicts in favour of main's hunks dropped their imports: CSVImportAsyncResponse in BulkEntityImportPage.interface and EdgeDetails, EdgeFromToData and LineageNodeType in Lineage.interface.
Resolving the rebase conflict in useLimitsStore in favour of main dropped the re-export Collate still imports.
The ledger now uses the same words as eslint.config.mjs, and a mismatch reports 'error' !== 'warn' rather than 2 !== 1.
Code Review ✅ Approved🟡 Medium risk · Relocates shared UI types across hundreds of files and tightens ESLint enforcement. Moves REST-facing types and enums into lower-level interface and enum modules, repoints all 55 importers across 37 REST clients, and enforces the OptionsDisplay: compact → Counting what did not apply, without listing it. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source |
|



Describe your changes:
Fixes #33885
I moved the request/response types that
src/rest/**was importing from component, page, context and store modules down into the interface (and enum) layers, repointed every importer, and promotedopenmetadata-imports/no-rest-ui-importsfromwarntoerror.rest/is the bottom layer: the UI depends on it, not the reverse. Before this PR, 55 imports across 37 REST clients pointed back up at the UI — including one genuine cycle,context/LimitsProvider/useLimitsStore⇄rest/limitsAPI(the store imports the API, the API imported the store's types).Every moved symbol is a type or enum, so there is no runtime change;
tscis the proof.Type of change:
High-level design:
Where things went — one canonical home per type, following DEVELOPER_HANDBOOK §10 (
interface/[domain]/[feature].interface.ts), with enums inenums/:interface/entity/vote.interface.tsQueryVote,QueryVoteType,VotingDataPropsinterface/entity/csv.interface.tsCSVExportResponse,CSVImportAsyncResponseinterface/entity/chart.interface.tsChartTypeinterface/entity/asyncDelete.interface.tsAsyncDeleteJob,AsyncDeleteResponse,AsyncDeleteWebsocketResponseinterface/common/paging.interface.tsPagingResponseinterface/platform/service.interface.tsServicePageDatainterface/platform/application.interface.tsDataInsightLatestRuninterface/platform/limits.interface.tsLimitConfig,ResourceLimitinterface/platform/ruleEnforcement.interface.tsEntityRuleinterface/lineage.interface.ts(existing)Edge,EdgeDetails,EdgeFromToData,NodeData,LineageNodeType,EntityLineageResponse,LineageData,LineageNodeData,LineagePagingInfo,Flatten,EntityChildren,EntityChildrenIteminterface/discovery/explore.interface.tsExploreSearchIndexinterface/governance/glossary.interface.tsMoveGlossaryTermWebsocketResponseinterface/observability/dataQuality.interface.tsDataQualityDashboardChartFiltersinterface/data-contract/contract.interface.tsContractAllResult,ContractResultFilterenums/permissions.enum.tsResourceEntityenums/Suggestion.enum.tsSuggestionActionenums/DataQuality.enum.ts(existing)IncidentTimeMetricsTypeAssetsOfEntityneeded no move —AssetsTabs.interfaceonly re-exported it fromenums/Assets.enum, so the REST client now imports the source.Why no re-export shims. Leaving
export { X } from '<new path>'behind in the old component file would have cut the diff by ~250 files, but it leaves two valid import paths for every type and no signal about which one is canonical — new code would keep picking the component path. One location per type is the point of the exercise, so every importer moved.Why the lineage cluster is bigger than the others.
rest/lineageAPI.tsneedsEntityLineageResponse, which referencesLineageNodeType, which referencesEntityChildren— so the reachable type graph moved as a unit rather than in pieces. All of it depends only ongenerated/,enums/andinterface/search.interface, so nothing dragged the UI down with it.LineageConfigneeded nothing at all: it already lived ininterface/lineage.interface.tsand was merely re-exported byEntityLineage.interface, so the REST client just points at the real definition now.Rollout. UI-only, no schema, API or migration impact.
Tests:
Use cases covered
Behaviour is unchanged by construction — every moved symbol is a TypeScript type or a const enum value, and no call site's semantics changed, only the module it imports from. The risk this PR carries is "did a type move break a consumer", which the type checker and the existing suites answer directly.
Unit tests
Full jest suite on this branch: 1590 of 1591 suites pass, 18376 of 18376 tests pass.
The one suite that fails,
src/components/common/FilePreviewer/PdfRenderer.test.tsx, fails withCannot find module 'pdfjs-dist'— a dependency present inpackage.json(^4) but missing from my localnode_modules. It fails identically on unmodifiedmainin my checkout and touches nothing in this PR.Backend integration tests
Ingestion integration tests
Playwright (UI) tests
Manual testing performed
eslint 'src/rest/**/*.ts'→no-rest-ui-importsviolations 55 → 0.eslint './src/**/*.{js,jsx,ts,tsx,json}'with the rule aterror→ 0 errors, 2882 warnings (down from 3213 onmain— the 55 rest warnings plus circular-import and lower-layer warnings the moves also cleared).tsc --noEmitagainst anorigin/mainbaseline worktree → 575 errors on both sides. Nine lines differ in text only, where TypeScript printed the members of the same union in a different order; same files, same codes, no new diagnostics.organize-imports-cli+eslint --fix+prettierover all 332 changed files, no residual diff.UI screen recording / screenshots:
Not applicable — type-only refactor, no visual or behavioural change.
Checklist:
Fixes <issue-number>: <short explanation>Fixes #<issue-number>above.The reviewed changes appear safe to merge, with no outstanding correctness, security, or repository-rule violations.
Summary
This PR relocates REST-facing TypeScript types and enums into lower-level interface and enum modules, updates consumers to use those canonical definitions, and promotes the REST-to-UI import restriction from a warning to an error.
Changes added since the previous review also replace the SSO nightly summary shell script with a Python generator that produces a Slack Block Kit table and a Markdown PR summary.
src/rest/**dependencies on component, page, context, and store modules.openmetadata-imports/no-rest-ui-importsas an ESLint error.Diagram
%%{init: {'theme': 'neutral'}}%% flowchart LR UI[Components / Pages / Context / Store] --> REST[REST clients] UI --> TYPES[Interfaces / Enums] REST --> TYPES REST --> GENERATED[Generated API types] LINT[no-rest-ui-imports: error] -. prevents reverse dependency .-> RESTReviews (6) · Last reviewed commit: "style(ui): sort the repointed ResourceEn..."