Fix two rendering defects in the Test Connection modal - #31639
Fix two rendering defects in the Test Connection modal#31639Khairajani wants to merge 5 commits into
Conversation
…ailure card When a test connection step fails, the ingestion framework returns two distinct fields: message - the test connection definition's errorMessage, which is the actionable, connector-authored hint - and errorLog, the raw driver exception. The remediation card preferred errorLog, so a Teradata credential failure filled the card with a Go stack trace while 'Failed to connect to Teradata, please validate the credentials' was only reachable by expanding the raw connection log. Use message as the card headline (diagnosis.title still wins when a connector has an error pack) and keep errorLog below it, capped so a long stack trace no longer dominates the modal. Also stop painting a failed step's message in the success colour in the capability accordion and the raw log - resultSummary is the success channel, message on a failed step is not.
❌ PR checklist incompleteThis PR cannot be merged until the following are addressed on its linked issue:
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 |
|
Hi there 👋 Thanks for your contribution! The OpenMetadata team will review the PR shortly! Once it has been labeled as Let us know if you need any help! |
✅ Playwright Results — workflow succeededValidated commit ✅ 81 passed · ❌ 0 failed · 🟡 0 flaky · ⏭️ 0 skipped · 🧰 0 lifecycle flaky PerformanceBlocking 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) 55m 6s ⏱️ Max setup 5m 1s · max shard execution 11m 57s · max shard-job elapsed before upload 19m 36s · reporting 5s 🌐 162.57 requests/attempt · 1.70 app boots/UI scenario · 0.00% common-shard skew Optimization targets still in progress:
How to debug locally# Download playwright-test-results-<shard> artifact and unzip
npx playwright show-trace path/to/trace.zip # view trace |
…ection mock The remediation-card E2E asserted on 'Failed to connect to mysql, please validate the credentials' - real copy from mysql.json - inside a test that mocks the testConnectionDefinitions endpoint outright. Nothing there is coupled to the shipped definition, so the string implied a relationship that does not exist, and it was duplicated between the mock and the assertion where the two could silently drift apart. One named constant each for the message and the error log, with a value that reads as fixture data. What the test actually pins is that whatever the backend returns in message becomes the headline.
|
Hi there 👋 Thanks for your contribution! The OpenMetadata team will review the PR shortly! Once it has been labeled as Let us know if you need any help! |
Scope reduction. The remaining two are straight rendering defects that hold for any payload shape: - A failed step's summary line was hardcoded to the success colour in both the capability accordion and the raw log. resultSummary is the success channel; message on a failed step is the definition's errorMessage, so painting it green renders a failure as a pass. - The remediation card's raw-error block was uncapped, so a driver that dumps a full stack trace pushed the capability checks and the footer actions off the modal. It now scrolls at 220px, matching the raw log section's existing cap. Dropped: headlining the card with the step's message, and the guard and destructuring changes that supported it. The connectors on the new check framework never set message - mapper.py fixes it at None - so that path was only ever reachable from the legacy test_connection_db_common, and would become dead code as connectors migrate. The height cap is asserted in Playwright rather than Jest: jsdom has no layout, so a unit test could only assert the class name, not that the element actually stops growing and scrolls.
|
Hi there 👋 Thanks for your contribution! The OpenMetadata team will review the PR shortly! Once it has been labeled as Let us know if you need any help! |
|
| Count | Rule |
|---|---|
| 3 | sonarjs/cyclomatic-complexity |
| 2 | sonarjs/no-duplicate-string |
| 1 | sonarjs/no-hardcoded-ip |
| 1 | react/no-array-index-key |
| 1 | sonarjs/cognitive-complexity |
| 1 | sonarjs/expression-complexity |
All findings
| Location | Rule | Message | |
|---|---|---|---|
| 🟡 | src/components/common/TestConnection/TestConnectionModal/TestConnectionModal.test.tsx:190:16 |
sonarjs/no-hardcoded-ip |
Make sure using a hardcoded IP address 10.0.0.1 is safe here. |
| 🟡 | src/utils/TestConnectionModalUtils.tsx:297:51 |
sonarjs/no-duplicate-string |
Define a constant instead of duplicating this literal 3 times. |
| 🟡 | src/utils/TestConnectionModalUtils.tsx:306:53 |
react/no-array-index-key |
Do not use Array index in keys |
| 🟡 | src/utils/TestConnectionModalUtils.tsx:426:17 |
sonarjs/cognitive-complexity |
Refactor this function to reduce its Cognitive Complexity from 18 to the 15 allowed. |
| 🟡 | src/utils/TestConnectionModalUtils.tsx:426:17 |
sonarjs/cyclomatic-complexity |
{"message":"Function has a complexity of 19 which is greater than 10 authorized.","cost":9,"secondaryLocations":[{"line":426,"column":16,"endLine":426,"endColum |
| 🟡 | src/utils/TestConnectionModalUtils.tsx:637:15 |
sonarjs/expression-complexity |
Reduce the number of conditional operators (5) used in the expression (maximum allowed 3). |
| 🟡 | src/utils/TestConnectionModalUtils.tsx:696:37 |
sonarjs/cyclomatic-complexity |
{"message":"Function has a complexity of 12 which is greater than 10 authorized.","cost":2,"secondaryLocations":[{"line":696,"column":36,"endLine":696,"endColum |
| 🟡 | src/utils/TestConnectionModalUtils.tsx:798:27 |
sonarjs/no-duplicate-string |
Define a constant instead of duplicating this literal 3 times. |
| 🟡 | src/utils/TestConnectionModalUtils.tsx:1017:17 |
sonarjs/cyclomatic-complexity |
{"message":"Function has a complexity of 14 which is greater than 10 authorized.","cost":4,"secondaryLocations":[{"line":1017,"column":16,"endLine":1017,"endCol |
Fix locally (fast - only checks files changed in this branch):
make ui-checkstyle-changed
Code Review
|
| Compact |
|
Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source
|



Describe your changes:
Fixes #
Two rendering defects in the Test Connection modal. Both are independent of which connector produced the result, and hold for both the legacy
test_connection_db_commonpayload and the newer@check-framework payload.1. A failed step's summary line was painted in the success colour.
Both the capability accordion and the raw connection log rendered
resultSummary || result.messagewith a hardcodedtw:text-utility-success-300:Per the schema,
resultSummaryis "Human-readable summary of what the step found on success", whilemessageon a failed step is the test connection definition'serrorMessage. So a connector reporting"Failed to connect to X, please validate the credentials"had that line rendered green, reading as though the step had passed. The colour is now taken fromresult.passed; a failed step's line gets the advisory colour, which also distinguishes it from the rawerrorLogimmediately below.2. The remediation card's raw-error block was uncapped.
A driver that dumps a full stack trace on failure — teradatasql emits ~25 lines of
gosqldriverframes, JDBC connectors are similar — grew the card past the height of the modal, pushing the capability checks and the footer actions out of view. It now scrolls atmax-h-[220px], matching the cap the raw log section already had at 360px. Nothing is truncated; the block scrolls.Type of change:
High-level design:
N/A — small change.
Tests:
Use cases covered
Unit tests
openmetadata-ui/src/main/resources/ui/src/components/common/TestConnection/TestConnectionModal/TestConnectionModal.test.tsx— 47 pass.should not render a failed step message in the success colourshould keep a passed step summary in the success colourTestConnectionModalUtils.tsxmakes the first fail.Backend integration tests
Ingestion integration tests
Playwright (UI) tests
Added to
openmetadata-ui/src/main/resources/ui/playwright/e2e/Flow/TestConnectionModal.spec.ts.a long stack trace scrolls inside the remediation card instead of filling the modal— asserts the block's measured height is capped and that it actually scrolls (scrollHeight > clientHeight) rather than being clipped.The height cap is asserted here rather than in Jest deliberately: jsdom has no layout, so a unit test could only assert the class name is present, not that the element stops growing.
Manual testing performed
Reproduced against a live Teradata 20.0 system. An invalid-credentials test connection returned a ~25-line
gosqldriver/teradatasqlstack trace that filled the modal, with"Failed to connect to Teradata, please validate the credentials"rendered in green inside the raw log.Checks run
UI screen recording / screenshots:
Before/after screenshots to be attached.
Checklist:
I have read the CONTRIBUTING document.
My PR title is
Fixes <issue-number>: <short explanation>My PR is linked to a GitHub issue via
Fixes #<issue-number>above.I have commented on my code, particularly in hard-to-understand areas.
For UI changes: I attached a screen recording and/or screenshots above.
I have added tests (unit + Playwright) and listed them above.
I have added a test that covers the exact scenario we are fixing.
Scope note: an earlier revision of this PR also headlined the remediation card with the step's
messageinstead of the rawerrorLog. That was dropped. Connectors on the@checkframework never populatemessage—mapper.pyfixes it atNone— so that path was only reachable from the legacytest_connection_db_common, and would become dead code as connectors migrate. The two changes that remain are true for either payload shape. Teradata's own diagnosis quality is addressed separately in #31642, which is independent of this PR.Greptile Summary
This PR corrects two Test Connection modal rendering defects.
Confidence Score: 5/5
The PR appears safe to merge.
No blocking failure remains.
Important Files Changed
Reviews (5): Last reviewed commit: "Merge branch 'main' into fix/test-connec..." | Re-trigger Greptile