Skip to content

Fixes #32692: render last-run banner on observability test-case Results tab - #32754

Merged
ShaileshParmar11 merged 2 commits into
mainfrom
detail/bug-fix/fixes-32692-render-last-run-banner-on-observabilit-3b926d
Sep 7, 2026
Merged

ShaileshParmar11 merged 2 commits into
mainfrom
detail/bug-fix/fixes-32692-render-last-run-banner-on-observabilit-3b926d

Conversation

@detail-app

@detail-app detail-app Bot commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

Detail bug report: View on Detail

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.


Automatic Fixes PRs can be configured here.

@github-actions

github-actions Bot commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

Hi there 👋 Thanks for your contribution!

The OpenMetadata team will review the PR shortly! Once it has been labeled as safe to test, the CI workflows
will start executing and we'll be able to make sure everything is working as expected.

Let us know if you need any help!

@github-actions

github-actions Bot commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

✅ Playwright Results — workflow succeeded

Validated commit 35289eb95de01aa27d3d17cb289cdfd40e12e3f6 in Playwright run 34094538408, attempt 1.

✅ 557 passed · ❌ 0 failed · 🟡 0 flaky · ⏭️ 0 skipped · 🧰 0 lifecycle flaky

Performance

Blocking 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) 36m 14s

⏱️ Max setup 4m 56s · max shard execution 18m 46s · max shard-job elapsed before upload 22m 26s · reporting 5s

🌐 234.59 requests/attempt · 2.82 app boots/UI scenario · 12.88% common-shard skew

Optimization targets still in progress:

  • Browser traffic was 234.59 requests per attempt (convergence target: fewer than 200).
  • Application boot ratio was 2.82 per UI scenario (1630 boots / 578 scenarios; convergence target: at most 1).
Shard Passed Failed Flaky Skipped Lifecycle failed Lifecycle flaky
✅ Shard chromium-01 133 0 0 0 0 0
✅ Shard chromium-02 140 0 0 0 0 0
✅ Shard chromium-03 126 0 0 0 0 0
✅ Shard data-asset-rules-01 65 0 0 0 0 0
✅ Shard domain-isolation-01 16 0 0 0 0 0
✅ Shard global-state-01 34 0 0 0 0 0
✅ Shard ingestion-01 1 0 0 0 0 0
✅ Shard reindex-01 2 0 0 0 0 0
✅ Shard search-01 11 0 0 0 0 0
✅ Shard search-rbac-01 29 0 0 0 0 0

📦 Download artifacts

How to debug locally
# Download playwright-test-results-<shard> artifact and unzip
npx playwright show-trace path/to/trace.zip    # view trace

@detail-app detail-app Bot added the safe to test Add this label to run secure Github workflows on PRs label Sep 6, 2026
@github-actions

github-actions Bot commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

⚠️ UI Checkstyle passed — lint findings in changed files

🔍 ESLint findings in this PR's files — 0 error(s), 4 warning(s)

Errors block the build. Warnings do not yet — they are rules whose backlog is still
being worked down, listed so this PR does not add to it. See docs/ui-code-quality-gate.md.

0 error(s), 4 warning(s) across 1 changed file(s).

Count Rule
4 openmetadata-imports/no-lower-layer-page-imports
All findings
Location Rule Message
🟡 src/components/observability/TestCaseDetail/TestCaseDetail.tsx:33: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/observability/TestCaseDetail/TestCaseDetail.tsx:34: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/observability/TestCaseDetail/TestCaseDetail.tsx:35: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/observability/TestCaseDetail/TestCaseDetail.tsx:40: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.

Fix locally (fast - only checks files changed in this branch):

make ui-checkstyle-changed

@github-actions

github-actions Bot commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

Jest test Coverage

UI tests summary

Lines Statements Branches Functions
Coverage: 70%
70.37% (94994/134977) 54.88% (56182/102366) 56.28% (18762/33335)

@karanh37 karanh37 assigned ShaileshParmar11 and unassigned karanh37 Sep 7, 2026
@sonarqubecloud

sonarqubecloud Bot commented Sep 7, 2026

Copy link
Copy Markdown

@ShaileshParmar11
ShaileshParmar11 added this pull request to the merge queue Sep 7, 2026
Merged via the queue into main with commit 19af624 Sep 7, 2026
94 of 95 checks passed
@ShaileshParmar11
ShaileshParmar11 deleted the detail/bug-fix/fixes-32692-render-last-run-banner-on-observabilit-3b926d branch September 7, 2026 12:09
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants