Skip to content

fix rules builder conjuction overllaping issue - #31700

Merged
anuj-kumary merged 3 commits into
mainfrom
rules-builder
Aug 19, 2026
Merged

fix rules builder conjuction overllaping issue#31700
anuj-kumary merged 3 commits into
mainfrom
rules-builder

Conversation

@anuj-kumary

@anuj-kumary anuj-kumary commented Aug 18, 2026

Copy link
Copy Markdown
Member

Describe your changes:

Before -
Screenshot 2026-08-18 at 5 05 03 PM

After -

Screenshot 2026-08-18 at 5 03 55 PM

Type of change:

  • Bug fix
  • Improvement
  • New feature
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation

High-level design:

N/A — small change.

Tests:

Use cases covered

Unit tests

Backend integration tests

Ingestion integration tests

Playwright (UI) tests

Manual testing performed

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.

Greptile Summary

The PR adjusts the Persona AI context rule builder layout to prevent its conjunction control from overlapping condition rows.

  • Adds a Persona-specific wrapper around the shared query builder.
  • Repositions conjunction controls and hides the builder’s internal add-rule action within that wrapper.

Confidence Score: 5/5

The PR appears safe to merge because no blocking failure remains within the eligible follow-up review scope.

No blocking failure remains.

Important Files Changed

Filename Overview
openmetadata-ui/src/main/resources/ui/src/components/Settings/Persona/PersonaAIContext/ContextRuleEditor/RuleQueryBuilderField.component.tsx Adds a scoped wrapper around the Persona query builder so its layout overrides do not affect other consumers.
openmetadata-ui/src/main/resources/ui/src/components/common/QueryBuilderWidgetV1/query-builder-widget-v1.less Adds Persona-specific styles that move the conjunction control and hide the redundant internal add-condition action.

Reviews (2): Last reviewed commit: "Merge branch 'main' into rules-builder" | Re-trigger Greptile

@anuj-kumary anuj-kumary self-assigned this Aug 18, 2026
@anuj-kumary anuj-kumary added the safe to test Add this label to run secure Github workflows on PRs label Aug 18, 2026
@anuj-kumary anuj-kumary added To release Will cherry-pick this PR into the release branch skip-pr-checks Bypass PR metadata validation check labels Aug 18, 2026
@github-actions github-actions Bot added the UI UI specific issues label Aug 18, 2026
@github-actions

github-actions Bot commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

Jest test Coverage

UI tests summary

Lines Statements Branches Functions
Coverage: 66%
66.85% (79939/119565) 51.25% (48779/95164) 52.25% (14614/27967)

# Conflicts:
#	openmetadata-ui/src/main/resources/ui/src/components/Settings/Persona/PersonaAIContext/ContextRuleEditor/RuleQueryBuilderField.component.tsx
@gitar-bot

gitar-bot Bot commented Aug 18, 2026

Copy link
Copy Markdown
Code Review 👍 Approved with suggestions 0 resolved / 1 findings

Refactors the rules builder component by adding a persona-specific wrapper to fix conjunction overlapping issues in the UI. Consider adding a type guard to ensure fields.extension is always defined in the nested 'in' check.

💡 Edge Case: 'in' guard assumes fields.extension is always defined

📄 openmetadata-ui/src/main/resources/ui/src/components/Settings/Persona/PersonaAIContext/ContextRuleEditor/RuleQueryBuilderField.component.tsx:98-100

'subfields' in nextFields.extension will throw a TypeError (Cannot use 'in' operator on undefined) if baseConfig.fields.extension is ever absent for a given search index. The current ElasticSearch config always defines extension, so this is not reproducible today, but the check is not self-guarding. Harden it with optional chaining, e.g. if (!isEmpty(subfields) && nextFields.extension && 'subfields' in nextFields.extension).

Guard against a missing extension key before using the 'in' operator.
if (
  !isEmpty(subfields) &&
  nextFields.extension &&
  'subfields' in nextFields.extension
) {
  nextFields.extension = { ...nextFields.extension, subfields };
}
🤖 Prompt for agents
Code Review: Refactors the rules builder component by adding a persona-specific wrapper to fix conjunction overlapping issues in the UI. Consider adding a type guard to ensure fields.extension is always defined in the nested 'in' check.

1. 💡 Edge Case: 'in' guard assumes fields.extension is always defined
   Files: openmetadata-ui/src/main/resources/ui/src/components/Settings/Persona/PersonaAIContext/ContextRuleEditor/RuleQueryBuilderField.component.tsx:98-100

   `'subfields' in nextFields.extension` will throw a TypeError (`Cannot use 'in' operator on undefined`) if `baseConfig.fields.extension` is ever absent for a given search index. The current ElasticSearch config always defines `extension`, so this is not reproducible today, but the check is not self-guarding. Harden it with optional chaining, e.g. `if (!isEmpty(subfields) && nextFields.extension && 'subfields' in nextFields.extension)`.

   Fix (Guard against a missing extension key before using the 'in' operator.):
   if (
     !isEmpty(subfields) &&
     nextFields.extension &&
     'subfields' in nextFields.extension
   ) {
     nextFields.extension = { ...nextFields.extension, subfields };
   }

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 👍 / 👎 | Powered by Gitar — free for open source

@anuj-kumary
anuj-kumary enabled auto-merge August 18, 2026 12:39
@sonarqubecloud

Copy link
Copy Markdown

@github-actions

Copy link
Copy Markdown
Contributor

✅ Playwright Results — workflow succeeded

Validated commit 81713f5b75a43e31c754c0a613714e47897f2a3b in Playwright run 32137741572, attempt 1.

✅ 614 passed · ❌ 0 failed · 🟡 1 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) 54m 17s

⏱️ Max setup 3m 0s · max shard execution 16m 0s · max shard-job elapsed before upload 19m 12s · reporting 4s

🌐 210.99 requests/attempt · 2.71 app boots/UI scenario · 17.60% common-shard skew

Optimization targets still in progress:

  • Common shard skew was 17.6% (convergence target: at most 15%).
  • Browser traffic was 210.99 requests per attempt (convergence target: fewer than 200).
  • Application boot ratio was 2.71 per UI scenario (1728 boots / 637 scenarios; convergence target: at most 1).
Shard Passed Failed Flaky Skipped Lifecycle failed Lifecycle flaky
✅ Shard chromium-01 109 0 0 0 0 0
✅ Shard chromium-02 109 0 0 0 0 0
🟡 Shard chromium-03 111 0 1 0 0 0
✅ Shard chromium-04 133 0 0 0 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 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
🟡 1 flaky test(s) (passed on retry)
  • Pages/Entity.spec.tsUser as Owner with unsorted list (shard chromium-03, 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

Merged via the queue into main with commit c6f7297 Aug 19, 2026
89 of 91 checks passed
@anuj-kumary
anuj-kumary deleted the rules-builder branch August 19, 2026 11:51
@github-project-automation github-project-automation Bot moved this to Done ✅ in Shipping Aug 19, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Failed to cherry-pick changes to the 1.13 branch.
Please cherry-pick the changes manually.
You can find more details here.

@github-actions

Copy link
Copy Markdown
Contributor

Changes have been cherry-picked to the 2.0 branch.

github-actions Bot pushed a commit that referenced this pull request Aug 19, 2026
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 skip-pr-checks Bypass PR metadata validation check To release Will cherry-pick this PR into the release branch UI UI specific issues

Projects

Status: Done ✅

Development

Successfully merging this pull request may close these issues.

2 participants