Skip to content

refactor: replace RouterUtils with ObservabilityRouterClassBase for navigation paths#27956

Open
ShaileshParmar11 wants to merge 5 commits intomainfrom
issue-3490-supporting-pr
Open

refactor: replace RouterUtils with ObservabilityRouterClassBase for navigation paths#27956
ShaileshParmar11 wants to merge 5 commits intomainfrom
issue-3490-supporting-pr

Conversation

@ShaileshParmar11
Copy link
Copy Markdown
Contributor

@ShaileshParmar11 ShaileshParmar11 commented May 7, 2026

Summary

Extends ObservabilityRouterClassBase with six new path helpers and migrates all observability + data-quality callers from raw RouterUtils helpers / ROUTES.* literals to the singleton, so navigation paths for these pages now flow through a single abstraction.

This is the OpenMetadata-side change that enables downstream embedding of observability pages inside Collate's AskCollate experience, where a Collate-side override of ObservabilityRouterClassBase rewrites paths to a different prefix when in embedded mode. Stand-alone OpenMetadata behavior is unchanged — the base class just delegates to the existing RouterUtils helpers and ROUTES constants.

What changed

New methods on ObservabilityRouterClassBase (each delegates to its existing RouterUtils / ROUTES counterpart):

  • getTestSuitePath(fqn)
  • getTestCaseDetailPagePath(fqn, tab?)
  • getTestCaseVersionPath(fqn, version, tab?)
  • getTestCaseDimensionsDetailPagePath(fqn, dimensionKey, tab?)
  • getIncidentManagerPath()
  • getObservabilityAlertsListPath()

Call-site migrations (raw helper/constant → singleton method) across:

  • pages/DataQuality/DataQualityPage.tsx
  • pages/IncidentManager/IncidentManagerDetailPage/IncidentManagerDetailPage.tsx
  • pages/AddObservabilityPage/AddObservabilityPage.tsx
  • pages/AlertDetailsPage/AlertDetailsPage.tsx
  • pages/TestSuiteDetailsPage/TestSuiteDetailsPage.component.tsx
  • components/IncidentManager/IncidentManager.component.tsx
  • components/DataQuality/DataQualityDashboard/DataQualityDashboard.component.tsx
  • components/DataQuality/TestSuite/TestSuiteList/TestSuites.component.tsx
  • components/DataQuality/AddToBundleSuiteModal/AddToBundleSuiteModal.component.tsx
  • components/DataQuality/IncidentManager/FailedTestCaseSampleData/FailedTestCaseSampleData.component.tsx
  • components/Database/Profiler/DataQualityTab/DataQualityTab.tsx
  • components/Database/Profiler/TestSummaryCustomTooltip/TestSummaryCustomTooltip.component.tsx
  • components/Explore/EntitySummaryPanel/DataQualityTab/DataQualityTab.tsx

The standalone helpers in RouterUtils are left exported and untouched — only the callers we wanted centralized were migrated. Out-of-scope callers (utility modules, contracts UI, destination pages outside the observability tree) continue to use the standalone helpers.

Type of change

  • Refactor (no functional/behavioral change for OpenMetadata standalone)
  • Bug fix
  • New feature
  • Breaking change

Test plan

Unit tests extended to cover every new method and every migrated call site:

  • ObservabilityRouterClassBase.test.ts: 20 cases (was 11) — covers all six new wrapper methods including default-tab fallback paths and singleton identity.
  • Sibling component tests added or extended for each migrated file: TestSuites, AddToBundleSuiteModal, IncidentManager, FailedTestCaseSampleData (new test file), TestSummaryCustomTooltip, DataQualityDashboard (covers both IncidentTypeAreaChartWidget drill-down paths), and TestSuiteDetailsPage — each asserts the migrated value matches what observabilityRouterClassBase.<method>(...) produces.
  • Full Jest suite: 10,714 / 10,714 passing, 0 failing. TypeScript clean.
  • UI checkstyle: green after make ui-checkstyle-changed.

Why now

The base/override pattern is already in place (setEmbeddedMode / isEmbeddedMode and four pre-existing wrapper methods). This PR finishes the surface area so consumers don't need to mix singleton calls and raw RouterUtils calls within the same page.


Summary by Gitar

  • UI Refinement:
    • Added Tailwind styling to DataQualityTab to standardize container overflow, border, and shadow properties for tables.

This will update automatically on new commits.

Copilot AI review requested due to automatic review settings May 7, 2026 09:24
@ShaileshParmar11 ShaileshParmar11 requested a review from a team as a code owner May 7, 2026 09:24
@github-actions github-actions Bot added safe to test Add this label to run secure Github workflows on PRs UI UI specific issues labels May 7, 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

This PR refactors UI navigation to route through ObservabilityRouterClassBase (instead of calling RouterUtils helpers or ROUTES constants directly) for observability + data quality related paths, centralizing route generation behind a single abstraction.

Changes:

  • Extend ObservabilityRouterClassBase with additional helpers for alerts list, incident manager, and test suite/test case navigation.
  • Update multiple pages/components to use observabilityRouterClassBase for navigation/breadcrumb URLs (test suites, test cases, incident manager, observability alerts).
  • Remove now-unneeded direct RouterUtils imports / ROUTES usages in the touched call sites.

Reviewed changes

Copilot reviewed 14 out of 14 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 new route helper methods to centralize observability/data-quality navigation paths.
openmetadata-ui/src/main/resources/ui/src/pages/TestSuiteDetailsPage/TestSuiteDetailsPage.component.tsx Switches breadcrumb/navigation URL generation for test suite to use the router class base.
openmetadata-ui/src/main/resources/ui/src/pages/IncidentManager/IncidentManagerDetailPage/IncidentManagerDetailPage.tsx Replaces direct ROUTES/RouterUtils calls with router class base methods for incident/test-case navigation.
openmetadata-ui/src/main/resources/ui/src/pages/DataQuality/DataQualityPage.tsx Uses router class base for navigating to test suite/test case after form actions.
openmetadata-ui/src/main/resources/ui/src/pages/AlertDetailsPage/AlertDetailsPage.tsx Uses router class base for observability alerts list breadcrumb + post-delete navigation.
openmetadata-ui/src/main/resources/ui/src/pages/AddObservabilityPage/AddObservabilityPage.tsx Uses router class base for alerts list breadcrumb and post-save navigation to alert details.
openmetadata-ui/src/main/resources/ui/src/components/IncidentManager/IncidentManager.component.tsx Uses router class base for linking to test case detail pages from incident manager list.
openmetadata-ui/src/main/resources/ui/src/components/Explore/EntitySummaryPanel/DataQualityTab/DataQualityTab.tsx Uses router class base for linking from summary panel test case cards.
openmetadata-ui/src/main/resources/ui/src/components/DataQuality/TestSuite/TestSuiteList/TestSuites.component.tsx Uses router class base for test suite link navigation.
openmetadata-ui/src/main/resources/ui/src/components/DataQuality/IncidentManager/FailedTestCaseSampleData/FailedTestCaseSampleData.component.tsx Uses router class base for navigating to the test case SQL query tab.
openmetadata-ui/src/main/resources/ui/src/components/DataQuality/DataQualityDashboard/DataQualityDashboard.component.tsx Uses router class base for incident manager redirect paths in dashboard widgets.
openmetadata-ui/src/main/resources/ui/src/components/DataQuality/AddToBundleSuiteModal/AddToBundleSuiteModal.component.tsx Uses router class base to navigate to a selected bundle suite after adding test cases.
openmetadata-ui/src/main/resources/ui/src/components/Database/Profiler/TestSummaryCustomTooltip/TestSummaryCustomTooltip.component.tsx Uses router class base for linking to test case “Issues” tab from profiler tooltip.
openmetadata-ui/src/main/resources/ui/src/components/Database/Profiler/DataQualityTab/DataQualityTab.tsx Uses router class base for navigation to test suite/test case views from profiler DQ tab.

Comment on lines +47 to +88
public getObservabilityAlertsListPath(): string {
return ROUTES.OBSERVABILITY_ALERTS;
}

public getIncidentManagerPath(): string {
return ROUTES.INCIDENT_MANAGER;
}

public getObservabilityAlertsEditPath(fqn: string): string {
return getObservabilityAlertsEditPath(fqn);
}

public getObservabilityAlertDetailsPath(fqn: string, tab?: string): string {
return getObservabilityAlertDetailsPath(fqn, tab);
}

public getTestSuitePath(testSuiteFqn: string): string {
return getTestSuitePath(testSuiteFqn);
}

public getTestCaseDetailPagePath(
fqn: string,
tab: TestCasePageTabs = TestCasePageTabs.TEST_CASE_RESULTS
): string {
return getTestCaseDetailPagePath(fqn, tab);
}

public getTestCaseVersionPath(
fqn: string,
version: string,
tab?: string
): string {
return getTestCaseVersionPath(fqn, version, tab);
}

public getTestCaseDimensionsDetailPagePath(
fqn: string,
dimensionKey: string,
tab: TestCasePageTabs = TestCasePageTabs.TEST_CASE_RESULTS
): string {
return getTestCaseDimensionsDetailPagePath(fqn, dimensionKey, tab);
}
Comment on lines 43 to +49
public getAddObservabilityAlertsPath(): string {
return ROUTES.ADD_OBSERVABILITY_ALERTS;
}

public getObservabilityAlertsListPath(): string {
return ROUTES.OBSERVABILITY_ALERTS;
}
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 7, 2026

Jest test Coverage

UI tests summary

Lines Statements Branches Functions
Coverage: 62%
62.55% (63255/101120) 43.06% (34319/79693) 45.94% (10107/21997)

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 7, 2026

🔴 Playwright Results — 1 failure(s), 13 flaky

✅ 4014 passed · ❌ 1 failed · 🟡 13 flaky · ⏭️ 86 skipped

Shard Passed Failed Flaky Skipped
✅ Shard 1 299 0 0 4
🟡 Shard 2 749 0 6 8
🔴 Shard 3 754 1 4 7
✅ Shard 4 790 0 0 18
✅ Shard 5 687 0 0 41
🟡 Shard 6 735 0 3 8

Genuine Failures (failed on all attempts)

Flow/ObservabilityAlerts.spec.ts › Alert operations for a user with and without permissions (shard 3)
�[31mTest timeout of 60000ms exceeded.�[39m
🟡 13 flaky test(s) (passed on retry)
  • Features/ActivityAPI.spec.ts › Activity event shows the actor who made the change (shard 2, 1 retry)
  • Features/BulkEditEntity.spec.ts › Glossary (shard 2, 1 retry)
  • Features/DomainFilterQueryFilter.spec.ts › Multi-nested domain hierarchy: filters should scope correctly at every level (shard 2, 1 retry)
  • Features/ExploreQuickFilters.spec.ts › tier with assigned asset appears in dropdown, tier without asset does not (shard 2, 1 retry)
  • Features/Glossary/GlossaryWorkflow.spec.ts › should start term as Draft when glossary has reviewers (shard 2, 1 retry)
  • Features/Glossary/LargeGlossaryPerformance.spec.ts › should search and filter glossary terms (shard 2, 1 retry)
  • Features/RTL.spec.ts › Verify Following widget functionality (shard 3, 1 retry)
  • Features/Table.spec.ts › Table pagination with sorting should works (shard 3, 1 retry)
  • Features/Table.spec.ts › Tags term should be consistent for search (shard 3, 1 retry)
  • Flow/PersonaFlow.spec.ts › Set default persona for team should work properly (shard 3, 1 retry)
  • Features/AutoPilot.spec.ts › Create Service and check the AutoPilot status (shard 6, 1 retry)
  • Pages/Glossary.spec.ts › Column dropdown drag-and-drop functionality for Glossary Terms table (shard 6, 1 retry)
  • Pages/Lineage/LineageFilters.spec.ts › Verify lineage schema filter selection (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

Copilot AI review requested due to automatic review settings May 8, 2026 05:56
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

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

@gitar-bot
Copy link
Copy Markdown

gitar-bot Bot commented May 8, 2026

Code Review ✅ Approved

Refactors navigation paths for observability and data-quality components by migrating from raw utilities to the ObservabilityRouterClassBase singleton. No issues found.

Options

Display: compact → Showing less information.

Comment with these commands to change:

Compact
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Gitar

@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented May 8, 2026

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