Tolerate unresolvable stream references during content pack install#26581
Open
patrickmann wants to merge 5 commits into
Open
Tolerate unresolvable stream references during content pack install#26581patrickmann wants to merge 5 commits into
patrickmann wants to merge 5 commits into
Conversation
Installing a content pack could fail with "Missing Stream for widget entity" when a view referenced a stream that could not be resolved to a native stream. The view-side resolvers threw a ContentPackException, which aborted and rolled back the entire content pack installation. This was asymmetric with the export side (WidgetDTO.toContentPackEntity), which already silently drops stream references it cannot map. Make the three import-time view resolvers behave the same way: skip an unresolvable stream reference with a warning instead of throwing, so a single dangling reference no longer blocks the whole install. The wrong-type branch (a non-null, non-Stream value) still throws, since that indicates a genuinely corrupt entity map rather than a missing reference. Affected resolvers: - WidgetEntity.toNativeEntity - SearchTypeEntity.mappedStreams - QueryEntity.shallowMappedFilter Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes Graylog2/graylog-plugin-enterprise#12987
Description
Installing a content pack could fail with
ContentPackException: Missing Stream for widget entitywhen a view (dashboard/search) referenced a stream that could not be resolved to a native stream. The view-side resolvers threw, which aborted and rolled back the entire content pack installation.This was also asymmetric with the export side (
WidgetDTO.toContentPackEntity), which already silently drops stream references it cannot map. This change makes the three import-time view resolvers behave the same way: skip an unresolvable stream reference with a logged warning instead of throwing, so a single dangling reference no longer blocks the whole install.The wrong-type branch (a non-null, non-
Streamvalue) still throws, since that indicates a genuinely corrupt entity map rather than a missing reference.Note: if dropping the invalid stream results in an empty stream set, we will then query all indices. So it may change the semantics of the query.
Export issue is tracked in #26584
Affected resolvers:
WidgetEntity.toNativeEntitySearchTypeEntity.mappedStreamsQueryEntity.shallowMappedFilterHow Tested
WidgetEntityTestandSearchTypeEntityTest, plus a new case inQueryEntityTest, covering both the drop-on-missing and keep-on-resolvable paths.Types of changes
Checklist: