Skip to content

[Detail Bug] Observability test case Results tab missing last-run/next-run banner on deep-linked page #32692

Description

@detail-app

Detail Bug Report

https://app.detail.dev/org_3377c26d-da48-4ccd-b83a-22c542f4fe83/bugs/bug_3cb0e455-3fa1-414d-bba4-0443fbeb7fea

Introduced in #31911 by @karanh37 on Aug 29, 2026

Summary

  • Context: TestCaseDetail.tsx is the observability (AI app-mode) test-case detail renderer, registered for /observability/test-case/:fqn and /observability/test-case/:fqn/:tab in observability.module.tsx:210,219. It shares the same useTestCaseDetailPage hook and the same useTestCaseIncidentHeader hook as the legacy IncidentManagerDetailPage (registered for /test-case/:fqn).
  • Bug: TestCaseDetail.tsx never renders TestCaseLastRunBanner on the Results tab and never fetches the nextRunTimestamp value that the banner displays. The two renderers that share a hook, a header (IncidentManagerPageHeader), a useTestCaseIncidentHeader call, and a tab strip therefore present different content for the same data: /test-case/:fqn shows the last-run/next-run/incident-task banner above the results tab; /observability/test-case/:fqn shows only the bare results <Tab />.
  • Actual vs. expected: Actual: on /observability/test-case/:fqn with Results active, the banner container data-testid="test-case-last-run-banner-tab-container" is absent. Expected: observability renderer should match legacy /test-case/:fqn and show TestCaseLastRunBanner above the Results tab, including nextRunTimestamp.
  • Impact: In OSS, the issue is only observable when deep-linking directly to /observability/test-case/<fqn> in AI app-mode; the first tab interaction routes to the legacy /test-case/<fqn>/<tab> renderer (which shows the banner), so the missing banner is visible for one initial render.

Code with Bug

openmetadata-ui/src/main/resources/ui/src/components/observability/TestCaseDetail/TestCaseDetail.tsx

const activeTabContent = useMemo(() => {
  const currentTab = tabs.find(({ key }) => key === activeTab) ?? tabs.at(0);

  if (!currentTab) {
    return null;
  }

  const { Tab } = currentTab;

  return <Tab editVariant="modal" showSidePanel={isTabExpanded} />; // <-- BUG 🔴 Results tab is not wrapped with TestCaseLastRunBanner (and nextRunTimestamp is never fetched)
}, [tabs, activeTab, isTabExpanded]);

Legacy renderer behavior for the same Results tab (shows banner above <Tab />):

openmetadata-ui/src/main/resources/ui/src/pages/IncidentManager/IncidentManagerDetailPage/IncidentManagerDetailPage.tsx

children: (
  <>
    {key === TestCasePageTabs.TEST_CASE_RESULTS &&
      !isVersionPage &&
      !dimensionKey && (
        <div
          className="tw:px-4 tw:pt-4"
          data-testid="test-case-last-run-banner-tab-container">
          <TestCaseLastRunBanner
            incidentTask={incidentHeaderData.incidentTask}
            nextRunTimestamp={nextRunTimestamp}
            parameterValues={testCase?.parameterValues}
            taskLinkInfo={incidentHeaderData.taskLinkInfo}
            testCaseResult={testCase?.testCaseResult}
            testCaseStatus={testCase?.testCaseStatus}
            testCaseStatusData={incidentHeaderData.testCaseStatusData}
          />
        </div>
      )}
    <Tab showSidePanel={isTabExpanded} />
  </>
)

Explanation

  • The observability TestCaseDetail.tsx renders the current tab body (<Tab />) directly and does not include the sibling JSX block that conditionally renders TestCaseLastRunBanner for the Results tab.
  • The banner depends on nextRunTimestamp, which the legacy page fetches via a useQuery (fetchNextTestCaseRunTimestamp / TEST_CASE_NEXT_RUN_QUERY_KEY / shouldFetchNextRun). The observability tree has no references to these helpers and therefore never fetches the timestamp, making it impossible to display the banner.
  • In OSS, in-app navigation to test-case details resolves via getTestCaseDetailPagePath to ROUTES.TEST_CASE_DETAILS_WITH_TAB (/test-case/:fqn/:tab), so normal click-flows land on the legacy page; only deep-linking to /observability/test-case/:fqn in AI app-mode reveals the missing banner, and the first tab interaction reroutes to legacy, making the issue transient.

Recommended Fix

Mirror the legacy page’s Results-tab wrapper in components/observability/TestCaseDetail/TestCaseDetail.tsx: add the nextRunTimestamp query and conditionally render TestCaseLastRunBanner above the Results tab <Tab />, using the same imports and dependency discipline as IncidentManagerDetailPage.tsx.

History

This bug was introduced in commit 2807684. PR #31911 created components/observability/TestCaseDetail/TestCaseDetail.tsx as a new observability-shell parallel of IncidentManagerDetailPage.tsx but omitted the TestCaseLastRunBanner JSX block and its nextRunTimestamp query that already existed in the legacy file.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    • Status
      No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions