Repository navigation
[#9530] Fix serialized metadata loading when optional plugins are unavailable - #9525
Open
rmannibucau wants to merge 1 commit into
Open
rmannibucau wants to merge 1 commit into
rmannibucau wants to merge 1 commit into
Conversation
Contributor
|
Please create a linked ticket too |
Contributor
|
ticket? |
Contributor
Author
|
Created #9530 (copied the description) |
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.
Issue
Saved execution metadata is a JSON object keyed by metadata type.
SerializableMetadataProvider.toJson()writes an array for every registered type, even when no objects of that type exist. An execution snapshot can therefore contain entries such as"salesforceconnection": []or"neo4j-connection": []without the executed pipeline using either connection type.When the snapshot is read in an installation where one of those optional metadata plugins is unavailable, the reader resolves the plugin before inspecting the array. This produces
The metadata plugin for key ... could not be found in the plugin registryerrors even for empty entries. In Hop GUI this can happen during project activation, whenExecutionPerspective.restoreOpenTabs()reopens historical executions and reconstructs their saved metadata. It does not necessarily indicate a problem with the current project's connections.There is a second issue when an unavailable type does contain objects: the skip loop stops at the first
END_ARRAYtoken, rather than the end of the metadata type's array. A real Neo4j connection containsmanualUrls: []; the graph database connection also contains this array nested undergraphDatabase.NEO4J. Either shape can leave the reader positioned inside a skipped connection and interfere with loading subsequent metadata types.Implementation
skipChildren()on each element. This skips complete objects, including nested arrays, and resumes at the next metadata type.Regression coverage uses the existing Neo4j integration fixture and graph database connection sample shapes, including their empty
manualUrlsarrays, and verifies that a following server entry is still loaded when the connection plugin is unavailable. Empty Salesforce and Neo4j entries are also covered without adding dependencies on those plugins.Note/Context
Encountered it while checking an issue on an environment (final cause was a mixed distro version with hop plugin folder on an older version) so not 100% sure it can happen in real life but thought it was worth fixing and it was fasteasy enough to do it quickly.