Skip to content

feat(ui): validate confidence and sample-count in Auto Classification agent form - #30893

Open
Rohit0301 wants to merge 1 commit into
mainfrom
auto-classification-form-validation
Open

feat(ui): validate confidence and sample-count in Auto Classification agent form#30893
Rohit0301 wants to merge 1 commit into
mainfrom
auto-classification-form-validation

Conversation

@Rohit0301

Copy link
Copy Markdown
Contributor

Describe your changes:

Fixes #

I added form-level validation to the Auto Classification agent configuration wizard because users could previously enter values like 1000 for the confidence field (0–100 range) or negative numbers for sample row count (must be ≥ 1), and the wizard would silently proceed.

The fix is schema-first: minimum/maximum constraints are added to the three auto-classification JSON schemas (database, messaging, storage), which RJSF+AJV8 enforces automatically — invalid values now block the "Next" button and show an inline error message. A maximum error handler was added to transformErrors with a new i18n key (value-must-be-less-than-or-equal) translated into all 19 non-English locales.

Type of change:

  • Bug fix
  • Improvement
  • New feature
  • Breaking change
  • Documentation

High-level design:

N/A — small change.

Tests:

Use cases covered

  • Confidence value > 100 (e.g. 1000) shows an inline error and blocks advancing to the schedule step
  • Confidence value < 0 shows an inline error and blocks advancing
  • Sample data rows count ≤ 0 (e.g. -1) shows an inline error and blocks advancing
  • Correcting the values allows the wizard to proceed normally

Unit tests

  • N/A — validation is driven by JSON Schema constraints enforced by AJV8; no isolated unit logic was added.

Backend integration tests

  • Not applicable (no backend API changes).

Ingestion integration tests

  • Not applicable (no ingestion changes).

Playwright (UI) tests

  • I added Playwright E2E tests under openmetadata-ui/.../ui/playwright/ for UI changes.
  • Files added/updated: openmetadata-ui/src/main/resources/ui/playwright/e2e/Features/StorageMetadataAgentForm.spec.ts

Manual testing performed

  1. Opened Add Auto Classification Agent on a database service
  2. Entered 1000 in the Confidence field and clicked Next — inline error appeared, wizard stayed on config step
  3. Entered -1 in Sample Data Rows Count and clicked Next — inline error appeared, wizard stayed on config step
  4. Corrected both fields to valid values — wizard advanced normally

UI screen recording / screenshots:

Not applicable.

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 JSON Schema changes: I updated the migration scripts or explained why it is not needed.
  • 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.

… in Auto Classification agent form

- Add minimum/maximum constraints to confidence (0–100) and minimum to
  sampleDataCount (≥1) in all three auto-classification pipeline JSON
  schemas (database, messaging, storage).
- Add maximum error handler to transformErrors so RJSF surfaces a
  localised message when confidence exceeds 100.
- Add value-must-be-less-than-or-equal i18n key with translations for
  all 19 non-English locales.
- Add Playwright form-validation tests in StorageMetadataAgentForm.spec.ts.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@Rohit0301
Rohit0301 requested a review from a team as a code owner August 3, 2026 18:22
@github-actions

github-actions Bot commented Aug 3, 2026

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 the UI UI specific issues label Aug 3, 2026
@github-actions

github-actions Bot commented Aug 3, 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!

@Rohit0301 Rohit0301 self-assigned this Aug 3, 2026
@Rohit0301 Rohit0301 added the safe to test Add this label to run secure Github workflows on PRs label Aug 3, 2026
@github-actions

github-actions Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

🔴 Playwright Results — workflow failed

Validated commit 8e08a4749f73c05cd9a6846c064473785cc3c621 in Playwright run 30841073276, attempt 1.

✅ 761 passed · ❌ 2 failed · 🟡 1 flaky · ⏭️ 3 skipped · 🧰 0 lifecycle flaky

Performance

Blocking targets: ❌ unmet · 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) 56m 33s

⏱️ Max setup 3m 10s · max shard execution 19m 51s · max shard-job elapsed before upload 23m 2s · reporting 6s

🌐 199.24 requests/attempt · 2.50 app boots/UI scenario · 7.39% common-shard skew

Optimization targets still in progress:

  • Application boot ratio was 2.5 per UI scenario (1974 boots / 789 scenarios; convergence target: at most 1).
Shard Passed Failed Flaky Skipped Lifecycle failed Lifecycle flaky
✅ Shard chromium-01 154 0 0 0 0 0
✅ Shard chromium-02 155 0 0 0 0 0
✅ Shard chromium-03 155 0 0 0 0 0
🟡 Shard chromium-04 143 0 1 3 0 0
✅ Shard data-asset-rules-01 61 0 0 0 0 0
✅ Shard domain-isolation-01 14 0 0 0 0 0
✅ Shard global-state-01 34 0 0 0 0 0
🔴 Shard ingestion-01 4 2 0 0 0 0
✅ Shard reindex-01 2 0 0 0 0 0
✅ Shard search-01 10 0 0 0 0 0
✅ Shard search-rbac-01 29 0 0 0 0 0

Genuine Failures (failed on all attempts)

Features/StorageMetadataAgentForm.spec.tsconfidence field rejects values outside 0-100 and blocks next step (shard ingestion-01)
�[31mTest timeout of 180000ms exceeded.�[39m
Features/StorageMetadataAgentForm.spec.tssampleDataCount rejects non-positive values and blocks next step (shard ingestion-01)
�[31mTest timeout of 180000ms exceeded.�[39m
🟡 1 flaky test(s) (passed on retry)
  • Pages/Entity.spec.tsDomain Propagation (shard chromium-04, 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

@gitar-bot

gitar-bot Bot commented Aug 3, 2026

Copy link
Copy Markdown
Code Review ✅ Approved

Adds schema-first validation and i18n error handlers to the Auto Classification agent form to enforce confidence and sample count constraints, backed by new Playwright E2E tests. No issues found.

Options

Display: compact → Showing less information.

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

Compact
gitar display:verbose         

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

@github-actions

github-actions Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

❌ UI Checkstyle Failed

❌ Playwright - ESLint + Prettier + Organise Imports

One or more Playwright test files have linting or formatting issues.

Affected files
  • openmetadata-ui/src/main/resources/ui/playwright/e2e/Features/StorageMetadataAgentForm.spec.ts

🔍 ESLint findings in this PR's files — ESLint report could not be read — see the job log.

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.

No machine-readable report was produced.


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

make ui-checkstyle-changed

@github-actions

github-actions Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Jest test Coverage

UI tests summary

Lines Statements Branches Functions
Coverage: 66%
66.05% (77750/117699) 49.97% (46859/93768) 51.2% (14107/27548)

@sonarqubecloud

sonarqubecloud Bot commented Aug 3, 2026

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.

1 participant