-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add support for 5.15 key format and rename relationship keys #8
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we also add a test for 5.15 where we have two keys defined for the same label and assert we receive two lists?
private static List<Map<String, Object>> getKeys(Map<String, Object> cypherMap) { | ||
var keysList = ModelUtils.getList(cypherMap, "keys", Map.class); | ||
if (keysList != null) { | ||
return ModelUtils.coerceToListOfMaps(keysList, String.class, Object.class); | ||
} | ||
|
||
// Check if the key structure is pre Neo4j 5.15 | ||
var keyMap = ModelUtils.getMap(cypherMap, "key", String.class, Object.class); | ||
if (keyMap == null) { | ||
return null; | ||
} | ||
return List.of(keyMap); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just a nit but should this also move into ModelUtils
?
|
||
/** | ||
* Neo4j 5.15+ introduced a breaking change in node ande relationship keys structure. This suite verifies if | ||
* CLC Client is backward compatible with 5.14 and earlier. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* CLC Client is backward compatible with 5.14 and earlier. | |
* CDC Client is backward compatible with 5.14 and earlier. |
"Person", | ||
List.of(Map.of("id", 1L), Map.of("name", "John")), | ||
"Employee", | ||
List.of(Map.of("id", 5L, "role", "manager"))), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just looking into these now, having both id
: 1L
and id
: 5L
for the same property on the same node doesn't make sense at all. Do you mind updating these to match?
* TODO At the moment of writing Neo4j 5.15 hasn't publicly releases yet. This means that these tests are identical to | ||
* {@link CDCClient514IT Integration tests for Neo4j 5.14}. When 5.15 is released, we need to enabled these tests. | ||
*/ | ||
@Disabled |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe just add a card for this in Next
column on the board so that we don't forget?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Chicken-egg dilemma. Was going to do this after the approval. Here is the card https://trello.com/c/Qor9KTa7/387-enable-integration-test-for-neo4j-515-in-cdc-client-lib
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good.
keys
from result depending on value type in key map.keys
andkey
and pick the data structure from there.