Skip to content

test(upgrade): cover versioned and unversioned structured properties in ReindexDebug forced rebuilds - #20514

Open
rob-1019 wants to merge 2 commits into
masterfrom
fix/reindex-debug-structured-properties
Open

rob-1019 wants to merge 2 commits into
masterfrom
fix/reindex-debug-structured-properties

Conversation

@rob-1019

@rob-1019 rob-1019 commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

When ENABLE_STRUCTURED_PROPERTIES_SYSTEM_UPDATE=true, BuildIndices maps every active structured property explicitly, but ReindexDebug (-u ReindexDebug -a index=<index>) always passes an empty set of structured properties to its steps. With that setting on, the builder does not carry over the current structured property mappings, and because the structuredProperties container is dynamic: false, the forced rebuild creates an index with no mapping for any structured property, so every property's values, including ones that were indexed correctly before, are left unindexed and can no longer be searched or filtered, while the job reports SUCCEEDED. ReindexDebug should rebuild with the same target mappings as BuildIndices. This change loads the active structured property definitions the same way BuildIndices does when that setting is on, and passes them to the pre, reindex and post steps. With the setting off (the default) nothing changes, since the builder already carries over the current mappings there.

Testing

  • New ReindexDebugTest: with the setting on, a versioned and an unversioned property both reach the forced rebuild (fails without this change); with it off, no definitions are read.

  • Manual end-to-end on a local stack built from master at e77a36dd4833250f319c1a7058f9f2c762ff728a (Elasticsearch 8.19), comparing that commit's datahub-upgrade with one built from this PR's commit bfe2f35cd385115154ae04454928bffb311f8b3a, with the setting on and a dataset index holding values for a versioned and an unversioned string property. Ran -u ReindexDebug -a index=datasetindex_v2:

    • Before this change: the run reported SUCCEEDED, but the rebuilt index had no mapping for either property, and a term query on each returned 0 hits (1 before the run).
    • With this change: both properties were mapped in the rebuilt index, and each term query returned its 1 hit. A versioned property whose field had been dynamically mapped as text came back as keyword.
  • The PR conforms to DataHub's Contributing Guideline (particularly PR Title Format)

  • Links to related issues (if applicable)

  • Tests for the changes have been added/updated (if applicable)

  • Docs related to the changes have been added/updated (if applicable). If a new feature has been added a Usage Guide has been added for the same.

  • For any breaking change/potential downtime/deprecation/big changes an entry has been made in Updating DataHub

🤖 Generated with Claude Code


Summary by cubic

Fixes ReindexDebug forced rebuilds dropping all structured property mappings when ENABLE_STRUCTURED_PROPERTIES_SYSTEM_UPDATE=true. The rebuilt index had no mapping for any structured property, leaving their values unindexed and unsearchable while the job reported SUCCEEDED. The upgrade now loads active structured property definitions the same way BuildIndices does and passes them to the pre, reindex, and post steps. With the setting off (the default), behavior is unchanged.

Adds ReindexDebugTest verifying that a versioned and an unversioned property both reach the forced rebuild when the setting is on, and that no definitions are read when it's off.

Written for commit cd430d3. Summary will update on new commits.

View guided diff Turn on auto-fix

@codecov

codecov Bot commented Oct 19, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ All tests successful. No failed tests found.

📢 Thoughts on this report? Let us know!

@rob-1019
rob-1019 marked this pull request as ready for review October 19, 2026 19:01
@cursor

cursor Bot commented Oct 19, 2026 •

Copy link
Copy Markdown

PR Summary

Overview
Adds regression coverage in ReindexDebugTest so forced ReindexDebug rebuilds cannot drop structured property mappings unnoticed when structured properties system update is enabled.

A new test drives ReindexDebugStep end-to-end with mocks and asserts ElasticSearchService.buildReindexConfigs receives both a versioned and an unversioned active structured property definition (including correct version presence/absence). A definitionAspect helper builds mock definition aspects for those cases.

The existing construction test still verifies AspectDao is not consulted when the upgrade bean is built—definitions should only load when a reindex run actually executes.

Reviewed by Cursor Bugbot for commit cd430d3. Bugbot is set up for automated code reviews on this repo. Configure here.

…in ReindexDebug forced rebuilds

Run the ReindexDebug step with structured properties enabled and assert
that both a versioned and an unversioned definition reach
buildReindexConfigs. The test fails if ReindexDebug passes no definitions.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@rob-1019
rob-1019 force-pushed the fix/reindex-debug-structured-properties branch from bfe2f35 to ea45925 Compare November 9, 2026 21:08
@rob-1019 rob-1019 changed the title fix(upgrade): load structured properties in ReindexDebug forced rebuilds test(upgrade): cover versioned and unversioned structured properties in ReindexDebug forced rebuilds Nov 9, 2026
@rob-1019
rob-1019 enabled auto-merge (squash) December 4, 2026 17:09
@github-actions

github-actions Bot commented Dec 4, 2026

Copy link
Copy Markdown
Contributor

Smart test selection

pytest smoke tests

Mode: active. Only the selection below runs for the pytest smoke tests on this PR (applied: smart).

  • Selection: smart: tests for the tagged features, plus always-run modules, this PR's changed tests, and the plumbing sample if the PR changes the pytest harness
  • Size: 101 of 861 tests in 1 batch, predicted longest batch ~2 min
  • Tags: change-type: test-infra; feature-dev: bootstrap, search-indexing; feature-user: structured-properties; technical-layer: elasticsearch
  • Confidence: HIGH (1 changed files)
  • Classifier reasoning: Changes a single upgrade test (ReindexDebugTest) that exercises forced reindex with structured property definitions, so it maps to structured-properties, search-indexing, bootstrap, and elasticsearch.
Selected scopes (16 files or classes, 101 tests)
  • tests/e2e/authorization/test_self_entity_auth.py
  • tests/e2e/browse/browse_test.py
  • tests/e2e/datapack/test_datapack_smoke.py::TestDatapackCLI
  • tests/e2e/datapack/test_datapack_smoke.py::TestDemoDataBootstrap
  • tests/e2e/datapack/test_datapack_smoke.py::TestShowcaseData
  • tests/e2e/delete/delete_assertion_cascade_test.py
  • tests/e2e/frontend/test_static_asset_encodings.py
  • tests/e2e/managed_ingestion/ingestion_source_run_events_test.py
  • tests/e2e/mcp/mcp_test.py
  • tests/e2e/query_projection/test_query_projection_smoke.py
  • tests/e2e/read_only/test_services_up.py
  • tests/e2e/search/test_lineage_search_index_fields.py
  • tests/e2e/search/test_search_projection.py::TestSearchProjection
  • tests/e2e/structured_properties/test_structured_properties.py
  • tests/e2e/structured_properties/test_validator_error_messages.py
  • tests/e2e/test_e2e.py

Add the run-all-tests:pytest label to run the full pytest suite on this PR.

Playwright E2E tests

This run: smart

  • Selection: smart: specs tagged bootstrap, search-indexing, structured-properties plus the tests the change affects
  • Size: 14 tests in 6 spec files, ~6 min predicted on 1 shard(s)
Specs selected because of this PR (6)
Spec Tests Why
schema-scale/schema-scale.spec.ts 2/2 tagged structured-properties
structured-properties/entity-level.spec.ts 4/4 tagged structured-properties
structured-properties/schema-field.spec.ts 3/3 tagged structured-properties
structured-properties/structured-properties.spec.ts 3/3 tagged structured-properties
structured-property-scale/allowed-values-scale.spec.ts 1/1 tagged structured-properties
structured-property-scale/urn-values-scale.spec.ts 1/1 tagged structured-properties

Add the run-all-tests:playwright label to run the full Playwright suite on this PR.

commit cd430d3 · workflow run

This branch was successfully deployed

1 active deployment
Preview — cd430d33 Deployed Dec 4, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant