Thanks to visit codestin.com
Credit goes to github.com

Skip to content

feat: extract ObservabilityRouterClassBase for extensible data quality and observability routing#27212

Merged
ShaileshParmar11 merged 27 commits intomainfrom
supporting-PR-DO
Apr 21, 2026
Merged

feat: extract ObservabilityRouterClassBase for extensible data quality and observability routing#27212
ShaileshParmar11 merged 27 commits intomainfrom
supporting-PR-DO

Conversation

@ShaileshParmar11
Copy link
Copy Markdown
Contributor

@ShaileshParmar11 ShaileshParmar11 commented Apr 9, 2026

Summary

  • Added ObservabilityRouterClassBase — a singleton instance (following the existing ClassBase pattern) that centralizes route generation for Data Quality and Observability Alerts pages.
  • This enables the Collate override (ObservabilityRouterClassCollate) to remap navigation paths when pages are embedded inside AskCollate.
  • Updated Data Quality and Observability Alerts UI components to use the new router instance instead of direct RouterUtils function calls.
  • Updated chart widget tests to mock the new router module.

Architecture

ObservabilityRouterClassBase follows the same singleton instance + ClassBase/ClassCollate pattern used throughout the codebase (e.g., DataQualityClassBase, LogsClassBase). It exports a singleton instance as the default export and the class as a named export for extension.

Changes

File Change
ObservabilityRouterClassBase.ts New singleton instance with methods: getDataQualityPagePath, getObservabilityAlertsEditPath, getAddObservabilityAlertsPath, setEmbeddedMode, isEmbeddedMode
ObservabilityRouterClassBase.test.ts Unit tests for all routing methods and no-op embedded mode
DataQualityPage Tab navigation uses observabilityRouterClassBase.getDataQualityPagePath
ObservabilityAlertsPage Add/edit navigation uses observabilityRouterClassBase methods
DataQualityDashboard 3 chart redirect links use observabilityRouterClassBase
StatusByDimensionCardWidget Redirect link uses observabilityRouterClassBase
DataAssetsCoveragePieChartWidget Navigate call uses observabilityRouterClassBase
TestCases.component Breadcrumb URL uses observabilityRouterClassBase
TestSuites.component Sub-tab navigation uses observabilityRouterClassBase
DataAssetsCoveragePieChartWidget.test Mock updated for new module (inline factory, accessed via jest.requireMock)

Test plan

  • ObservabilityRouterClassBase.test.ts — all 7 unit tests pass
  • DataAssetsCoveragePieChartWidget.test.tsx — updated mock passes
  • Data Quality page tab navigation works (Summary, Test Cases, Test Suites)
  • Test Suites sub-tab navigation works (Table Suites, Bundle Suites)
  • Observability Alerts add/edit navigation works
  • Existing main UI navigation unaffected (embeddedMode defaults to false)

Summary by Gitar

  • Refined routing:
    • Updated ObservabilityRouterClassBase tests to use /alert/ path structure with a default configuration tab.
  • Improved component stability:
    • Fixed dependency arrays in AlertDetailsPage by replacing stale history references with navigate and correctly tracking dependency state.

This will update automatically on new commits.

@github-actions github-actions Bot added safe to test Add this label to run secure Github workflows on PRs UI UI specific issues labels Apr 9, 2026
@ShaileshParmar11 ShaileshParmar11 marked this pull request as ready for review April 13, 2026 09:55
@ShaileshParmar11 ShaileshParmar11 requested a review from a team as a code owner April 13, 2026 09:55
Copilot AI review requested due to automatic review settings April 13, 2026 09:56
@ShaileshParmar11 ShaileshParmar11 changed the title Feat: supporting PR for data observability feat: extract ObservabilityRouterClassBase for extensible data quality and observability routing Apr 13, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Introduces an ObservabilityRouterClassBase utility to centralize route generation for Data Quality and Observability Alerts pages, and migrates multiple components/tests to use it (likely to support embedded/Collate-specific routing overrides).

Changes:

  • Added ObservabilityRouterClassBase singleton + unit tests for its base routing behavior.
  • Updated Data Quality and Observability Alerts UI navigation to use the new router abstraction.
  • Updated Data Quality chart widget tests to mock the new router module instead of RouterUtils.

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
openmetadata-ui/src/main/resources/ui/src/utils/ObservabilityRouterClassBase.ts Adds router class + default singleton to generate observability/data-quality paths.
openmetadata-ui/src/main/resources/ui/src/utils/ObservabilityRouterClassBase.test.ts Unit tests for base router behavior (embedded mode no-op + path generation).
openmetadata-ui/src/main/resources/ui/src/pages/ObservabilityAlertsPage/ObservabilityAlertsPage.tsx Switches edit/add navigation to the new router abstraction.
openmetadata-ui/src/main/resources/ui/src/pages/DataQuality/DataQualityPage.tsx Switches tab navigation path building to the new router abstraction.
openmetadata-ui/src/main/resources/ui/src/components/DataQuality/TestSuite/TestSuiteList/TestSuites.component.tsx Switches sub-tab navigation to use the new router abstraction.
openmetadata-ui/src/main/resources/ui/src/components/DataQuality/TestCases/TestCases.component.tsx Updates breadcrumb URL generation to use the new router abstraction.
openmetadata-ui/src/main/resources/ui/src/components/DataQuality/DataQualityDashboard/DataQualityDashboard.component.tsx Updates redirectPath destinations to use the new router abstraction.
openmetadata-ui/src/main/resources/ui/src/components/DataQuality/ChartWidgets/StatusByDimensionCardWidget/StatusByDimensionCardWidget.component.tsx Updates widget redirectPath to use the new router abstraction.
openmetadata-ui/src/main/resources/ui/src/components/DataQuality/ChartWidgets/DataAssetsCoveragePieChartWidget/DataAssetsCoveragePieChartWidget.test.tsx Updates mocks/assertions to target the new router module.
openmetadata-ui/src/main/resources/ui/src/components/DataQuality/ChartWidgets/DataAssetsCoveragePieChartWidget/DataAssetsCoveragePieChartWidget.component.tsx Uses the new router abstraction for navigation on segment click.
Comments suppressed due to low confidence (1)

openmetadata-ui/src/main/resources/ui/src/pages/DataQuality/DataQualityPage.tsx:34

  • getDataQualityPagePath is still imported from RouterUtils but is no longer used after switching to ObservabilityRouterClassBase.getDataQualityPagePath(...). This will trigger no-unused-vars/TypeScript lint errors; remove the unused import (or revert to using it).
import {
  getDataQualityPagePath,
  getTestCaseDetailPagePath,
  getTestSuitePath,
} from '../../utils/RouterUtils';

Comment thread openmetadata-ui/src/main/resources/ui/src/pages/DataQuality/DataQualityPage.tsx Outdated
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 13, 2026

Jest test Coverage

UI tests summary

Lines Statements Branches Functions
Coverage: 61%
61.96% (60294/97302) 41.99% (31619/75292) 45.02% (9502/21104)

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 13, 2026

🟡 Playwright Results — all passed (18 flaky)

✅ 3693 passed · ❌ 0 failed · 🟡 18 flaky · ⏭️ 89 skipped

Shard Passed Failed Flaky Skipped
🟡 Shard 1 480 0 1 4
🟡 Shard 2 655 0 1 7
🟡 Shard 3 663 0 3 1
🟡 Shard 4 643 0 5 27
🟡 Shard 5 610 0 1 42
🟡 Shard 6 642 0 7 8
🟡 18 flaky test(s) (passed on retry)
  • Features/CustomizeDetailPage.spec.ts › Database Schema - customization should work (shard 1, 1 retry)
  • Features/BulkEditEntity.spec.ts › Glossary (shard 2, 1 retry)
  • Features/RTL.spec.ts › Verify Following widget functionality (shard 3, 1 retry)
  • Features/UserProfileOnlineStatus.spec.ts › Should show "Active recently" for users active within last hour (shard 3, 1 retry)
  • Flow/LineageSettings.spec.ts › Verify global lineage config (shard 3, 1 retry)
  • Pages/Customproperties-part2.spec.ts › entityReferenceList shows item count, scrollable list, no expand toggle (shard 4, 1 retry)
  • Pages/DataContracts.spec.ts › Create Data Contract and validate for Table (shard 4, 1 retry)
  • Pages/DataContracts.spec.ts › Create Data Contract and validate for Dashboard (shard 4, 1 retry)
  • Pages/DataContractsSemanticRules.spec.ts › Validate DisplayName Rule Is_Not_Set (shard 4, 1 retry)
  • Pages/Entity.spec.ts › Tier Add, Update and Remove (shard 4, 1 retry)
  • Pages/Glossary.spec.ts › Add and Remove Assets (shard 5, 1 retry)
  • Pages/Lineage/DataAssetLineage.spec.ts › verify create lineage for entity - Dashboard (shard 6, 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/Teams.spec.ts › Team assets should (shard 6, 1 retry)
  • Pages/UserDetails.spec.ts › Admin user can edit teams from the user profile (shard 6, 1 retry)
  • Pages/Users.spec.ts › Permissions for table details page for Data Consumer (shard 6, 1 retry)
  • VersionPages/EntityVersionPages.spec.ts › Directory (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

@ShaileshParmar11 ShaileshParmar11 marked this pull request as ready for review April 20, 2026 11:15
Copilot AI review requested due to automatic review settings April 20, 2026 11:15
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Introduces a new ObservabilityRouterClassBase singleton (following the existing ClassBase pattern) to centralize route generation for Data Quality and Observability Alerts navigation, enabling downstream overrides (e.g., Collate embedded mode) to remap these paths.

Changes:

  • Added ObservabilityRouterClassBase singleton with routing helpers and base embedded-mode stubs.
  • Refactored Data Quality and Observability Alerts UI navigation to use the new router instance.
  • Updated chart widget test mocking to target the new router module.

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
openmetadata-ui/src/main/resources/ui/src/utils/ObservabilityRouterClassBase.ts Adds the new router ClassBase + exported singleton instance for observability/data-quality routes.
openmetadata-ui/src/main/resources/ui/src/utils/ObservabilityRouterClassBase.test.ts Adds unit tests for the new router methods.
openmetadata-ui/src/main/resources/ui/src/pages/ObservabilityAlertsPage/ObservabilityAlertsPage.tsx Switches add/edit navigation to use observabilityRouterClassBase paths.
openmetadata-ui/src/main/resources/ui/src/pages/DataQuality/DataQualityPage.tsx Routes tab navigation through observabilityRouterClassBase.getDataQualityPagePath().
openmetadata-ui/src/main/resources/ui/src/components/DataQuality/TestSuite/TestSuiteList/TestSuites.component.tsx Routes sub-tab navigation through the new router instance.
openmetadata-ui/src/main/resources/ui/src/components/DataQuality/TestCases/TestCases.component.tsx Uses the new router instance for breadcrumb URL generation.
openmetadata-ui/src/main/resources/ui/src/components/DataQuality/DataQualityDashboard/DataQualityDashboard.component.tsx Updates redirect links to use observabilityRouterClassBase for Data Quality paths.
openmetadata-ui/src/main/resources/ui/src/components/DataQuality/ChartWidgets/StatusByDimensionCardWidget/StatusByDimensionCardWidget.component.tsx Updates redirect path generation to go through the router singleton.
openmetadata-ui/src/main/resources/ui/src/components/DataQuality/ChartWidgets/DataAssetsCoveragePieChartWidget/DataAssetsCoveragePieChartWidget.component.tsx Updates navigation to Test Suites to use the router singleton.
openmetadata-ui/src/main/resources/ui/src/components/DataQuality/ChartWidgets/DataAssetsCoveragePieChartWidget/DataAssetsCoveragePieChartWidget.test.tsx Updates Jest mock to mock the new router module and validate calls.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces an ObservabilityRouterClassBase singleton (following the existing *ClassBase pattern) to centralize route generation for Data Quality and Observability Alerts pages, enabling Collate overrides to remap paths in embedded contexts. It then migrates relevant UI navigation code and updates/creates unit tests to use the new router instance.

Changes:

  • Added ObservabilityRouterClassBase singleton + base methods for Data Quality and Observability Alerts routing.
  • Updated multiple Data Quality / Observability pages and widgets to use observabilityRouterClassBase instead of direct RouterUtils calls.
  • Added a new unit test suite for the router and updated an existing chart widget test mock.

Reviewed changes

Copilot reviewed 14 out of 14 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
openmetadata-ui/src/main/resources/ui/src/utils/ObservabilityRouterClassBase.ts New router singleton wrapper around existing routing utilities/constants.
openmetadata-ui/src/main/resources/ui/src/utils/ObservabilityRouterClassBase.test.ts Adds tests for router methods and singleton behavior.
openmetadata-ui/src/main/resources/ui/src/pages/TestSuiteIngestionPage/TestSuiteIngestionPage.tsx Updates breadcrumb route generation to use new router instance.
openmetadata-ui/src/main/resources/ui/src/pages/TestSuiteDetailsPage/TestSuiteDetailsPage.component.tsx Updates post-delete navigation and breadcrumbs to use new router instance.
openmetadata-ui/src/main/resources/ui/src/pages/ObservabilityAlertsPage/ObservabilityAlertsPage.tsx Updates add/edit/details navigation to go through new router instance.
openmetadata-ui/src/main/resources/ui/src/pages/EntityImport/BulkEntityImportPage/BulkEntityImportPage.tsx Updates Data Quality breadcrumb paths to use new router instance.
openmetadata-ui/src/main/resources/ui/src/pages/DataQuality/DataQualityPage.tsx Updates tab navigation to use new router instance.
openmetadata-ui/src/main/resources/ui/src/pages/AlertDetailsPage/AlertDetailsPage.tsx Routes observability edit/details navigation through the new router instance.
openmetadata-ui/src/main/resources/ui/src/components/DataQuality/TestSuite/TestSuiteList/TestSuites.component.tsx Updates sub-tab navigation to use new router instance.
openmetadata-ui/src/main/resources/ui/src/components/DataQuality/TestCases/TestCases.component.tsx Updates breadcrumb URL to use new router instance.
openmetadata-ui/src/main/resources/ui/src/components/DataQuality/DataQualityDashboard/DataQualityDashboard.component.tsx Updates redirectPath pathname generation to use new router instance.
openmetadata-ui/src/main/resources/ui/src/components/DataQuality/ChartWidgets/StatusByDimensionCardWidget/StatusByDimensionCardWidget.component.tsx Updates redirectPath pathname generation to use new router instance.
openmetadata-ui/src/main/resources/ui/src/components/DataQuality/ChartWidgets/DataAssetsCoveragePieChartWidget/DataAssetsCoveragePieChartWidget.component.tsx Updates click navigation to use new router instance.
openmetadata-ui/src/main/resources/ui/src/components/DataQuality/ChartWidgets/DataAssetsCoveragePieChartWidget/DataAssetsCoveragePieChartWidget.test.tsx Updates Jest mock to target the new router module.

@gitar-bot
Copy link
Copy Markdown

gitar-bot Bot commented Apr 20, 2026

Code Review ✅ Approved 1 resolved / 1 findings

ObservabilityRouterClassBase extraction improves routing extensibility. The naming convention violation was resolved by correcting the PascalCase import.

✅ 1 resolved
Quality: Instance imported with PascalCase, breaking codebase convention

📄 openmetadata-ui/src/main/resources/ui/src/utils/ObservabilityRouterClassBase.ts:46-48 📄 openmetadata-ui/src/main/resources/ui/src/pages/DataQuality/DataQualityPage.tsx:29 📄 openmetadata-ui/src/main/resources/ui/src/components/DataQuality/TestSuite/TestSuiteList/TestSuites.component.tsx:61
The default export of ObservabilityRouterClassBase.ts is the singleton instance observabilityRouterClassBase, but all consuming files import it with PascalCase (import ObservabilityRouterClassBase from ...). This makes it look like the class itself rather than an instance. Every other ClassBase in the codebase follows the pattern of importing the default instance in camelCase (e.g., import dataQualityClassBase, import entityUtilClassBase, import brandClassBase).

Options

Display: compact → Showing less information.

Comment with these commands to change:

Compact
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Gitar

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces a new ObservabilityRouterClassBase singleton (following the existing *ClassBase pattern) to centralize route generation for Data Quality and Observability Alerts pages, enabling downstream overrides (e.g., AskCollate embedded routing) without touching feature components.

Changes:

  • Added ObservabilityRouterClassBase + unit tests to encapsulate Data Quality + Observability Alerts route helpers and embedded-mode hooks.
  • Refactored Data Quality and Observability Alerts-related pages/components to use observabilityRouterClassBase instead of direct RouterUtils/ROUTES calls.
  • Updated a chart widget unit test to mock the new router module and adjusted AlertDetailsPage hook dependency arrays to use navigate.

Reviewed changes

Copilot reviewed 14 out of 14 changed files in this pull request and generated no comments.

Show a summary per file
File Description
openmetadata-ui/src/main/resources/ui/src/utils/ObservabilityRouterClassBase.ts Adds router singleton wrapping Data Quality + Observability Alerts route generation.
openmetadata-ui/src/main/resources/ui/src/utils/ObservabilityRouterClassBase.test.ts Adds unit tests validating base routing behavior and singleton export.
openmetadata-ui/src/main/resources/ui/src/pages/TestSuiteIngestionPage/TestSuiteIngestionPage.tsx Switches breadcrumb base URL to router singleton.
openmetadata-ui/src/main/resources/ui/src/pages/TestSuiteDetailsPage/TestSuiteDetailsPage.component.tsx Uses router singleton for navigation + breadcrumb URLs back to Data Quality tabs.
openmetadata-ui/src/main/resources/ui/src/pages/ObservabilityAlertsPage/ObservabilityAlertsPage.tsx Routes details/edit/add via router singleton; tightens descriptionTableObject typing.
openmetadata-ui/src/main/resources/ui/src/pages/EntityImport/BulkEntityImportPage/BulkEntityImportPage.tsx Updates Data Quality breadcrumb destinations via router singleton.
openmetadata-ui/src/main/resources/ui/src/pages/DataQuality/DataQualityPage.tsx Uses router singleton for tab-change navigation.
openmetadata-ui/src/main/resources/ui/src/pages/AlertDetailsPage/AlertDetailsPage.tsx Uses router singleton for observability edit/details paths; fixes hook deps to track navigate state.
openmetadata-ui/src/main/resources/ui/src/components/DataQuality/TestSuite/TestSuiteList/TestSuites.component.tsx Uses router singleton for sub-tab navigation routing.
openmetadata-ui/src/main/resources/ui/src/components/DataQuality/TestCases/TestCases.component.tsx Uses router singleton for Data Quality breadcrumb URL.
openmetadata-ui/src/main/resources/ui/src/components/DataQuality/DataQualityDashboard/DataQualityDashboard.component.tsx Uses router singleton for dashboard widget redirect links.
openmetadata-ui/src/main/resources/ui/src/components/DataQuality/ChartWidgets/StatusByDimensionCardWidget/StatusByDimensionCardWidget.component.tsx Uses router singleton for widget redirect link.
openmetadata-ui/src/main/resources/ui/src/components/DataQuality/ChartWidgets/DataAssetsCoveragePieChartWidget/DataAssetsCoveragePieChartWidget.component.tsx Uses router singleton for segment-click navigation.
openmetadata-ui/src/main/resources/ui/src/components/DataQuality/ChartWidgets/DataAssetsCoveragePieChartWidget/DataAssetsCoveragePieChartWidget.test.tsx Updates mocks/assertions to target the new router singleton module.

@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 UI UI specific issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants