Skip to content

[2.0] feat(search): add data_contract_search_index (#34304) - #35490

Closed
Khairajani wants to merge 1 commit into
2.0from
backport/2.0/pr-34304
Closed

Khairajani wants to merge 1 commit into
2.0from
backport/2.0/pr-34304

Conversation

@Khairajani

@Khairajani Khairajani commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

Backports #34304 to 2.0.

Cherry-pick of 5377edd9209, with conflicts resolved for what 2.0 lacks:

  • QueryBuilder canvas props not backported. components/common/QueryBuilder/ does not exist on 2.0, so the opt-in allowRemoveLastRule / plain-remove-button props have nothing to attach to.
  • DataContractResourceIT: only this PR's two search tests (patchOwners_reindexesContract, addResult_keepsOwnersInSearchDoc) plus supportsSearchIndex = true; main's unrelated ODCS/SLA tests are left out.
  • DataContractRepository: supportsSearch = true added without main's ContractSlaValidator constructor block.
  • AdvancedSearchClassBase: kept 2.0's @react-awesome-query-builder/antd import, toLower and EntityStatus; the lifecycle-stage mock from main is not carried into the test.

Verification (on the 2.0 base): DataContractIndexTest, DataContractIndexMappingTest, SearchIndexFactoryTest, EntityTypeNameTest: 327 tests, 0 failures. mvn spotless:apply produced no changes. Jest, ESLint and the IT compile were not run locally, so CI covers them.

No issue: #34304 merged without one, so this carries skip-pr-checks like the other 2.0 backports.

🤖 Generated with Claude Code

* feat(search): register data_contract_search_index mappings

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* feat(search): index data contracts via DataContractIndex

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* test(search): cover data contract indexing in DataContractResourceIT

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* feat(ingestion): map DataContract to data_contract_search_index

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* feat(ui): data contract search index and query builder fields

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* fix(search): keep contract owners on result updates; drop all alias

Recording a contract result PATCHed a copy fetched without owners and
reviewers, so the reindex blanked them in every contract doc. Reload the
relationship fields first.

Keep the index out of the all alias: team and user asset lists and the
domain, tag and data product pickers query all, where contracts would
show with no link and be accepted as assets they cannot hold.

Lowercase-normalize the entity and testSuite FQN keywords so the asset
autocomplete matches mixed-case FQNs.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* Fix UI checkstyle

* feat(ui): let a query builder caller allow removing its last condition

The canvas hides the delete control on the last remaining rule, so a
builder can never be emptied. Callers that handle an emptied builder
themselves (the Collate Automator resets to its 'Add Condition' state)
opt in with allowRemoveLastRule; every other builder keeps the default.

* fix(ui): offer data contract conditions only on fields contracts populate

A contract has no tags, tier, domains, data products, certification or
service, so conditions on those common fields matched no contract and
reported 0 assets. They are no longer offered while data contracts are
selected, alone or alongside other asset types, the same rule that
limits entity-specific fields to the ones every selected index shares.

* test(ui): removing the last allowed rule emits an empty tree, mounting never does

* feat(ui): let a builder preset draw the rule remove button as a plain button

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-authored-by: Himanshu Khairajani <46777429+Khairajani@users.noreply.github.com>
Co-authored-by: Khairajani <himanshukhairajani8@gmail.com>
(cherry picked from commit 5377edd)
@Khairajani
Khairajani requested review from a team as code owners October 15, 2026 04:24
@Khairajani Khairajani added UI UI specific issues safe to test Add this label to run secure Github workflows on PRs backend labels Oct 15, 2026
@Khairajani
Khairajani requested review from harshach and mohittilala and removed request for a team October 15, 2026 04:24
@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.

@Khairajani Khairajani added the skip-pr-checks Bypass PR metadata validation check label Oct 15, 2026
@gitar-bot

gitar-bot Bot commented Oct 15, 2026 •

Copy link
Copy Markdown
Code Review ✅ Approved

🟡 Medium risk · Adding a dedicated data-contract search index and result reindexing could produce stale or incomplete contract search results if indexing or updates misbehave.

Backports the data_contract_search_index feature from #34304 to 2.0, adding search indexing for data contracts with conflicts resolved for missing QueryBuilder canvas props and main-only ODCS/SLA code. No issues found.

Verification

Rules No rules evaluated

Functional validation Not enabled

Set up

Auto-approval Not enabled

Set up

For more verification details, comment gitar display:verbose.

Options

Display: compact → Showing compact verification results.

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

@Khairajani

Copy link
Copy Markdown
Contributor Author

This is for 2.1 and not 2.0.x hence closing

@Khairajani Khairajani closed this Oct 15, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Jest test Coverage

UI tests summary

Lines Statements Branches Functions
Coverage: 68%
68.17% (82665/121260) 53.08% (51198/96446) 53.79% (15213/28277)

@sonarqubecloud

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backend 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