Skip to content

Move the test case configuration into the right rail card - #33110

Open
ShaileshParmar11 wants to merge 2 commits into
mainfrom
feat/tcd-10a-configuration-card
Open

Move the test case configuration into the right rail card#33110
ShaileshParmar11 wants to merge 2 commits into
mainfrom
feat/tcd-10a-configuration-card

Conversation

@ShaileshParmar11

@ShaileshParmar11 ShaileshParmar11 commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

Describe your changes:

Fixes open-metadata/openmetadata-collate#6116

TCD-10a, part of epic open-metadata/openmetadata-collate#6074.

Originally stacked on #32966, which has since been squash-merged into main (c2aea63d31). This branch was replanted onto main afterwards — its content is byte-identical to the previously verified tip (ec115e3f71) for every file it touches, so nothing reviewed here changed.

Cross-repo link form is deliberate: the tracking issue lives in the Collate repo, and a bare #6116 here would autolink an unrelated PR in this repo.

I moved the parameters and the assertion SQL out of the main column into a Configuration card at the top of the right rail, which is the last piece of the details-page reflow the redesign asks for, and widened the rail so the card has the width the design assumes.

TCD-0 deliberately left them in the main column, and the reason turned out to be sharper than "the rail is narrow". The existing parameter layout cannot fit the rail at all: .parameter-label sets min-width: 200px and rows are chunked two-up inside a 12-column sub-grid, so each half-cell is ~140px and the label overflows before any value does. That is why the ticket says redesign rather than relocate.

Type of change:

  • Improvement

High-level design:

One new component (TestCaseConfigurationCard/) plus the result-tab composition root, which loses two blocks and gains one rail child.

Card layout — one row per parameter, label left and value right (justify-between), replacing the two-up 200px-label grid. Values truncate with a tooltip, so a long tableDiff table2 value degrades instead of forcing width.

The prototype's four shapes are independent, not a switch. hasParams, isDynamic, hasSql and noConfig are separate sc-if blocks in the mock — its own customSql case shows parameters and SQL. So getConfigurationShapes returns one flag per section with isEmpty as the "nothing at all" fallback, rather than an exclusive branch. Getting this wrong would have hidden the parameters on every custom-SQL test.

The SQL block is rendered directly, not through SchemaEditor. I reached for SchemaEditor first to avoid hand-rolling a tokenizer, and that was the wrong call: the prototype highlights keyword-vs-plain only, which is a keyword set rather than a parser, so the bespoke block is less code than CodeMirror, matches the design, and avoids pulling a lazy editor chunk into a rail that renders three static read-only lines. toSqlLines keeps the split separators and each token's column offset, so the text round-trips byte-for-byte (author indentation survives pre-wrap) and the offset doubles as a stable render key.

The rail moves from col-span-3 to col-span-4. Measured on a live page at a 1280px viewport, the rail was 205px, not the ~315px the ticket discussion assumed: col-span-3 of an 849px grid with 10px gaps is (849 − 110) / 12 × 3 + 20. The 315px figure only holds near a 1920px viewport, and the prototype's rail is a fixed width: 320px — so the card was running at roughly two thirds of the width it was drawn for. That is where the wrapping came from; the banner and grid measure flush either way, so it was never a padding or gap problem.

col-span-4 puts the rail at 276px and the main column at 563px:

Shape Card height @ 205px @ 276px
Table + params 220px 200px
Column + params 299px 263px
Dynamic assertion 211px 173px
Custom SQL 315px 297px
Zero-parameter 213px 157px

Nothing wraps or clips after the change: the definition name fits on one line, Compute Row Count stops breaking in two, and WHERE email IS NULL is fully visible rather than cut at the card edge. The chart keeps 529px. Both col-span values pre-date this branch — they are on main — so this is a deliberate widening, not a revert.

A pre-existing spacing bug surfaced by the reflow, fixed on #32966. The last-run banner's wrapper carried tw:pt-4 and nothing below it, so the banner's bottom edge and the grid's top edge measured at the same y — 0px where every other vertical gap on that grid is 10px. main has tw:px-4 tw:pt-4, so the bottom gap never existed; removing the horizontal inset and putting the result-history card directly beneath simply made the two read as touching. tw:pb-2.5 puts the banner in the same rhythm as the cards (banner bottom 408, grid top 418).

Two consolidations fall out. The per-SQL-param pencil merges into the single header pencil the prototype shows. parameterItems is deleted — it baked the dynamic-assertion badge into a parameter row, which the card now renders as its own callout; keeping it would have left two parameter-shaping paths with one unused.

Deliberate deviations from the mock, so it fits our system rather than the static design:

  • Colours use semantic tokens, not raw hex (#7A5AF8utility-purple-600, #C0C4CCquaternary, #1570EFutility-blue-600). The card gets dark mode, which the mock has no answer for.
  • Type snaps to the Tailwind scale: 13.5/13/12.5px → 14/14/12px.
  • The card keeps shadow-xs; the mock has none, but the rail's other cards do, and an odd card out reads worse than a shadow difference.

Open product question — please weigh in. The collapse toggle is kept, per the epic's Sep 8 decision that its removal was cancelled. The consequence is that collapsing the rail now also hides the parameters and SQL, which used to sit in the always-visible main column. That trade is asserted in a test rather than left implicit, but it is the decision the ticket flagged and it is still open.

Also fixes a test-fidelity bug: the mock store defaulted isTabExpanded to false while useTestCase.store defaults it to true. Several tests were passing only because the rail was absent — including "should not show edit icon without permission", which was passing for the wrong reason.

Tests:

Use cases covered

Every shape was exercised against a live stack, one test case per row:

Test type Shape Result
tableRowCountToBeBetween Table test + params minValue / maxValue rows under Table test
columnValueLengthsToBeBetween Column test + params Column test · <column> category line
tableRowCountToBeBetween + useDynamicAssertion Dynamic assertion ✅ callout + "Bounds learned automatically", no param rows
tableCustomSQLQuery Custom SQL ✅ params and line-numbered highlighted SQL together
columnValuesToBeUnique Zero-parameter ⚠️ see below

Plus: editing parameters still opens the editor and the affordance is hidden without permission; the version page renders the parameter diff with the assertion SQL suppressed; Collate's getAdditionalComponents and getAlertBanner still mount.

One finding worth a reviewer's eye. A test type with no parameters does not reach the mock's empty state — columnValuesToBeUnique still renders a Compute Row Count: false row, because showComputeRowCount keys off the definition's supportsRowLevelPassedFailed rather than whether it has parameters. Both zero-parameter definitions in a stock instance support it, so "No configurable parameters for this test type." may be effectively unreachable in practice. Not a regression — that row rendered before this PR too — but the mock's fourth shape is rarer than it implies, and it is covered by unit test rather than by anything a user is likely to see.

Unit tests

  • Added.
  • TestCaseConfigurationCard.test.tsx — one case per configuration shape, the category line for both test kinds, permission-gated edit, the version diff, SQL line numbering and keyword highlighting.
  • TestCaseConfigurationCard.utils.test.ts — the shape matrix (including that parameters and SQL co-render, and that the version page suppresses SQL), definition-name fallback, and the SQL tokenizer round-trip.
  • TestCaseResultTab.test.tsx — updated for the new layout: configuration lives in the rail, the rail leads with it, and collapsing the rail hides it.

Backend integration tests

  • Not applicable (no backend API changes).

Ingestion integration tests

  • Not applicable (no ingestion changes).

Playwright (UI) tests

  • Added, and executed against a live stack (5/5 passed).
  • TestCaseDetailsPage.spec.ts — asserts the Configuration card renders the real seeded parameter rows (minValue 12 / maxValue 34) and the Table test category for tableRowCountToBeBetween.
  • TestCaseSoftDeleteRestore.spec.ts — repointed at the card; it asserted the old parameter-container testid and would otherwise have broken.

Manual testing performed

  1. Local Docker stack + Vite dev server, signed in as admin, AI mode
  2. Created one test case per shape via the API and opened each at /observability/test-case/<fqn>/test-case-results — screenshots below
  3. Measured the live geometry before and after the span change (rail 205px → 276px; banner and grid flush at 391→1240 in both)
  4. yarn jest src/components/DataQuality src/pages/IncidentManager src/components/observability/TestCaseDetail — 1037 tests / 77 suites pass on the replanted branch
  5. yarn tsc:check and yarn tsc:playwright — no errors in the changed files
  6. ESLint 0 errors across all changed files; yarn lint:playwright 0 errors
  7. yarn check-i18n passes, with genuine translations in all 20 locales

Not verified: Collate's AiModelLearningAlert (via getAlertBanner) and DataDiffResults (via getAdditionalComponents) cannot be seen from the OSS repo — the base class returns null here and only the Collate build supplies them. Both seams are covered by unit test, and the epic already lists them as post-submodule-bump follow-ups.

UI screen recording / screenshots:

Full page — AI mode, rail leading with the Configuration card:

Configuration card, all five shapes at the widened 276px rail:

  1. Table test with parameters
  2. Column test with parameters (Column test · <column>)
  3. Dynamic assertion callout
  4. Custom SQL — parameters and SQL together
  5. Zero-parameter type

Checklist:

  • I have read the CONTRIBUTING document.
  • My PR is linked to a GitHub issue via Fixes above.
  • I have commented on my code, particularly in hard-to-understand areas.
  • For JSON Schema changes: not applicable — no schema changes.
  • For UI changes: I attached a screen recording and/or screenshots above.
  • I have added tests (unit / integration / Playwright as applicable) and listed them above.
  • I have added tests around the new logic.
  • For connector/ingestion changes: not applicable.

@github-actions

Copy link
Copy Markdown
Contributor

❌ PR checklist incomplete

This PR cannot be merged until the following are addressed on its linked issue:

  • No GitHub issue is linked. Link an issue in the Development section of the PR (or add Fixes #12345 to the description). For a same-org cross-repo issue, add Fixes open-metadata/<repo>#123 to the description.

The fields live on the linked issue in the Shipping project (open the issue → right sidebar → Projects). After you set them, re-run this check (or push a commit) — issue/project changes do not re-trigger it automatically.

Maintainers can bypass this check by adding the skip-pr-checks label.

@github-actions github-actions Bot added safe to test Add this label to run secure Github workflows on PRs UI UI specific issues labels Sep 10, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🔄 Playwright impact map auto-refreshed

This PR touched specs or UI source that changed the source→spec routing map. I regenerated .github/playwright/impact-map.generated.json and pushed the diff to this branch.

- source entries: 760 → 762
- 2 added, 0 removed, 16 changed spec-list

New source→spec entries:
  openmetadata-ui/src/main/resources/ui/src/components/DataQuality/IncidentManager/TestCaseResultTab/TestCaseConfigurationCard/TestCaseConfigurationCard.tsx
  openmetadata-ui/src/main/resources/ui/src/pages/TableDetailsPageV1/TableAliases/TableAliases.component.tsx

Entries whose spec list changed:
  openmetadata-ui/src/main/resources/ui/playwright/constant/config.ts
  openmetadata-ui/src/main/resources/ui/playwright/constant/sidebar.ts
  openmetadata-ui/src/main/resources/ui/playwright/e2e/Utils/appMode.ts
  openmetadata-ui/src/main/resources/ui/playwright/e2e/fixtures/pages.ts
  openmetadata-ui/src/main/resources/ui/playwright/support/entity/TableClass.ts
  openmetadata-ui/src/main/resources/ui/playwright/support/tag/ClassificationClass.ts
  openmetadata-ui/src/main/resources/ui/playwright/support/team/TeamClass.ts
  openmetadata-ui/src/main/resources/ui/playwright/utils/admin.ts
  openmetadata-ui/src/main/resources/ui/playwright/utils/common.ts
  openmetadata-ui/src/main/resources/ui/playwright/utils/entity.ts
  … and 6 more

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 getByTestId strings. Hand-authored routing in impact-map.json always wins on conflict.

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

@github-actions

github-actions Bot commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

Jest test Coverage

UI tests summary

Lines Statements Branches Functions
Coverage: 70%
70.94% (96361/135830) 55.63% (57274/102945) 56.96% (19075/33487)

@github-actions

github-actions Bot commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

✅ Playwright Results — workflow succeeded

Validated commit 9893abb8bd348ed0f754718e3cfc5298e7036979 in Playwright run 34572141668, attempt 1.

✅ 810 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) 50m 43s

⏱️ Max setup 4m 40s · max shard execution 17m 28s · max shard-job elapsed before upload 21m 21s · reporting 4s

🌐 226.05 requests/attempt · 2.18 app boots/UI scenario · 23.57% common-shard skew

Optimization targets still in progress:

  • Common shard skew was 23.57% (convergence target: at most 15%).
  • Browser traffic was 226.05 requests per attempt (convergence target: fewer than 200).
  • Application boot ratio was 2.18 per UI scenario (1874 boots / 858 scenarios; convergence target: at most 1).
Shard Passed Failed Flaky Skipped Lifecycle failed Lifecycle flaky
✅ Shard chromium-01 137 0 0 0 0 0
✅ Shard chromium-02 132 0 0 0 0 0
✅ Shard chromium-03 163 0 0 0 0 0
✅ Shard chromium-04 159 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 import-export-01 26 0 0 0 0 0
✅ Shard ingestion-01 33 0 0 0 0 0
✅ Shard reindex-01 5 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

Base automatically changed from feat/tcd-0-ai-mode-page-shell to main September 11, 2026 05:23
ShaileshParmar11 and others added 2 commits September 11, 2026 12:02
TCD-10a. The parameters and the assertion SQL were the last two blocks the
redesign wants in the rail and TCD-0 left in the main column. The existing
layout could not fit the rail: `.parameter-label` sets `min-width: 200px` and
rows are chunked two-up inside a 12-column sub-grid, so each half-cell is
~140px and the *label* overflows before any value does. That is why the ticket
says redesign rather than relocate.

The card follows the prototype: one row per parameter, label left and value
right, the value truncating with a tooltip so a long `tableDiff` `table2`
degrades instead of forcing width. The prototype's four shapes are independent
`sc-if` blocks, not a switch — a custom-SQL test shows parameters *and* SQL —
so `getConfigurationShapes` returns one flag per section with `isEmpty` as the
"nothing at all" fallback. The version page keeps its parameter diff and
suppresses the assertion SQL, which has no diff rendering.

The SQL block is rendered directly rather than through `SchemaEditor`: the
prototype highlights keyword-vs-plain only, a keyword set rather than a parser,
so the bespoke block is less code than CodeMirror and keeps a lazy editor chunk
out of a rail rendering three static lines. `toSqlLines` keeps the separators
and each token's column offset, so text round-trips byte-for-byte and the
offset doubles as a stable render key.

The rail moves from `col-span-3` to `col-span-4`. Measured at a 1280px
viewport it was 205px, not the ~315px assumed in the ticket discussion — that
figure only holds near 1920px — against the prototype's fixed 320px. That is
where the wrapping and the clipped SQL came from. At `col-span-4` the rail is
276px and nothing wraps.

The per-SQL-param pencil merges into the single header pencil the prototype
shows, and `parameterItems` goes away — it baked the dynamic-assertion badge
into a parameter row, which the card now renders as its own callout. Colours
map to semantic tokens, so the card gets dark mode.

The collapse toggle is kept per the epic's Sep 8 decision, so collapsing the
rail now also hides the configuration; that trade is asserted in a test and
flagged for product on #6116. Also fixes the mock store's `isTabExpanded`
default, which was `false` while `useTestCase.store` defaults to `true` —
several tests only passed because the rail was absent.

Replanted onto main after #32966 was squash-merged: this is the branch's net
change over the squashed base, byte-identical to the previously verified tip
(ec115e3) for every file it touches.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Regenerated for the configuration card's specs on the replanted branch, so the
drift workflow has nothing to push after the force-push.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@ShaileshParmar11
ShaileshParmar11 force-pushed the feat/tcd-10a-configuration-card branch from ec115e3 to 9893abb Compare September 11, 2026 06:56
Copilot AI lite review requested due to automatic review settings September 11, 2026 06:56

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@gitar-bot

gitar-bot Bot commented Sep 11, 2026

Copy link
Copy Markdown
Code Review ✅ Approved

Moves test case parameters and assertion SQL from the main column into a Configuration card in the right rail, completing the details-page reflow. The card uses a single-row-per-parameter layout with values that truncate with tooltips, renders SQL with keyword highlighting and line numbers, and includes comprehensive unit and Playwright test coverage. No issues found.

Options

Display: compact → Counting what did not apply, without listing it.

Comment with these commands to change the behavior for this request:

Compact
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source

@github-actions

Copy link
Copy Markdown
Contributor

❌ UI Checkstyle Failed

❌ Licence Header

One or more files are missing or have an outdated Apache 2.0 licence header.

Affected files
  • openmetadata-ui/src/main/resources/ui/src/components/DataQuality/IncidentManager/TestCaseResultTab/TestCaseResultTab.interface.ts

🔍 ESLint findings in this PR's files — 0 error(s), 3 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), 3 warning(s) across 3 changed file(s).

Count Rule
2 openmetadata-imports/no-lower-layer-page-imports
1 no-restricted-imports
All findings
Location Rule Message
🟡 src/components/DataQuality/IncidentManager/TestCaseResultTab/TestCaseConfigurationCard/TestCaseConfigurationCard.tsx:15:1 no-restricted-imports '../../../../../assets/svg/ic-suggestions.svg' import is restricted from being used by a pattern. Do not import SVG icons directly from assets/ paths; use the d
🟡 src/components/DataQuality/IncidentManager/TestCaseResultTab/TestCaseResultTab.component.tsx:21: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/DataQuality/IncidentManager/TestCaseResultTab/useTestCaseResultTab.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.

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

make ui-checkstyle-changed

@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.

2 participants