Skip to content

Move the query-builder and filter glossary fields onto GlossaryTermPicker - #33736

Merged
anuj-kumary merged 13 commits into
mainfrom
glossary-term-picker-query-surfaces
Sep 22, 2026
Merged

anuj-kumary merged 13 commits into
mainfrom
glossary-term-picker-query-surfaces

Conversation

@anuj-kumary

@anuj-kumary anuj-kumary commented Sep 21, 2026 •

Copy link
Copy Markdown
Member

Describe your changes:

Fixes #

Follow-up to #33680, which consolidated the glossary-term assignment surfaces onto
GlossaryTermPicker. The query-builder and filter surfaces still had their own flat
async selects, so a glossary term looked and behaved differently depending on whether
you were assigning it or querying on it.

This moves the remaining five onto the shared picker.

Type of change:

  • Improvement

High-level design:

Query-builder fields mark themselves. The JSONLogic builders reach glossary terms,
classification tags and tier through the same tags.tagFQN subfield, so a field-path
match would swap the tag and tier controls too. Instead each glossary field opts in:

fieldSettings: withGlossaryTermField({ asyncFetch: ..., useAsyncSearch: true })

OMSelectWidget and OMMultiSelectWidget read that marker off fieldDefinition and
render GlossaryTermQueryWidget — which still hands RAQB the same FQN string (or array
of them). No widget registration changes, and operator handling plus the ES/JSONLogic
serialisation are untouched; only the rendered control differs. Both widgets are wired
because the advanced-search field's operators span single (select_equals) and multi
(select_any_in).

The DQ dashboard filter keeps its chip. That filter bar renders every filter as a
labelled button chip with a count and a staged Apply, and its regression test asserts
that. So the picker is given the triggerVariant="button" and commitMode="staged"
that FilterSelectDropdown uses — the chip affordance is unchanged and only the
dropdown contents become the shared tree. A new glossaryTerm descriptor carries the
selection, handled by both renderers (OSS and the core-components chip).

Surfaces migrated:

Area Surface
Advanced search EntityFields.GLOSSARY_TERMS
Semantics (JSONLogic) RELATED_TERMS → fullyQualifiedName
Data contracts glossaryTermField → tagFQN
Workflows Condition Builder — Glossary and Related Terms values
Data Quality dashboard glossary-term filter

fqnsToGlossaryTags / glossaryTagsToFqns centralise the FQN⇄TagLabel mapping that
the CSV cell editor already needed and now shares.

Deliberately not migrated: the Ontology Explorer visual query builder. Its options
must come from the loaded ontology graph and its value is a term UUID feeding
SPARQL, so the picker — which searches every glossary and yields FQNs — would offer
terms that cannot appear in a result and emit the wrong value type. It needs a
fixed-options mode on the picker, which is a separate change.

Two further fields were left alone as out of scope: JSONLogic "Column Tags" searches
tags and glossary terms together (migrating it would drop classification tags), and
the advanced-search "Glossary" field selects a glossary rather than a term.

Tests:

Use cases covered

  • Building an advanced-search rule on Glossary Terms from Explore
  • Adding a glossary-term rule to a data contract's semantics, alongside tag and tier
    rules that must keep the flat select
  • Setting a Glossary or Related Terms condition value in the workflow builder
  • Filtering the Data Quality dashboard by glossary term, then applying

Unit tests

  • Updated the affected suites for the new contracts.
  • useDataQualityDashboardFilters.test.ts — the new glossaryTerm descriptor
  • DataQualityDashboard.test.tsx — filter-bar rendering through the picker
  • Existing queryBuilderWidgets, AdvancedSearchClassBase, JSONLogicSearchClassBase
    and DataContractUtils suites pass unchanged, which is the check that the value
    contract did not move

Backend integration tests

  • Not applicable (no backend API changes).

Ingestion integration tests

  • Not applicable (no ingestion changes).

Playwright (UI) tests

  • DataQualityDashboard.spec.ts — the glossary filter's search box and rows now come
    from the picker, so that step targets them instead of the old dropdown's.

Manual testing performed

  1. Added an advanced-search rule on Glossary Terms and confirmed the emitted query is
    unchanged from the flat-select version
  2. Added glossary-term, tag and tier rules to one data contract's semantics and
    confirmed only the glossary rule shows the tree
  3. Set a Glossary condition value in a workflow and saved
  4. Filtered the DQ dashboard by glossary term and applied

UI screen recording / screenshots:

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 / integration / Playwright as applicable) and listed them above.

🤖 Generated with Claude Code

RetriggerConfidence Score: 5/5

The PR appears safe to merge, although the existing non-blocking staged-count inconsistency remains unresolved.

Findings

  1. P2 Staged counts disagree ▶
Summary

This PR migrates glossary-term query and filter surfaces to the shared hierarchical GlossaryTermPicker while preserving the existing FQN-based value contracts.

  • Marks applicable query-builder fields and routes both single- and multi-select widgets through the glossary picker.
  • Adds glossary-term picker support to workflow conditions and both Data Quality dashboard filter renderers.
  • Centralizes conversion between glossary FQNs and TagLabel values.
  • Updates unit and Playwright coverage for the new picker interactions.
  • Changes since the previous review only reorder imports in two test files.
Diagram
%%{init: {'theme': 'neutral'}}%%
flowchart LR
    F[Glossary-marked field] --> Q[Query-builder widget factory]
    Q --> P[GlossaryTermPicker]
    W[Workflow condition] --> P
    D[Data Quality filter] --> P
    P --> M[FQN / TagLabel conversion]
    M --> C[Existing query or filter contract]
Loading

Reviews (9) · Last reviewed commit: "Merge branch 'glossary-term-picker-query..."

Migrates the remaining glossary-term selectors: the Workflow Builder
condition values, the Data Quality dashboard filter, and the three
query-builder fields (advanced search, JSONLogic related terms, and the
data contract semantics rule).

The query-builder fields mark themselves with `withGlossaryTermField`
rather than being matched by path, because the JSONLogic builders reach
glossary terms, classification tags and tier through the same
`tags.tagFQN` subfield. The widgets swap only the rendered control and
still hand RAQB the same FQN string, so operators and the ES/JSONLogic
serialisation are unchanged.

`fqnsToGlossaryTags`/`glossaryTagsToFqns` centralise the FQN mapping the
CSV editor already needed.
…inside

The filter bar renders every filter as a labelled button chip, and its
regression test asserts that. Rendering the picker's input trigger there
broke both that check and the flow that drives the chip's search box.

Give the picker the button trigger and staged commit the other filters
use, so the chip affordance is unchanged and only the dropdown contents
become the shared tree.
…s do

The dashboard's E2E locators are label-based (search-dropdown-Tag,
search-dropdown-Glossary Term); switching to searchKey broke the
domain-tab filter-bar check.
@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 the UI UI specific issues label Sep 21, 2026
@github-actions

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!

@anuj-kumary anuj-kumary self-assigned this Sep 21, 2026
@github-actions

github-actions Bot commented Sep 21, 2026 •

Copy link
Copy Markdown
Contributor

✅ Playwright Results — workflow succeeded

Validated commit d66e7f968c8d8fac845bf3c3e8dceb7029ed00d5 in Playwright run 35688464262, attempt 2.

✅ 4504 passed · ❌ 0 failed · 🟡 8 flaky · ⏭️ 1 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) 1h 58m 57s

⏱️ Max setup 4m 51s · max shard execution 21m 33s · max shard-job elapsed before upload 25m 27s · reporting 22s

🌐 224.97 requests/attempt · 2.23 app boots/UI scenario · 39.13% common-shard skew

Optimization targets still in progress:

  • Common shard skew was 39.13% (convergence target: at most 15%).
  • Browser traffic was 224.97 requests per attempt (convergence target: fewer than 200).
  • Application boot ratio was 2.23 per UI scenario (10734 boots / 4810 scenarios; convergence target: at most 1).
Shard Passed Failed Flaky Skipped Lifecycle failed Lifecycle flaky
✅ Shard advanced-search-01 130 0 0 0 0 0
✅ Shard chromium-01 162 0 0 0 0 0
🟡 Shard chromium-02 151 0 1 0 0 0
✅ Shard chromium-03 183 0 0 0 0 0
✅ Shard chromium-04 181 0 0 0 0 0
✅ Shard chromium-05 168 0 0 0 0 0
✅ Shard chromium-06 177 0 0 0 0 0
✅ Shard chromium-07 176 0 0 0 0 0
✅ Shard chromium-08 168 0 0 0 0 0
✅ Shard chromium-09 186 0 0 0 0 0
✅ Shard chromium-10 157 0 0 0 0 0
✅ Shard chromium-11 161 0 0 0 0 0
🟡 Shard chromium-12 185 0 1 0 0 0
✅ Shard chromium-13 190 0 0 0 0 0
✅ Shard chromium-14 163 0 0 0 0 0
✅ Shard chromium-15 144 0 0 0 0 0
✅ Shard chromium-16 220 0 0 0 0 0
🟡 Shard chromium-17 187 0 2 0 0 0
✅ Shard chromium-18 171 0 0 0 0 0
🟡 Shard chromium-19 145 0 3 0 0 0
✅ Shard chromium-20 156 0 0 0 0 0
✅ Shard chromium-21 137 0 0 0 0 0
✅ Shard chromium-22 164 0 0 1 0 0
✅ Shard chromium-23 198 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 51 0 0 0 0 0
✅ Shard import-export-02 99 0 0 0 0 0
🟡 Shard ingestion-01 39 0 1 0 0 0
✅ Shard ingestion-02 59 0 0 0 0 0
✅ Shard reindex-01 40 0 0 0 0 0
✅ Shard search-01 12 0 0 0 0 0
✅ Shard search-rbac-01 29 0 0 0 0 0
🟡 8 flaky test(s) (passed on retry)
  • Features/ContextCenterArticles.spec.ts › Text formatting (shard chromium-02, 1 retry)
  • Flow/AddRoleAndAssignToUser.spec.ts › Verify assigned role to new user (shard chromium-12, 1 retry)
  • Features/DataQuality/DataQualityDashboard.spec.ts › Test Cases list filter — Data Product (shard chromium-17, 1 retry)
  • Features/AccessControlSettings.spec.ts › should show all 4 landing cards and navigate to each panel (shard chromium-17, 1 retry)
  • Features/AIMode/CustomPropertiesPanel.spec.ts › deletes a custom property via the confirmation modal (shard chromium-19, 1 retry)
  • Pages/ExplorePageRightPanel_KnowledgeCenter.spec.ts › Should remove user owner for knowledgeCenter (shard chromium-19, 1 retry)
  • Pages/ExplorePageRightPanel_KnowledgeCenter.spec.ts › Should clear description for knowledgeCenter (shard chromium-19, 1 retry)
  • Features/IncidentManager.spec.ts › Complete Incident lifecycle with table owner (shard ingestion-01, 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

@anuj-kumary anuj-kumary added safe to test Add this label to run secure Github workflows on PRs skip-pr-checks Bypass PR metadata validation check labels Sep 21, 2026
Comment on lines +141 to +151
<GlossaryTermPicker
commitMode="staged"
data-testid={`search-dropdown-${filter.label}`}
key={filter.key}
label={filter.label}
triggerVariant="button"
value={fqnsToGlossaryTags(filter.selectedFqns)}
onChange={(terms) =>
filter.onChange(glossaryTagsToFqns(terms))
}
/>

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.

P2 Staged counts disagree

Combining staged mode, the button trigger, and cascading root selection produces inconsistent counts. Selecting a glossary root stages the root plus its terms, so Apply shows N+1; the picker then removes the root before committing, and the resulting chip shows N. This makes the displayed selection count change merely because the user applied it.

Knowledge Base Used: Governance and collaboration experience

@greptile-apps

greptile-apps Bot commented Sep 21, 2026 •

Copy link
Copy Markdown
Contributor

Comments Outside Diff

These findings sit on lines the diff does not cover, so they could not be posted inline. Each one leaves this list once its file changes.

  • P1 Glossary picker is unreachable openmetadata-ui/src/main/resources/ui/src/utils/queryBuilderWidgets/OMSelectWidget.tsx:107 ▶

    The glossary marker is checked only after this async-select return. The Advanced Search Glossary Terms field is a marked select with both asyncFetch and useAsyncSearch enabled, so it always returns the existing flat Select.ComboBox and never reaches GlossaryTermQueryWidget. As a result, single-value glossary operators still use the old control instead of the shared picker.

…ping

Adds DQ_FILTER_TYPES alongside the existing DQ_FILTER_KEYS and uses it
for every `type` on DqFilterDescriptor — the declarations, the emitted
descriptors, both renderers and the hook test — so the discriminant is
no longer a bare string.

Also folds fqnsToGlossaryTags into a single reduce.
The earlier sweep only matched `type === '...'`, so the `type !== '...'`
guards in the hook test and the `type: '...' as const` fixtures in the
chip and bar tests were left as bare strings.
@gitar-bot

gitar-bot Bot commented Sep 22, 2026

Copy link
Copy Markdown
Code Review ✅ Approved 1 closed / 1 findings

🟡 Medium risk · Shared picker migration changes controls across query, workflow, and quality-filter surfaces

Migrates glossary-term filters and condition fields to the shared GlossaryTermPicker across advanced search, data contracts, workflows, and Data Quality dashboards, centralizing FQN-to-TagLabel conversion. The async select widget branch no longer shadows the glossary picker, and all migrated surfaces now share a consistent tree-based control while preserving FQN-based value contracts.

✅ 1 closed
✅ Bug: OMSelectWidget async branch shadows glossary picker

📄 openmetadata-ui/src/main/resources/ui/src/utils/queryBuilderWidgets/OMSelectWidget.tsx:107 📄 openmetadata-ui/src/main/resources/ui/src/utils/queryBuilderWidgets/OMSelectWidget.tsx:152-162 📄 openmetadata-ui/src/main/resources/ui/src/utils/AdvancedSearchClassBase.ts:939-946
The advanced-search Glossary Terms field opts into the picker via withGlossaryTermField({ asyncFetch: this.autocomplete(...), useAsyncSearch: true }), so both useAsyncSearch and asyncFetch are truthy on fieldDefinition. In OMSelectWidget, the if (useAsyncSearch && asyncFetch) block returns the flat async Select.ComboBox at line 107, before the isGlossaryTermQueryField(fieldDefinition) check at line 152 is ever reached. For the single-value operator (select_equals, typically the default for a select field), the rule keeps rendering the old flat async select instead of the shared GlossaryTermQueryWidget tree — the migration silently does not take effect. OMMultiSelectWidget is unaffected because it has no early async return before its glossary branch, so only the multi (select_any_in) operator gets the tree. Move the glossary check above the async block so it wins for both operators.

Review coverage

📋 Rules No rules evaluated

🧪 Functional validation Not enabled · Set up

🤖 Auto-approval Not enabled · Set up

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

@sonarqubecloud

Copy link
Copy Markdown

This branch was previously deployed

1 inactive deployment
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 UI UI specific issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants