Skip to content

MINOR: regression in export field setter#27447

Open
TeddyCr wants to merge 1 commit intomainfrom
MINOR-Exporter-fixes
Open

MINOR: regression in export field setter#27447
TeddyCr wants to merge 1 commit intomainfrom
MINOR-Exporter-fixes

Conversation

@TeddyCr
Copy link
Copy Markdown
Collaborator

@TeddyCr TeddyCr commented Apr 17, 2026

Describe your changes:

Fix regression introduced in entity history where fields are not set anymore

Type of change:

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

Checklist:

  • I have read the CONTRIBUTING document.
  • My PR title is Fixes <issue-number>: <short explanation>
  • 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.

@TeddyCr TeddyCr added the To release Will cherry-pick this PR into the release branch label Apr 17, 2026
Copilot AI review requested due to automatic review settings April 17, 2026 01:39
@github-actions github-actions bot added Ingestion safe to test Add this label to run secure Github workflows on PRs labels Apr 17, 2026
@gitar-bot
Copy link
Copy Markdown

gitar-bot bot commented Apr 17, 2026

Code Review ✅ Approved

Fixes the field setter regression by restoring correct state handling for export operations. No issues found.

Options

Display: compact → Showing less information.

Comment with these commands to change:

Compact
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Gitar

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes a regression in the entity history-by-timestamp flow where returned historical entities were missing expected fields (e.g., service) by re-applying field population logic after deserializing history snapshots.

Changes:

  • Update listEntityHistoryByTimestamp(...) to call setFieldsInBulk(...) on deserialized history entities.
  • Add an integration test to ensure the /history response for Databases includes a non-null service field across returned versions.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
openmetadata-service/src/main/java/org/openmetadata/service/jdbi3/EntityRepository.java Re-hydrates fields for entities returned by the history-by-timestamp query.
openmetadata-integration-tests/src/test/java/org/openmetadata/it/tests/DatabaseResourceIT.java Adds coverage to assert /databases/.../history returns versions that include service.


List<T> entities = JsonUtils.readObjects(jsons, getEntityClass());
hydrateHistoryEntities(entities);
setFieldsInBulk(putFields, entities);
Copy link

Copilot AI Apr 17, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Calling setFieldsInBulk(putFields, entities) here will re-hydrate relationship-backed fields from the current DB state (owners/tags/domains/etc.) and can overwrite the historical snapshot data returned by the /history-by-timestamp query. It also increases the cost of the endpoint significantly compared to returning the stored snapshots.

Consider switching to a minimal history hydration strategy (e.g., only populate required default references like service when missing, without fetching other relationship fields), or restoring the previous lightweight hook-based approach so that /history continues to reflect the stored version snapshots.

Suggested change
setFieldsInBulk(putFields, entities);

Copilot uses AI. Check for mistakes.

List<T> entities = JsonUtils.readObjects(jsons, getEntityClass());
hydrateHistoryEntities(entities);
setFieldsInBulk(putFields, entities);
Copy link

Copilot AI Apr 17, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change removes the only call site of hydrateHistoryEntities(...), leaving the method (and its Javadoc describing intentionally lightweight history hydration) effectively dead/inaccurate. Either call the hook again (possibly after deserialization and before pagination cursor computation) or remove/update the hook and documentation to match the new behavior.

Suggested change
setFieldsInBulk(putFields, entities);
setFieldsInBulk(putFields, entities);
hydrateHistoryEntities(entities);

Copilot uses AI. Check for mistakes.
@sonarqubecloud
Copy link
Copy Markdown

@github-actions
Copy link
Copy Markdown
Contributor

🔴 Playwright Results — 1 failure(s), 18 flaky

✅ 3662 passed · ❌ 1 failed · 🟡 18 flaky · ⏭️ 89 skipped

Shard Passed Failed Flaky Skipped
🟡 Shard 1 477 0 3 4
🟡 Shard 2 648 0 3 7
🔴 Shard 3 651 1 4 1
🟡 Shard 4 631 0 3 27
✅ Shard 5 611 0 0 42
🟡 Shard 6 644 0 5 8

Genuine Failures (failed on all attempts)

Features/RestoreEntityInheritedFields.spec.ts › Validate restore with Inherited domain and data products assigned (shard 3)
Error: �[2mexpect(�[22m�[31mreceived�[39m�[2m).�[22mtoBe�[2m(�[22m�[32mexpected�[39m�[2m) // Object.is equality�[22m

Expected: �[32m200�[39m
Received: �[31m400�[39m
🟡 18 flaky test(s) (passed on retry)
  • Features/DataAssetRulesDisabled.spec.ts › Verify the Database entity item action after rules disabled (shard 1, 2 retries)
  • Features/CustomizeDetailPage.spec.ts › Database - customization should work (shard 1, 1 retry)
  • Pages/UserCreationWithPersona.spec.ts › Create user with persona and verify on profile (shard 1, 1 retry)
  • Features/BulkEditEntity.spec.ts › Glossary (shard 2, 1 retry)
  • Features/ChangeSummaryBadge.spec.ts › Automated badge should appear on entity description with Automated source (shard 2, 1 retry)
  • Features/DataQuality/TestLibrary.spec.ts › should disable toggle for external test definitions (shard 2, 1 retry)
  • Features/RestoreEntityInheritedFields.spec.ts › Validate restore with Inherited domain and data products assigned (shard 3, 2 retries)
  • Features/RestoreEntityInheritedFields.spec.ts › Validate restore with Inherited domain and data products assigned (shard 3, 1 retry)
  • Features/RTL.spec.ts › Verify Following widget functionality (shard 3, 1 retry)
  • Features/Table.spec.ts › Tags term should be consistent for search (shard 3, 1 retry)
  • Pages/Customproperties-part2.spec.ts › entityReferenceList shows item count, scrollable list, no expand toggle (shard 4, 1 retry)
  • Pages/Domains.spec.ts › Subdomain rename does not affect parent domain and updates nested children (shard 4, 1 retry)
  • Pages/Entity.spec.ts › Inactive Announcement create & delete (shard 4, 1 retry)
  • Pages/Lineage/LineageFilters.spec.ts › Verify lineage schema filter selection (shard 6, 1 retry)
  • Pages/Lineage/LineageRightPanel.spec.ts › Verify custom properties tab IS visible for supported type: searchIndex (shard 6, 1 retry)
  • Pages/ODCSImportExport.spec.ts › Multi-object ODCS contract - object selector shows all schema objects (shard 6, 1 retry)
  • Pages/Users.spec.ts › Permissions for table details page for Data Consumer (shard 6, 1 retry)
  • VersionPages/EntityVersionPages.spec.ts › Directory (shard 6, 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

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 To release Will cherry-pick this PR into the release branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants