Skip to content

Fixes 28727: flatten testCaseResolutionStatusDetails index mapping + validate highlight fields at save time (Parts A & B) - #31839

Merged
TeddyCr merged 12 commits into
open-metadata:mainfrom
TeddyCr:ISSUE-28727
Sep 2, 2026
Merged

TeddyCr merged 12 commits into
open-metadata:mainfrom
TeddyCr:ISSUE-28727

Conversation

@TeddyCr

@TeddyCr TeddyCr commented Aug 20, 2026 •

Copy link
Copy Markdown
Collaborator

Describe your changes:

Fixes #28727

Both parts of #28727 — this closes the issue. Issue #28727 has two parts and this PR now carries both.

  • Part A — the testCaseResolutionStatusDetails mapping↔schema mismatch (dead resolved.* mapping + dead search boost).
  • Part B — validating highlight fields at Search Settings save time, plus the matching UI affordance.

A correction to the issue text for reviewers: #28727 says Part B should reuse SearchSourceBuilderFactory.isHighlightUnsafeField, added by #28674. That symbol never existed on main. The equivalent query-time guard landed separately via #29073 (7738765de58) as OpenSearchSourceBuilderFactory.isFlattenedExtensionField — OpenSearch-only and hardcoded to extension. #28674 was later rewritten into a config-driven version of Part B and closed unmerged on 2026-08-24, so the highlight flag it introduced never landed. Part B here is built on main and reuses the concept, not the (nonexistent) symbol.

I flattened the testCaseResolutionStatusDetails index mapping so it matches its JSON Schema, and repointed the resolution-comment search boost at the path documents actually carry.

The mapping declared a resolved wrapper object that the schema makes structurally impossible. testCaseResolutionStatus.json models the field as oneOf [assigned.json, resolved.json], and both branches are "additionalProperties": false — resolved.json declares testCaseFailureReason / testCaseFailureComment / resolvedBy directly. So a resolved key could never legally appear in a document, and indeed never did: doc building is generic (SearchIndex → JsonUtils.getMap(entity); TestCaseResolutionStatusIndex only adds fqnParts, @timestamp, and parent relationships). The consequence was a dead 10× boost — testCaseResolutionStatusDetails.resolved.testCaseFailureComment in TestCaseResolutionStatusIndex.getFields() matched nothing, in every language.

"dynamic": true on that node was masking the bug: it indexed the real flat fields anyway, but as standard-analyzer text rather than the declared types. That broke exact match on testCaseFailureReason (analyzed text never matches an exact term) and broke CJK/Cyrillic comment search (the standard analyzer splits Japanese/Chinese into single characters and does not stem Russian).

Type of change:

  • Bug fix

High-level design — Part A

Approach — the issue's option 1: correct the mapping to the schema, don't reshape the document. The schema and the document are already flat and are the source of truth; only the mapping was wrong. Reshaping the document to match the mapping would mean writing a wrapper key that additionalProperties: false forbids.

Files changed (7):

File Change
openmetadata-spec/.../elasticsearch/{en,jp,ru,zh}/test_case_resolution_status_index_mapping.json Move testCaseFailureReason / testCaseFailureComment / resolvedBy up one level, out of the resolved wrapper. Pure unwrap — no other edit.
openmetadata-service/.../search/indexes/TestCaseResolutionStatusIndex.java Boost repointed to testCaseResolutionStatusDetails.testCaseFailureComment (one line).
openmetadata-service/src/test/.../IndexMappingNestedFieldConsistencyTest.java New mapping↔schema invariant.
openmetadata-integration-tests/.../SearchConsumerFieldBehaviorIT.java Resolved-variant document + 3 behavioral tests.

There is no separate OpenSearch resource tree — the same four files serve both engines, with OsUtils.enrichIndexMappingForOpenSearch rewriting at runtime.

Per-locale analyzers deliberately preserved, not homogenized. en/ru keep om_analyzer; jp keeps om_analyzer_jp (kuromoji) and its fields.ngram; zh keeps ik_max_word and its fields.ngram. Verified byte-for-byte: en ≡ ru in this subtree, and unwrapping the base resolved object with jq yields output identical to this branch in all four locales.

"dynamic": true kept — deliberate. After flattening, every property of both oneOf branches is mapped explicitly, so dynamic is no longer load-bearing for correctness. It is retained as the forward-compatibility net: a property added to assigned.json / resolved.json still gets indexed rather than silently dropped, and the new unit test fires immediately in that case. Flipping it to false is a separate hardening decision and would couple a silent-data-loss behavior change to a mapping correction.

Alternative rejected: rewriting the document in TestCaseResolutionStatusIndex to emit a resolved wrapper. That would contradict the schema, break the UI and Python (both already read/write the flat shape), and invalidate the existing testCaseResolutionStatusDetails.assignee.name filter pattern.


High-level design — Part B

Problem. Search Settings accepted a highlight field the index mapping can never highlight. Two mapped shapes cannot highlight: flattened (rewritten to flat_object for OpenSearch by OsUtils) has no analyzer and fails the highlight shard — a 500 on the search; enabled: false is kept in _source but never indexed, so a highlight on it silently matches nothing. The bad value was only neutralised at query time and still lived in the settings.

Approach — derive from the mappings, don't maintain a list. HighlightFieldClassifier walks the index-mapping resources once and classifies a dotted path as SUPPORTED, NOT_INDEXED, or NOT_ANALYZABLE. This same knowledge previously lived as hardcoded path lists that had to be restated on every mapping change — see the duplicated STALE_FLATTENED_CHILDREN_FIELDS in the v1130 and v11210 migration utils — and drifted each time.

A field that is absent from the mapping stays supported: the highlighter skips unmapped fields without erroring, so rejecting them would break configurations that merely name a field an index does not carry.

One classifier backs three call sites:

Call site Role
SearchSettingsHandler.validateHighlightFields rejects the value on save (400)
SearchSettingsHandler.annotateHighlightableFields marks allowedFields so the UI only offers a toggle that works
OpenSearchSourceBuilderFactory.buildHighlightsV2 query-time guard, replacing isFlattenedExtensionField

This closes a live gap. The guard it replaces matched only extension/extension.*. extension is now {"type":"object","enabled":false} in 35 mappings, while the one genuinely flattened field left — aiGovernance.complianceStatus (ai_application, llm_model, mcp_server) — was not covered. The classifier catches it; flattenedFieldIsNotAnalyzable asserts so. The old extension behaviour is preserved deliberately and asserted by queryTimeGuardStillDropsExtensionAsBefore, because clusters whose indexes were created while extension was still flattened keep that mapping until a reindex.

Validation hooks the REST payload, not mergeSearchSettings — deliberate. mergeSearchSettings is the obvious home and is a trap: SettingsCache.initialize catches only IOException (SettingsCache.java:205), so throwing from the merge path would fail startup on any cluster already carrying a bad value. The check runs on the incoming payload in SystemResource.createOrUpdateSetting, alongside the existing validateGlobalSettings.

The UI flag is derived, not seeded. The closed #28674 hand-typed "highlight": true into ~200 seed entries and added migration v11211 to scrub stored values against it. Here the flag is computed from the same classifier the validator uses, and the seed is untouched — so what the UI offers and what the API accepts cannot disagree, and no migration is needed. annotatedFlagAgreesWithWhatTheSavePathAccepts walks every shipped allowed field and asserts the two agree.

Part B needs no reindex and no migration — no mapping changes, no stored-data changes. The reindex note below applies to Part A only.

Known limitation, deliberately out of scope. PATCH /v1/system/settings/{settingName} (SystemResource.java:765) writes straight to the repository with no search-settings validation. It bypasses this check — and already bypasses the pre-existing validateGlobalSettings, so keywordWeight: 5 can be set through it today. Pre-existing hole affecting all settings validation; the query-time guard remains as defense-in-depth for values arriving that way.

⚠️ Upgrade note — this requires a reindex

Applies to Part A only. This change requires a reindex of test_case_resolution_status_search_index. migrate alone is not sufficient and will log a mapping-update failure for that index. (Part B requires neither a reindex nor a migration.)

migrate reaches searchRepository.updateIndexes() (OpenMetadataOperations.java:1196), which issues PUT _mapping. On any cluster that has ever resolved an incident, dynamic: true has already created those fields as text, so declaring them keyword is an incompatible type change and the request is rejected 400:

illegal_argument_exception: mapper [testCaseResolutionStatusDetails.<field>]
cannot be changed from type [text] to [keyword]

Three things worth knowing:

  1. The rejection is atomic — no property in that request lands, not just the four here. Any unrelated mapping change shipped for this index in the same release is discarded with it. (Verified by adding an unrelated probe field to the same request and confirming it did not land either.)
  2. Which field the engine names first is engine-dependent — OpenSearch 3.4.0 reported …testCaseFailureReason, Elasticsearch 9.3.0 reported …resolvedBy.id for the identical request. Same 400, same atomicity; a different field name is not a different bug.
  3. The cause is swallowed on the OpenSearch path — OpenSearchIndexManager logs "Failed to Update Open Search index {}" without the exception, so an operator sees one bare error line and a silently stale mapping.

The supported path is ./bootstrap/openmetadata-ops.sh reindex (no trailing period — it is parsed as part of the subcommand). It is also the only path that drops the stale resolved sub-object, since PUT _mapping cannot remove a field. IndexMappingVersionTracker hashes each mapping, so the smart-reindex plan picks up testCaseResolutionStatus and recreates just that index — no DB migration is involved.

Mitigating point: because "dynamic": true was retained, un-reindexed clusters still get a partial improvement immediately — the repointed boost now targets a path dynamic mapping has already created (as standard-analyzer text) rather than a path with no values at all. Full correctness (declared keyword, per-locale analyzers) arrives with the reindex.

Tests:

Use cases covered

  • Searching the Incident Manager index for a word that appears only in an incident's resolution comment returns that incident (previously returned nothing, in every language).
  • The Resolved branch of testCaseResolutionStatusDetails is indexed and searchable at all — previously no test anywhere indexed a Resolved-variant document.
  • Comment search works in Japanese, Chinese and Russian, not just English, because the per-locale analyzer is applied instead of the standard-analyzer fallback.
  • testCaseFailureReason supports exact-match term lookup, i.e. its declared keyword type is actually in effect.
  • Existing Assigned-branch behavior (status filter, assignee.name filter, test-case/origin-entity filters) is unchanged.

Unit tests

  • I added unit tests for the new/changed logic.
  • Files updated: openmetadata-service/src/test/java/org/openmetadata/service/search/IndexMappingNestedFieldConsistencyTest.java
  • resolutionStatusDetailsMappingMustMatchSchemaProperties asserts the mapped subfield set equals the union of the properties of every oneOf branch, read from the JSON Schema at runtime rather than hardcoded — so adding a property to assigned.json / resolved.json fails this test until the mappings follow. It guards the class of bug, not just this instance.
  • Result: Tests run: 7, Failures: 0, Errors: 0, Skipped: 0 (1 failure before the fix).

Coverage on the changed class — measured, and honestly short of the 90% target. Ran mvn -P static-code-analysis -pl openmetadata-service test jacoco:report scoped to the search tests. TestCaseResolutionStatusIndex.java line coverage is 62.8% (27/43):

Method Lines
<init> 1/1 100%
buildSearchIndexDocInternal 5/5 100%
getEntityTypeName 1/1 100%
setParentRelationships 20/28 71.4%
getEntity 0/1 0%
getFields — the method this PR changes 0/7 0%

The 0% on getFields is a measurement artifact, not an untested line: getFields() is executed directly by the new integration test (incidentResolutionCommentSearchReturnsIncidentInAllLanguages builds its query from TestCaseResolutionStatusIndex.getFields()), and that test lives in openmetadata-integration-tests — a separate Maven module whose execution this -pl openmetadata-service jacoco run does not observe. The changed line is covered by an automated test that fails without the fix; it is simply not covered by a unit test in the measured module. The remaining gaps (setParentRelationships, getEntity) are pre-existing and untouched by this PR.

Backend integration tests

  • I added integration tests in openmetadata-integration-tests/.
  • File updated: openmetadata-integration-tests/src/test/java/org/openmetadata/it/tests/SearchConsumerFieldBehaviorIT.java

This class boots a real OpenSearch 3.4.0 testcontainer with analysis-kuromoji and analysis-ik, creates the real mapping for every language in IndexMappingLanguage (en/jp/ru/zh), indexes real documents and runs the actual consumer queries. I added a Resolved-variant document alongside the existing Assigned one, plus three tests:

Test What it asserts Failed before the fix?
incidentResolutionCommentSearchReturnsIncidentInAllLanguages The production consumer query — a most_fields / operator:and multi_match built from TestCaseResolutionStatusIndex.getFields() — returns the incident when searching a word unique to its comment. Because the field list comes from production code, repointing a boost at a dead path fails this test. Yes — is broken in language(s): [en, jp, zh, ru], 0 hits everywhere
failureReasonSupportsExactMatchTermInAllLanguages A term on testCaseResolutionStatusDetails.testCaseFailureReason returns the incident, i.e. the declared keyword is in effect. A type probe, not a product feature — nothing filters on the reason today; it is what distinguishes "explicitly mapped" from "accidentally indexed by dynamic:true". Yes — is broken in language(s): [en, jp, zh, ru]
resolutionCommentUsesLanguageAnalyzerInAllLanguages _analyze on the comment field yields each locale's expected token, proving the per-locale analyzer survived the flatten. Yes — ru expected 'продаж' but got [ежемесячные, продажи], zh expected '销售' but got [北, 京, 大, 学, 的, 销, 售, 报, 表], jp expected '東京' but got [東, 京, タワー, の, 売, 上]
  • Result: Tests run: 20, Failures: 0, Errors: 0, Skipped: 0 (3 failures before the fix; the 17 pre-existing tests passed throughout, so the added document perturbs nothing).

Elasticsearch — verified by hand only. The automated IT runs OpenSearch 3.4.0. On a real ES 9.3.0 container the branch mapping creates cleanly, the flat Resolved document indexes, and both the boost query and the testCaseFailureReason term filter return 1 hit — against 0 hits on the base mapping. This was done manually during review; no automated ES coverage exists for this index, so a future ES-only regression would not be caught by CI.

Ingestion integration tests

  • Not applicable — no ingestion changes. ingestion/.../sample_data.py already writes the flat shape and needed no change.

Part B tests

Unit — HighlightFieldClassifierTest (8 tests, new). Reads the real mapping resources, so each assertion is a statement about the shipped mappings: extension → NOT_INDEXED; extension.someCustomProperty and columns.children.name inherit their parent's verdict; aiGovernance.complianceStatus → NOT_ANALYZABLE (the case the old guard missed); name/description/columns.name → SUPPORTED; an unmapped field and an unknown asset type stay supported; extension/extension.* still dropped by the query-time guard.

Unit — SearchSettingsHandlerTest (6 added, 20 total). Rejects a non-indexed and a flattened highlight field with a message naming the field and the reason; accepts an analyzed one; the shipped seed passes the validator; the query-time union guard drops none of the shipped highlight fields; the annotated flag agrees with what the save path accepts.

Backend IT — HighlightFieldSaveValidationIT (4 tests, new). servedAllowedFieldsCarryTheHighlightFlag asserts highlight=true on the real GET /system/settings/searchSettings response. It guards the wiring: the unit tests call annotateHighlightableFields directly, so they pass even when nothing in production calls it — which is exactly the regression that reached review. The remaining three: PUTs to the real /v1/system/settings and asserts 400 for extension.foundry_rid (message names the field and says "not indexed") and for dataModel.columns.children.name, and 2xx for description — so the negatives cannot pass merely because the endpoint rejects any highlightFields edit.

Two existing ITs updated. ExtensionHighlightSearchIT and FlattenedChildrenHighlightSearchIT configure exactly the values now rejected on save, to prove the query-time guard tolerates them. Their PUT would now 400, so they write the bad value through the repository instead — which is also truer to what they test: a value stored before this check existed. Their query-time assertions are unchanged.

Playwright (UI) tests

  • Added — SearchSettings.spec.ts → "Highlight toggle is offered for analyzed fields", which drives the real Search Settings page against a real server and asserts the toggle renders enabled. This is the level the regression above lived at: the Jest test supplies entityFields as props, so it can never catch a backend that stops annotating the flag. yarn lint:playwright passes with 0 errors and no new warnings.
  • Not applicable — Jest covers the change. Part A has no UI changes. Part B's UI change is one control's disabled state, covered by FieldConfiguration.test.tsx (5 passed), including a new case asserting the toggle is disabled and the change handler is not called. This is component-level state, not a user journey across pages, so it does not warrant an E2E test.

Manual testing performed ✅

Part A — mapping flatten and boost

Steps 1 and the reindex/mapping inspection below are the reproducible procedure; steps marked (not verified) were not executed against a running OpenMetadata stack — the equivalent effects are covered by the automated IT against a real engine, and the PUT _mapping rejection in step 3a was reproduced directly against both engines rather than through openmetadata-ops.sh.

Commands below are in fenced blocks on purpose — copy them with the block's copy button. An inline
command followed by a sentence period is easy to select with the period attached, and
openmetadata-ops.sh reindex. fails with Unmatched argument at index 2: 'reindex.'.

  1. Build and install:
    mvn install -pl openmetadata-spec -DskipTests
    mvn install -nsu -pl openmetadata-service -DskipTests
  2. (not verified) Bring up a stack, then log in as admin:
    docker compose -f docker/development/docker-compose.yml up -d
  3. Reindex:
    ./bootstrap/openmetadata-ops.sh reindex
    Expect Index mapping changed for entity: testCaseResolutionStatus and only that entity in the plan; a second reindex reports no changes.
    • 3a. Confirm the migrate-only path fails as described in the upgrade note above (400, atomic, cause swallowed on OpenSearch).
  4. Confirm the live mapping is flat and correctly typed:
    curl -s 'http://localhost:9200/test_case_resolution_status_search_index/_mapping' \
      | jq '..|.testCaseResolutionStatusDetails? // empty | .properties | keys'
    
    Expect ["assignee","resolvedBy","testCaseFailureComment","testCaseFailureReason"] and no resolved. Then check testCaseFailureComment carries "type":"text" with the locale's analyzer (om_analyzer en/ru, om_analyzer_jp jp, ik_max_word zh) and, for jp/zh, a fields.ngram subfield.
  5. (not verified) Produce a resolved incident: Data Quality → a failing test case → Incident Manager → status Resolved, reason FalsePositive, comment flakyupstream feed was backfilled.
  6. (not verified) See the boost take effect — query by a word appearing only in the comment:
    curl -s -u admin:admin \
      'http://localhost:8585/api/v1/search/query?index=test_case_resolution_status_search_index&q=flakyupstream&from=0&size=10'
    
    Pre-fix hits.total.value: 0; post-fix the incident is returned. Re-run with &explain=true and confirm the winning clause is testCaseResolutionStatusDetails.testCaseFailureComment^10.0, ranking a comment match above a testCaseResolutionStatusType^1.0 match.
  7. (not verified) Confirm no Assigned-branch regression: the Incident Manager list still filters by assignee (SearchListFilter → testCaseResolutionStatusDetails.assignee.name) and the incident detail panel still renders reason/comment/resolvedBy.
Part B — save-time validation and the UI toggle

Continuing on the same stack. No reindex or migration is needed for these steps.

  1. The highlight flag is served. It is derived, not stored — absent from searchSettings.json on disk, present in the payload:

    curl -s -u admin:admin 'http://localhost:8585/api/v1/system/settings/searchSettings' \
      | jq '.config_value.allowedFields[] | select(.entityType=="table") | .fields[]
            | select(.name=="description" or .name=="name") | {name, highlight}'
    

    Expect "highlight": true on both. The flag is derived, not stored — it is absent from
    searchSettings.json on disk and appears only in the served payload.

    Note the snake_case. The settings API is config_type / config_value on the wire, not
    camelCase. .configValue returns null and jq prints nothing — which reads as "looks fine"
    rather than as an error.

    This step earns its place: it caught a real regression during review. The flag was originally
    annotated in readDefaultSearchSettings, which is not the path that produces the served
    payload — SettingsCache.initialize writes the store from the seed file directly and never
    annotated it. Every field came back as the schema default false, and because the UI reads
    entityFieldConfig?.highlight ?? false, every highlight toggle rendered disabled. It is now
    annotated in getSettingByName, so the served flag is correct regardless of which path wrote the
    stored settings — including clusters that persisted them before the flag existed.

  2. (not verified) No existing toggle changes state — the important regression check. Go to Settings → Preferences → Search Settings → Table (/settings/preferences/search-settings/table) and expand name, description, columns.name. Every Highlight toggle is still interactive. Zero shipped search fields are unhighlightable, so this change must be invisible on a default install.

  3. (not verified) The disabled toggle. Since a default install shows none, add one: on the same page add a search field named extension.foundry_rid (it renders with the blue Custom badge), then expand it. Its Highlight toggle is greyed out and unclickable, and hovering shows "This field cannot be highlighted. Only analyzed text fields support highlighting." Contrast with description on the same page, which stays interactive.
    Why: extension is {"type":"object","enabled":false} in table_index_mapping.json, so nothing beneath it is indexed and a highlight there could never match.

  4. The save path rejects it — the toggle is an affordance, the 400 is the enforcement. For API clients that bypass the UI:

    curl -s -u admin:admin 'http://localhost:8585/api/v1/system/settings/searchSettings' \
      | jq '.config_value.assetTypeConfigurations |= map(
              if .assetType=="container"
              then .highlightFields += ["extension.foundry_rid"] else . end)' \
      | jq '{config_type:"searchSettings", config_value:.config_value}' \
      | curl -s -u admin:admin -X PUT -H 'Content-Type: application/json' \
          -d @- 'http://localhost:8585/api/v1/system/settings' -w '\nHTTP %{http_code}\n'
    

    Expect HTTP 400:

    Highlight field 'extension.foundry_rid' for asset type 'container' is not indexed
    (enabled:false in the index mapping), so it can never be highlighted. Remove it from highlightFields.
    

    Repeat with dataModel.columns.children.name for the same 400, and with description for HTTP 200.

  5. (not verified) Search still works. Search any container or table from Explore; results and highlighting are unchanged.

Gates run for Part B:

Gate Result
mvn test -nsu -pl openmetadata-service -Dtest='org.openmetadata.service.search.**.*Test,SearchSettingsHandlerTest' Tests run: 2246, Failures: 0, Errors: 0, Skipped: 0
mvn spotless:check -nsu -pl openmetadata-service,openmetadata-integration-tests 0 needs changes to be clean in both, BUILD SUCCESS
mvn test-compile -nsu -pl openmetadata-integration-tests BUILD SUCCESS
yarn test src/components/SearchSettings/FieldConfiguration Tests: 5 passed, 5 total
yarn ui-checkstyle:changed 0 errors; ✔ No new Antd imports or .less files
npx tsc --noEmit 572 pre-existing errors repo-wide, 0 in any file this PR touches (not a CI gate; checkstyle excludes tsc)

RED checks — each fix proven to fail without it:

  • Stubbing the throw in validateHighlightFields behind if (false) → saveIsRejectedForNonIndexedHighlightField and saveIsRejectedForFlattenedHighlightField both fail with "Expected SystemSettingsException to be thrown, but nothing was thrown."
  • Forcing isHighlightAllowed = true in FieldConfiguration.tsx → Should disable the highlight toggle… fails (1 failed, 4 passed). Restored → 5 passed.

Not executed: HighlightFieldSaveValidationIT and the two updated ITs are compile-verified only — they need an OpenSearch container and a booted app. Steps 9, 10 and 12 were likewise not run against a live stack.

Gates run on the rebased branch for Part A (spec + service installed from the working tree first):

Gate Result
mvn spotless:check -nsu -pl openmetadata-service,openmetadata-integration-tests 0 needs changes to be clean in both modules, BUILD SUCCESS
mvn test -nsu -pl openmetadata-service -Dtest='org.openmetadata.service.search.**.*Test,SearchListFilterTest' Tests run: 2231, Failures: 0, Errors: 0, Skipped: 0
mvn test -nsu -pl openmetadata-integration-tests -Dtest=SearchConsumerFieldBehaviorIT Tests run: 20, Failures: 0, Errors: 0, Skipped: 0

UI screen recording / screenshots:

Part A contains no UI changes. Part B changes one component: FieldConfiguration.tsx (Settings → Preferences → Search Settings → entity).

The change is a single control's state. On a default install nothing changes — none of the search fields shipped in searchSettings.json are unhighlightable (asserted by queryTimeGuardKeepsEveryShippedHighlightField), so every existing Highlight toggle stays interactive. The new state is only reachable by adding a custom-property search field:

Field Highlight toggle
description, name, columns.name (shipped) interactive, unchanged
extension.foundry_rid (custom property, blue Custom badge) greyed out, with tooltip "This field cannot be highlighted. Only analyzed text fields support highlighting."

Screen recording not attached — the visual delta is one disabled switch plus a tooltip, and it is covered by FieldConfiguration.test.tsx (Should disable the highlight toggle for a field that cannot be highlighted, which asserts both toBeDisabled() and that the change handler is not called). Step 5 of the manual testing section is the exact click-path to reproduce it. Happy to record one if a reviewer wants it.

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: one JSON Schema changed, in Part B. configuration/searchSettings.json gains an optional highlight boolean on allowedFields[].fields[]. Generated output was regenerated, not hand-edited: Java POJOs via mvn clean install -pl openmetadata-spec (build-time, not committed), and the three committed TS types (configuration/searchSettings.ts, settings/settings.ts, api/search/previewSearchRequest.ts) via json2ts.sh — followed by yarn license-header-fix, because quicktype strips the Apache header. The committed TS diff is purely additive (+21/−0). make generate (Pydantic) is not required: nothing in ingestion/ reads allowedFields. No SQL migration. Part A's mapping drift is tracked by content hash in IndexMappingVersionTracker and resolved by reindex (see the upgrade note); Part B changes no stored data — the highlight flag is derived at read time. Precedent for the mapping resources: 14b3a57 (fix(search): add nested customPropertiesTyped mapping to 5 entity indexes #30501) changed 20 mapping JSONs with no SQL and no version bump.
  • For UI changes: one component (FieldConfiguration.tsx) plus one i18n key, translated in all 19 non-English locales rather than left as the English placeholder yarn i18n inserts. yarn ui-checkstyle:changed passes with 0 errors, including tw-guard — the tooltip uses Tooltip/TooltipTrigger from @openmetadata/ui-core-components, since adding Tooltip to the file's existing antd import would have been flagged as new Ant Design debt.
  • I have added tests (unit / integration) and listed them above.
  • I have added a test that covers the exact scenario we are fixing. All four new tests fail on main and pass here; the RED output is quoted in the tables above.

🤖 Generated with Claude Code

Greptile Summary

The PR aligns test-case resolution-status mappings with the schema and introduces mapping-derived highlight-field validation and UI affordances.

  • Flattens resolution-detail mappings and updates the resolution-comment search field.
  • Validates unsupported highlight fields while preserving safe handling of legacy stored settings.
  • Annotates settings responses with highlight support and disables unsupported UI toggles.
  • Adds backend, integration, component, and Playwright coverage.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains.

Important Files Changed

Filename Overview
openmetadata-service/src/main/java/org/openmetadata/service/search/HighlightFieldClassifier.java Builds mapping-derived highlight-support classifications for validation, response annotation, and query-time filtering.
openmetadata-service/src/main/java/org/openmetadata/service/resources/system/SearchSettingsHandler.java Adds highlight validation, legacy-value cleanup, and response-facing field annotation.
openmetadata-service/src/main/java/org/openmetadata/service/resources/system/SystemResource.java Applies validation on settings updates and consistently annotates search-settings responses.
openmetadata-service/src/main/java/org/openmetadata/service/search/IndexMappingProperties.java Introduces reusable traversal of dotted index-mapping property paths.
openmetadata-service/src/main/java/org/openmetadata/service/search/opensearch/OpenSearchSourceBuilderFactory.java Replaces the hardcoded extension exclusion with the shared mapping-derived query guard.
openmetadata-service/src/main/java/org/openmetadata/service/search/indexes/TestCaseResolutionStatusIndex.java Repoints resolution-comment search boosting to the document’s actual flat field.
openmetadata-spec/src/main/resources/json/schema/configuration/searchSettings.json Adds the optional derived highlight-support flag to allowed search fields.
openmetadata-ui/src/main/resources/ui/src/components/SearchSettings/FieldConfiguration/FieldConfiguration.tsx Disables highlighting for fields the server identifies as unsupported and explains the restriction.
openmetadata-spec/src/main/resources/elasticsearch/en/test_case_resolution_status_index_mapping.json Flattens resolution-detail properties to match the schema and indexed document shape.
openmetadata-integration-tests/src/test/java/org/openmetadata/it/tests/search/HighlightFieldSaveValidationIT.java Covers response annotation and acceptance or rejection of highlight-field settings across REST paths.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  M[Index mappings] --> C[HighlightFieldClassifier]
  C --> V[Save-time validation]
  C --> R[Response annotation]
  C --> Q[Query-time guard]
  R --> U[Search Settings UI]
  V --> P[Persist valid settings]
  Q --> S[Safe search highlights]
Loading

Reviews (7): Last reviewed commit: "Fixes #28727: derive the highlight flag ..." | Re-trigger Greptile

Context used (5)

TeddyCr and others added 3 commits August 20, 2026 09:33
…pping to match its schema

The resolution-status index mapping declared a `resolved` wrapper object under
`testCaseResolutionStatusDetails` that no document can ever carry. The schema models
that field as a oneOf over assigned.json / resolved.json, and resolved.json declares
testCaseFailureReason / testCaseFailureComment / resolvedBy directly with
"additionalProperties": false — so a `resolved` key is illegal, not merely absent.
Doc building is generic (SearchIndex uses JsonUtils.getMap and
TestCaseResolutionStatusIndex only adds fqnParts/@timestamp/parent relationships),
so the indexed document has always been flat.

Consequences: the 10x boost on
`testCaseResolutionStatusDetails.resolved.testCaseFailureComment` matched nothing in
any language, and the real flat fields were only indexed by accident via
"dynamic": true — as analyzed text with the standard analyzer, so exact-match on
testCaseFailureReason failed and CJK/Russian comment search was broken.

Move the three properties up one level in all four locale mappings and repoint the
boost. Each locale keeps its own analyzer (om_analyzer for en/ru, om_analyzer_jp for
jp, ik_max_word for zh) and jp/zh keep their fields.ngram subfield.

"dynamic": true is kept: after flattening, every property of both oneOf branches is
mapped explicitly, so it is no longer load-bearing, but it remains the
forward-compatibility net that lets a newly added schema property be indexed rather
than silently dropped. Flipping it is a separate hardening decision. Keeping it also
gives un-reindexed clusters a partial improvement immediately, since the repointed
boost now targets a path dynamic mapping already created.

UPGRADE: this requires a reindex of test_case_resolution_status_search_index.
No DB migration is involved — IndexMappingVersionTracker hashes each mapping and the
smart-reindex plan recreates just the changed index. But `migrate` alone is not
enough and will not silently no-op: on any cluster that has ever resolved an
incident, dynamic mapping already created
testCaseResolutionStatusDetails.testCaseFailureReason as text, so the PUT _mapping
that updateIndexes() sends is rejected 400 on both engines with "mapper [...] cannot
be changed from type [text] to [keyword]" (reproduced on OpenSearch 3.4.0 and
Elasticsearch 9.3.0). The rejection is atomic, so no property in that request lands,
and on the OpenSearch path the cause is swallowed by
OpenSearchIndexManager's catch block. Only the recreate path applies the new mapping
and drops the stale `resolved` sub-object.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
…ch behavior tests

Nothing indexed a Resolved-variant resolution-status document and nothing asserted
the boost field list, which is why the dead `resolved` wrapper survived.

SearchConsumerFieldBehaviorIT now indexes both oneOf branches (Assigned and Resolved)
into the real per-language OpenSearch mappings and adds three probes:

- the Incident Manager free-text search, built from
  TestCaseResolutionStatusIndex.getFields() so repointing a boost at a path no
  document carries fails the test;
- an exact-match term on testCaseFailureReason, which distinguishes an explicitly
  mapped keyword from a field merely picked up by "dynamic": true;
- _analyze on testCaseFailureComment per locale, which pins the per-locale analyzer
  and would catch a flatten that homogenized them.

IndexMappingNestedFieldConsistencyTest gains a mapping-to-schema invariant that reads
the oneOf branch schemas at runtime rather than hardcoding field names, so adding a
property to assigned.json / resolved.json fails until the mappings follow.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
…roves

incidentFailureReasonFilterReturnsIncidentInAllLanguages reported "Incident Manager
failure-reason exact match ... is broken in language(s)", but no production search
query filters on testCaseResolutionStatusDetails.testCaseFailureReason — the UI reads
it from _source, and IncidentTcrsSyncHandler / TestCaseResolutionStatusRepository read
it from the task payload. The name and message would send someone hunting for a
broken feature that does not exist.

The test is valuable as a mapping-type probe: it is what distinguishes an explicitly
declared keyword from a field merely picked up by "dynamic": true as analyzed text,
on which an exact term can never match. Rename it to
failureReasonSupportsExactMatchTermInAllLanguages, reword the assertion to describe
the type guarantee rather than a feature, and add a javadoc saying why the probe
exists. No behaviour change.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
@TeddyCr
TeddyCr requested a review from a team as a code owner August 20, 2026 16:47
Copilot AI lite review requested due to automatic review settings August 20, 2026 16:47

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.

@github-actions

github-actions Bot commented Aug 20, 2026 •

Copy link
Copy Markdown
Contributor

✅ PR checks passed

The linked issue has a description and all required Shipping project fields set. Thanks!

@github-actions github-actions Bot added Ingestion safe to test Add this label to run secure Github workflows on PRs labels Aug 20, 2026
Copilot AI review requested due to automatic review settings August 25, 2026 00:05

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.

@github-actions github-actions Bot added safe to test Add this label to run secure Github workflows on PRs and removed safe to test Add this label to run secure Github workflows on PRs labels Aug 25, 2026
…ight verdict

Three defects found in review, all in the same seam.

1. The UI dropped the flag. EntitySearchSettings mapped allowedFields to
   {name, description} only, so `highlight` never reached FieldConfiguration
   and every toggle rendered disabled no matter what the server sent.

2. allowedFields is not a complete list of configurable fields — 63 shipped
   search fields have no entry (name.keyword, name.compound, columnNamesFuzzy,
   …). The UI renders a row per search field and reads the verdict from
   allowedFields, so those fields had no entry and read as unhighlightable.
   annotateHighlightableFields now backfills a placeholder entry for every
   configured search field, on the read path only.

3. Save-time validation could lock an upgraded cluster out of Settings > Search
   (reported by gitar-bot). A highlight field stored before this check existed
   is round-tripped by the UI on every save, so every subsequent PUT — even for
   an unrelated edit — was rejected with an error the admin cannot clear from
   the UI. A value already present in the stored settings is now dropped and
   logged; only values this payload introduces are rejected.

Also addresses the duplication in HighlightFieldClassifier: the recursive
properties walk with dotted-path building already existed in
IndexMappingNestedFieldConsistencyTest (findExtensionTypeViolations /
findViolations / getTopLevelProperties). Extracted to IndexMappingProperties
and used by both, which removes the Map-based asMap/childProperties adapters
that existed only because the classifier walked a different representation than
the rest of the codebase.

The remaining gitar finding — the query-time union guard drops a field unsafe
in any single index — is pinned by
crossIndexCollisionsStayLimitedToKnownNonHighlightablePaths: exactly three such
collisions exist (changeDescription, incrementalChangeDescription, users) and
none is a plausible highlight field.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01PTQrUmyp9P6DpwZq4Rd9jT

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.

…t does

backfillConfiguredSearchFields read as a data migration — in this codebase
`backfill*` is what the v11xx migration utils are called — but it neither
migrates nor persists anything. It runs on the outgoing copy of a settings read
and exists only because the UI renders one row per search field while reading
the highlight verdict from allowedFields, and the two lists do not coincide.

Renamed to listConfiguredSearchFieldsAsAllowed and reworded both javadocs to
state where it runs, that nothing is stored, and why the flag is derived rather
than persisted.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01PTQrUmyp9P6DpwZq4Rd9jT

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.

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

Pulled the branch down and ran it locally. The highlight toggles break as soon as you hit Save.

To reproduce on a stock install: Settings → Preferences → Search Settings → Table, expand any field (description will do), change something, click Save. Every Highlight toggle on the page goes grey with "This field cannot be highlighted". Reload and they're fine again. Restore Defaults does the same thing.

The backend meanwhile still says the field is both highlighted and highlightable:

table.highlightFields                        = [name, displayName, description]
allowedFields[table][description].highlight  = true

So the UI is showing the user the opposite of what the server actually thinks.

What's happening is that highlight only gets derived inside getSettingByName. Five endpoints can hand back searchSettings, and I checked each one:

highlight
GET /system/settings/searchSettings true
GET /system/settings false
PUT /system/settings false
PUT /system/settings/reset/searchSettings false
PATCH /system/settings/searchSettings false

The one that bites is the save. mergeSearchSettings throws away the annotated list and swaps in the seed's copy, which has no highlight key at all:

// SearchSettingsHandler.java:464
incomingSearchSettings.setAllowedFields(defaultSearchSettings.getAllowedFields());

and the UI takes that PUT response straight into app state (EntitySearchSettings.tsx:290, and :579 for Restore Defaults), so from then on every field reads as unhighlightable. Worth noting SearchSettingsPage.handleResetToDefault already avoids this by ignoring the response and re-fetching.

For the fix I'd lean on what the codebase already does for href, which has the same shape as highlight: derived by the server, response-only, and clients hand it back. EntityResource deals with that by stamping it at every response boundary, create/update/patch/delete included (:593, 624, 674, 688, 731, 751). Same trick here: generalise withHighlightFlags and call it from all five places.

private Settings forResponse(Settings settings) { /* today's withHighlightFlags body */ }

private Response forResponse(Response response) {
  return response.getEntity() instanceof Settings s
      ? Response.fromResponse(response).entity(forResponse(s)).build()
      : response;
}

getSettingByName and list wrap the settings, createOrUpdateSetting and patch wrap the response (after the write, so nothing derived gets persisted). resetSettingToDefault returns a bare SearchSettings, so annotate a JsonUtils.deepCopy there rather than the object itself.

Keep annotating copies, by the way. Mutating in place looks safe right now only because readDefaultSearchSettings() has an inverted cache guard (if (defaultSearchSettingsCache != null) is always true, so it re-reads the seed every call). If anyone ever fixes that guard, in-place annotation would start corrupting the shared default.

On tests: servedAllowedFieldsCarryTheHighlightFlag is the right test, just pointed at one endpoint. Running it over all five would have caught this, which is the wiring-level job its own javadoc describes. Same for the new Playwright test, worth having it save and then re-check the toggle.

Separate and non-blocking: "default": false in the schema generates private Boolean highlight = false;, so "nobody derived this" and "this field can't be highlighted" look identical on the wire, and the failure lands on the side that silently removes a working feature. Field is @JsonInclude(NON_NULL), so dropping the default would leave the key absent instead, and ?? true in FieldConfiguration.tsx:60 would make a future miss fall back to today's behaviour rather than disabling everything. The 400 on save is the real enforcement either way. Only catch is the client-built extension.* rows in fetchCustomProperties would then need an explicit highlight: false.

TeddyCr and others added 2 commits August 27, 2026 08:11
…e boundary

Five endpoints serve searchSettings; only the named GET derived
allowedFields[].highlight, so the other four served the schema default
false for every field.

The save is the one that bit. mergeSearchSettings swaps in the seed's
allowedFields, which carry no verdict, and the UI writes the PUT response
straight into app state -- so one Save greyed out every highlight toggle
on the page, telling the user the opposite of what the server had stored.
A reload fixed it, which is why the reload-based tests never saw it.

Generalise withHighlightFlags into forResponse and apply it at all five
boundaries, the way EntityResource stamps href on create/update/patch/
delete rather than on GET alone. The write paths are annotated after the
write, so nothing derived is persisted; the reset path returns a bare
SearchSettings, so it gets a deep copy. Every overload annotates a copy:
mergeSearchSettings hands the merged settings the default's own
allowedFields list, so in-place would write the derived flag onto
defaultSearchSettingsCache.

Point the IT at all five endpoints instead of one -- checking a single
endpoint is what let this through -- and assert the contradiction
directly: a response may not call a field highlighted and unhighlightable
at once. Make the Playwright test save and re-check without reloading.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01Ry156vsrMhA9D7KGZ9uNvQ

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.

@sonarqubecloud

Copy link
Copy Markdown

@gitar-bot

gitar-bot Bot commented Sep 1, 2026

Copy link
Copy Markdown
Code Review ⚠️ Changes requested 2 resolved / 4 findings

Flattens the testCaseResolutionStatusDetails index mapping to match its schema and adds save-time highlight field validation with derived UI toggles, but open findings remain regarding global settings validation locks and index-specific query-time guards.

⚠️ Edge Case: Save-time highlight validation can lock out settings edits

📄 openmetadata-service/src/main/java/org/openmetadata/service/resources/system/SearchSettingsHandler.java:175-189 📄 openmetadata-service/src/main/java/org/openmetadata/service/resources/system/SystemResource.java:622

validateHighlightFields runs over the entire incoming payload's highlightFields (SearchSettingsHandler.java:184-193) and throws on any unsupported entry. A cluster that stored an unsupported highlight field before this check (e.g. extension.foundry_rid, the exact scenario ExtensionHighlightSearchIT reproduces) will still carry that value: the v1130/v11210 migrations only scrub hardcoded *columns.children.* paths, not custom-property/flattened fields. Because the UI round-trips the existing highlightFields array (its disabled toggle does not remove the stale entry), every subsequent PUT of search settings — even for unrelated changes — is rejected with a 400 the admin cannot clear from the UI. Consider dropping unsupported highlight fields during merge, or validating only newly-added entries, so a legacy bad value does not block all future saves.

💡 Bug: Query-time guard now drops fields unsafe in any single index

📄 openmetadata-service/src/main/java/org/openmetadata/service/search/HighlightFieldClassifier.java:82-91 📄 openmetadata-service/src/main/java/org/openmetadata/service/search/HighlightFieldClassifier.java:125-138 📄 openmetadata-service/src/main/java/org/openmetadata/service/search/opensearch/OpenSearchSourceBuilderFactory.java:766-780

The replaced isFlattenedExtensionField only dropped extension/extension.*; HighlightFieldClassifier.isHighlightUnsafeField (HighlightFieldClassifier.java:88-91) uses the anyEntity union across all mappings. A field mapped enabled:false/flattened in even one index is now dropped from highlights in every index, including indexes where it is a normal analyzed field. Shipped defaults are covered by queryTimeGuardKeepsEveryShippedHighlightField, but an admin-configured highlight field that collides with an unsupported path in an unrelated index would be silently dropped everywhere. Confirm no such cross-index name collisions exist among realistically configurable highlight fields.

✅ 2 resolved
✅ Bug: Stored search settings served without highlight annotation

📄 openmetadata-service/src/main/java/org/openmetadata/service/resources/system/SystemResource.java:266-280 📄 openmetadata-service/src/main/java/org/openmetadata/service/resources/system/SystemResource.java:187 📄 openmetadata-service/src/main/java/org/openmetadata/service/resources/system/SearchSettingsHandler.java:151-165
The server-derived highlight flag is only set on the in-memory default cache in readDefaultSearchSettings() (SystemResource.java:187). But the UI reads Settings > Search via GET /v1/system/settings/searchSettings → getSettingByName (SystemResource.java:282), which returns systemRepository.getConfigWithKey(name) — the raw DB-stored settings — without calling annotateHighlightableFields. On any cluster whose SEARCH_SETTINGS were persisted before this change, the stored allowedFields have no highlight value, so they deserialize to false (schema default) for every field. Result: FieldConfiguration disables the highlight toggle for ALL fields (even valid ones like description/name) until an admin performs a save that re-merges from the annotated defaults. Annotate the SEARCH_SETTINGS response on the read path so the derived flag is always present.

✅ Quality: Extension test now matches on path suffix, not segment name

📄 openmetadata-service/src/test/java/org/openmetadata/service/search/IndexMappingNestedFieldConsistencyTest.java:284
The refactor of findExtensionTypeViolations replaced the exact segment check name.equals("extension") with path.endsWith("extension"). Unlike the sibling findViolations (which uses path.endsWith("." + fieldName) with the dot separator), this variant omits the leading dot, so a field whose name merely ends in extension (e.g. myextension) would be treated as an extension field and could produce a spurious CI failure. This is test-only and no such mapping exists today, but the divergence is a latent trap; align it with the dotted-suffix form used by findViolations.

🤖 Prompt for agents
Code Review: Flattens the testCaseResolutionStatusDetails index mapping to match its schema and adds save-time highlight field validation with derived UI toggles, but open findings remain regarding global settings validation locks and index-specific query-time guards.

1. 💡 Bug: Query-time guard now drops fields unsafe in any single index
   Files: openmetadata-service/src/main/java/org/openmetadata/service/search/HighlightFieldClassifier.java:82-91, openmetadata-service/src/main/java/org/openmetadata/service/search/HighlightFieldClassifier.java:125-138, openmetadata-service/src/main/java/org/openmetadata/service/search/opensearch/OpenSearchSourceBuilderFactory.java:766-780

   The replaced `isFlattenedExtensionField` only dropped `extension`/`extension.*`; `HighlightFieldClassifier.isHighlightUnsafeField` (HighlightFieldClassifier.java:88-91) uses the `anyEntity` union across all mappings. A field mapped `enabled:false`/`flattened` in even one index is now dropped from highlights in every index, including indexes where it is a normal analyzed field. Shipped defaults are covered by `queryTimeGuardKeepsEveryShippedHighlightField`, but an admin-configured highlight field that collides with an unsupported path in an unrelated index would be silently dropped everywhere. Confirm no such cross-index name collisions exist among realistically configurable highlight fields.

2. ⚠️ Edge Case: Save-time highlight validation can lock out settings edits
   Files: openmetadata-service/src/main/java/org/openmetadata/service/resources/system/SearchSettingsHandler.java:175-189, openmetadata-service/src/main/java/org/openmetadata/service/resources/system/SystemResource.java:622

   `validateHighlightFields` runs over the entire incoming payload's `highlightFields` (SearchSettingsHandler.java:184-193) and throws on any unsupported entry. A cluster that stored an unsupported highlight field before this check (e.g. `extension.foundry_rid`, the exact scenario ExtensionHighlightSearchIT reproduces) will still carry that value: the v1130/v11210 migrations only scrub hardcoded `*columns.children.*` paths, not custom-property/flattened fields. Because the UI round-trips the existing `highlightFields` array (its disabled toggle does not remove the stale entry), every subsequent PUT of search settings — even for unrelated changes — is rejected with a 400 the admin cannot clear from the UI. Consider dropping unsupported highlight fields during merge, or validating only newly-added entries, so a legacy bad value does not block all future saves.

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

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.

Pull request overview

Copilot reviewed 42 out of 45 changed files in this pull request and generated 3 comments.

Comment on lines +77 to +81
/** Classifies {@code field} against the index mapping of {@code entityType}. */
public static HighlightSupport classify(String entityType, String field) {
Map<String, HighlightSupport> unsupported = mappingIndex().byEntity().get(entityType);
return unsupported == null ? HighlightSupport.SUPPORTED : resolve(unsupported, field);
}
Comment on lines +173 to +184
<Tooltip
placement="top"
title={t('message.field-cannot-be-highlighted')}>
<TooltipTrigger>
<Switch
disabled
checked={false}
className="m-l-xlg"
data-testid="highlight-field-switch"
/>
</TooltipTrigger>
</Tooltip>
"fetch-domain-list-error": "هنگام واکشی دامنه‌ها خطایی رخ داد",
"fetch-pipeline-status-error": "خطا در دریافت وضعیت لوله داده.",
"field-ca-certs-description": "مسیر گواهی‌نامه باید به پیکربندی اضافه شود. مسیر باید به صورت محلی در کانتینر Ingestion باشد.",
"field-cannot-be-highlighted": "Este campo não pode ser destacado. Apenas campos de texto analisados suportam destaque.",

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.

Pull request overview

Copilot reviewed 42 out of 45 changed files in this pull request and generated 1 comment.

Suppressed comments (1)

openmetadata-ui/src/main/resources/ui/src/locale/languages/pr-pr.json:3706

  • The pr-pr.json locale file is Persian, but the new message.field-cannot-be-highlighted string is in Portuguese. This will show the wrong language in the UI for this locale.

Comment on lines +270 to +273
for (String field : listOrEmpty(assetConfig.getHighlightFields())) {
HighlightSupport support =
HighlightFieldClassifier.classify(assetConfig.getAssetType(), field);
if (support == HighlightSupport.SUPPORTED) {
@sonarqubecloud

sonarqubecloud Bot commented Sep 1, 2026

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

Ingestion safe to test Add this label to run secure Github workflows on PRs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Search follow-ups: testCaseResolutionStatusDetails mapping↔schema mismatch & save-time highlight-field validation

5 participants