Repository navigation
feat(ui): completeness on di - #33106
Conversation
* fix(security): restrict cross-user follower changes * fix(security): validate follower user IDs * fix(cache): bypass read-bundle cache for uncached entities buildReadBundle used the read-bundle cache for every non-deleted read, ignoring UNCACHED_ENTITY_TYPES (user, task, workflow*, bot, domain, dataProduct). For those types a mutation followed by an immediate re-read — e.g. the follower add/delete then fetch in this PR's DataProductResourceIT — could serve a stale cached bundle. Without this, the follower authorization tests fail under a cache-enabled deployment (postgres-elasticsearch-redis / postgres-opensearch integration lanes) with `expected <false> but was <true>` after a delete. Gate the read-bundle cache on isCacheableEntityType(entityType) so uncached types take the already-supported bundleCache == null path and always reflect the current entity_relationship state. Required for the follower tests to pass on the Redis/OpenSearch lanes (documents why this caching change is part of the security fix, per reviewer request). * test(followers): rename put_-prefixed delete-follower tests to delete_ prefix The two round-trip tests exercise the DELETE follower endpoint (add is setup), so name them with the delete_ verb prefix to match the method-name convention (addresses the Copilot review comment). --------- Co-authored-by: sonika-shah <[email protected]> (cherry picked from commit 2fb1cb5)
* feat(api): add samples to AI context
Limit structured table context to 10 permission-filtered rows so SQL agents can inspect value shape without a warehouse discovery query.
* fix(api): resolve sample-data authz with owners loaded
The AI context sample-data check wrapped an already-loaded table in a
pre-resolved ResourceContext. That constructor never runs resolveEntity(),
so owners and domains stayed absent (TABLE_FIELDS does not request them)
and every owner- or domain-conditioned rule misfired in both directions:
an owner-conditioned Deny failed open, and authorizePII() saw null owners
so a table's own owner had their sample data masked.
Resolve by id instead, which loads authorizationFields(), matching what
TableResource's GET /tables/{id}/sampleData already does.
The existing IT used an unconditioned Deny, which passes whether or not
owners are loaded. Add an owner-conditioned Deny case that first asserts
the real endpoint returns 403, then asserts the AI context endpoint
agrees. Verified: it returns 10 sample rows before the fix, none after.
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
---------
Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
(cherry picked from commit 8298911)
❌ PR checklist incompleteThis PR cannot be merged until the following are addressed on its linked issue:
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 |
| } catch (IOException ex) { | ||
| LOG.error("Couldn't install DataInsightsApp: Can't initialize ElasticSearch Index.", ex); | ||
| throw new UncheckedIOException("Could not prepare Data Insights snapshot indexes", ex); | ||
| } |
There was a problem hiding this comment.
💡 Quality: init() now aborts on transient search-cluster errors
createOrUpdateDataAssetsDataStream() is called from init(App) and its catch block now rethrows as UncheckedIOException instead of logging and continuing, so jobData (set at line 221) is never initialized. A transient search-cluster outage during app load — or one entity type's mapping update failing mid-loop — now aborts DataInsights app initialization entirely rather than degrading gracefully. If fail-fast is intended, this is fine; otherwise consider keeping create failures fatal while tolerating/retrying update failures so a temporary ES/OS hiccup doesn't block app startup.
Was this helpful? React with 👍 / 👎
|
| Count | Rule |
|---|---|
| 1 | openmetadata-imports/no-circular-imports |
All findings
| Location | Rule | Message | |
|---|---|---|---|
| 🟡 | src/utils/AdvancedSearchClassBase.ts:48:1 |
openmetadata-imports/no-circular-imports |
This runtime import participates in a circular dependency. Extract the shared type/constant/utility or invert the dependency. |
Fix locally (fast - only checks files changed in this branch):
make ui-checkstyle-changed
Code Review 👍 Approved with suggestions 1 resolved / 2 findingsAdds Data Insights extensibility, recursive column coverage metrics, and data stream management for Elasticsearch and OpenSearch. Workflow lifecycle support and error tracking are well-structured. Consider whether 💡 Quality: init() now aborts on transient search-cluster errors📄 openmetadata-service/src/main/java/org/openmetadata/service/apps/bundles/insights/DataInsightsApp.java:169-171 📄 openmetadata-service/src/main/java/org/openmetadata/service/apps/bundles/insights/DataInsightsApp.java:219
✅ 1 resolved✅ Edge Case: Export completeness guard aborts all exports on any shard failure
🤖 Prompt for agentsOptionsDisplay: compact → Counting what did not apply, without listing it. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source |
|



This pull request introduces enhancements and refactoring to the Data Insights workflow, focusing on improved error handling, extensibility, and support for updating data asset data streams in both Elasticsearch and OpenSearch. The changes also add new extension points for custom logic during data asset snapshot processing and improve the robustness of workflow statistics and error reporting.
Key changes include:
Data Insights Workflow Improvements
DataAssetsWorkflow, enabling custom logic to run before processing each batch and after entity enrichment. The workflow now uses aDataInsightsExtension.RunContextand manages extension lifecycle, including completion and cleanup. ([[1]](https://github.com/open-metadata/OpenMetadata/pull/33106/files#diff-c94d8304d49885015591e75c9b376310eb02dae8639fa2cc38530050b453c7b6R67),[[2]](https://github.com/open-metadata/OpenMetadata/pull/33106/files#diff-c94d8304d49885015591e75c9b376310eb02dae8639fa2cc38530050b453c7b6R79),[[3]](https://github.com/open-metadata/OpenMetadata/pull/33106/files#diff-c94d8304d49885015591e75c9b376310eb02dae8639fa2cc38530050b453c7b6R122),[[4]](https://github.com/open-metadata/OpenMetadata/pull/33106/files#diff-c94d8304d49885015591e75c9b376310eb02dae8639fa2cc38530050b453c7b6R231-R251),[[5]](https://github.com/open-metadata/OpenMetadata/pull/33106/files#diff-c94d8304d49885015591e75c9b376310eb02dae8639fa2cc38530050b453c7b6R305-R313),[[6]](https://github.com/open-metadata/OpenMetadata/pull/33106/files#diff-c94d8304d49885015591e75c9b376310eb02dae8639fa2cc38530050b453c7b6R326))workflowStatsfor better observability. ([[1]](https://github.com/open-metadata/OpenMetadata/pull/33106/files#diff-c94d8304d49885015591e75c9b376310eb02dae8639fa2cc38530050b453c7b6R358-R361),[[2]](https://github.com/open-metadata/OpenMetadata/pull/33106/files#diff-c94d8304d49885015591e75c9b376310eb02dae8639fa2cc38530050b453c7b6R375-R376),[[3]](https://github.com/open-metadata/OpenMetadata/pull/33106/files#diff-c94d8304d49885015591e75c9b376310eb02dae8639fa2cc38530050b453c7b6R417-R421))Data Asset Data Stream Management
updateDataAssetsDataStreammethod in theDataInsightsSearchInterfaceand implemented it for both Elasticsearch and OpenSearch clients. This allows updating existing backing indexes and templates when the data stream rolls over. ([[1]](https://github.com/open-metadata/OpenMetadata/pull/33106/files#diff-76847b0dfc2bb0c1b118a9ac8237d094147ad72340e30a2563e16b49ed61b4bcR118-R122),[[2]](https://github.com/open-metadata/OpenMetadata/pull/33106/files#diff-80fd3f615367f1d59e457bd28e56bc4c414ac039124d0740114cdee8983fe925L69-R83),[[3]](https://github.com/open-metadata/OpenMetadata/pull/33106/files#diff-ba8e4619d2eb455c68a3af2f43e5b2e89a82c080212b8b71d0cab2ae4e7c74b5L74-R91))prepareDataAssetTemplatesdefault method, consolidating logic for building mappings and templates. ([[1]](https://github.com/open-metadata/OpenMetadata/pull/33106/files#diff-76847b0dfc2bb0c1b118a9ac8237d094147ad72340e30a2563e16b49ed61b4bcR21-R36),[[2]](https://github.com/open-metadata/OpenMetadata/pull/33106/files#diff-80fd3f615367f1d59e457bd28e56bc4c414ac039124d0740114cdee8983fe925L69-R83),[[3]](https://github.com/open-metadata/OpenMetadata/pull/33106/files#diff-ba8e4619d2eb455c68a3af2f43e5b2e89a82c080212b8b71d0cab2ae4e7c74b5L74-R91))Elasticsearch & OpenSearch Client Enhancements
performRequestmethod to return status codes and throw exceptions on non-successful responses, aligning error handling with Elasticsearch. ([[1]](https://github.com/open-metadata/OpenMetadata/pull/33106/files#diff-ba8e4619d2eb455c68a3af2f43e5b2e89a82c080212b8b71d0cab2ae4e7c74b5L32-R46),[[2]](https://github.com/open-metadata/OpenMetadata/pull/33106/files#diff-ba8e4619d2eb455c68a3af2f43e5b2e89a82c080212b8b71d0cab2ae4e7c74b5L62-R66))[openmetadata-service/src/main/java/org/openmetadata/service/apps/bundles/insights/search/opensearch/OpenSearchDataInsightsClient.javaL62-R66](https://github.com/open-metadata/OpenMetadata/pull/33106/files#diff-ba8e4619d2eb455c68a3af2f43e5b2e89a82c080212b8b71d0cab2ae4e7c74b5L62-R66))Index Template and Mapping Improvements
forDataStreaminIndexTemplateto ensure each entity type maintains its own rollover mapping, preventing accidental overwrites. ([openmetadata-service/src/main/java/org/openmetadata/service/apps/bundles/insights/search/IndexTemplate.javaR10-R18](https://github.com/open-metadata/OpenMetadata/pull/33106/files#diff-d6964b8df7736b45445787753507a9b0629656171923a9e27299ffcfd3e28f1eR10-R18))EntityIndexMap.Mappingsclass to supportdynamic_templatesvia Jackson annotations, improving mapping flexibility. ([[1]](https://github.com/open-metadata/OpenMetadata/pull/33106/files#diff-c530f5ca3eba41551e8e01e8ac5ad73e13cd1d2a82cb5a54619111ddb42daa1eR3-R4),[[2]](https://github.com/open-metadata/OpenMetadata/pull/33106/files#diff-c530f5ca3eba41551e8e01e8ac5ad73e13cd1d2a82cb5a54619111ddb42daa1eR19-R21))Error Handling and Dependency Updates
DataInsightsAppto throwUncheckedIOExceptionon failures to prepare indexes, making failures more explicit. ([[1]](https://github.com/open-metadata/OpenMetadata/pull/33106/files#diff-f05f9c803443683c7ee7a63d2c42995653b5ce592bec875e24d11058cd82a308R11),[[2]](https://github.com/open-metadata/OpenMetadata/pull/33106/files#diff-f05f9c803443683c7ee7a63d2c42995653b5ce592bec875e24d11058cd82a308R164-R170))These changes collectively improve the reliability, extensibility, and maintainability of the Data Insights workflow and its integration with search backends.