Skip to content
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

Fixes #558: Check for neo4j version being compatible with neo version #2700

Merged
merged 4 commits into from
May 6, 2022

Conversation

vga91
Copy link
Collaborator

@vga91 vga91 commented Apr 5, 2022

Fixes #558

Added a check between neo4j and apoc version. If versions are different, a log warn will be returned.

reg

@conker84
Copy link
Collaborator

conker84 commented Apr 7, 2022

@vga91 please add a statement in the docs where you describe the behaviour of the log

@@ -5,6 +5,7 @@
import org.neo4j.kernel.extension.ExtensionFactory;
import org.neo4j.kernel.extension.ExtensionType;
import org.neo4j.kernel.extension.context.ExtensionContext;
import org.neo4j.kernel.internal.Version;
Copy link
Contributor

Choose a reason for hiding this comment

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

this is internal class for a reason and should not be used here and there for any convience

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Oh I see. Therefore, please could you tell me what to use as an alternative to Version.getKernelVersion()?

Copy link
Contributor

Choose a reason for hiding this comment

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

so there is a dbms.components procedure that will return neo4j version; also here you are expecting that version will also have dot separator and that will be major.minor - there is no guarantee that its the case

Copy link
Contributor

Choose a reason for hiding this comment

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

so there is a dbms.components procedure that will return neo4j version; also here you are expecting that version will also have dot separator and that will be major.minor - there is no guarantee that its the case

@conker84 conker84 added 4.4 core-functionality Adding new procedure, function or signature to APOC core labels Apr 11, 2022
@Lojjs Lojjs self-assigned this Apr 19, 2022
Comment on lines 101 to 107
private String getMajorMinVersion(String completeVersion) {
if (completeVersion == null) {
return null;
}
final String[] split = completeVersion.split("\\.");
return split[0] + "." + split[1];
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Talked to @MishaDemianenko and there is no guarantee this is always on the major.minor format. Can we make it a bit more flexible and also add some sort of testing for this?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I changed the handling. Now we check if <KERNEL_VERSION> starts with <APOC_VERSION>,
because expect that APOC versioning is always consistent to Neo4j versioning,
e.g. if we have Neo4j 5_0_0, the Apoc version will be 5_x_x_x as well.

And I added some tests too.

@vga91 vga91 force-pushed the issue_558 branch 4 times, most recently from a91ab9c to 774d6bb Compare April 28, 2022 07:47
Copy link
Contributor

@Lojjs Lojjs left a comment

Choose a reason for hiding this comment

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

There also seems to be some test failures in the build, not sure if they are related to the changes or not

}
final String[] split = completeVersion.split("\\.");
return split[0] + "." + split[1];
// only for testing purpose
Copy link
Contributor

Choose a reason for hiding this comment

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

Do you refer to that it is public for testing purposes and could be private otherwise? In that case, maybe the comment can explicitly say so.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes exactly. Added it and fixed the failed test as well

Copy link
Contributor

@Lojjs Lojjs left a comment

Choose a reason for hiding this comment

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

Looks good to me now, but would like @MishaDemianenko to have another look as well to see if he thinks his concerns are fixed

@conker84 conker84 merged commit 4292b67 into neo4j-contrib:4.4 May 6, 2022
@conker84
Copy link
Collaborator

conker84 commented May 6, 2022

Thank you @vga91 and thank you @Lojjs and @MishaDemianenko for the review!

neo4j-oss-build pushed a commit that referenced this pull request May 6, 2022
…#2700)

* Fixes #558: Check for neo4j version being compatible with neo version

* doc addition - changed neo4j version getting

* added test - changed version handling

* edit comment
neo4j-oss-build pushed a commit that referenced this pull request May 6, 2022
…#2700)

* Fixes #558: Check for neo4j version being compatible with neo version

* doc addition - changed neo4j version getting

* added test - changed version handling

* edit comment
vga91 added a commit to vga91/neo4j-apoc-procedures that referenced this pull request May 20, 2022
…h neo version (neo4j-contrib#2700)

* Fixes neo4j-contrib#558: Check for neo4j version being compatible with neo version

* doc addition - changed neo4j version getting

* added test - changed version handling

* edit comment
vga91 added a commit to vga91/neo4j-apoc-procedures that referenced this pull request May 24, 2022
…h neo version (neo4j-contrib#2700)

* Fixes neo4j-contrib#558: Check for neo4j version being compatible with neo version

* doc addition - changed neo4j version getting

* added test - changed version handling

* edit comment
vga91 added a commit to vga91/neo4j-apoc-procedures that referenced this pull request May 25, 2022
…h neo version (neo4j-contrib#2700)

* Fixes neo4j-contrib#558: Check for neo4j version being compatible with neo version

* doc addition - changed neo4j version getting

* added test - changed version handling

* edit comment
vga91 added a commit to vga91/neo4j-apoc-procedures that referenced this pull request May 25, 2022
…h neo version (neo4j-contrib#2700)

* Fixes neo4j-contrib#558: Check for neo4j version being compatible with neo version

* doc addition - changed neo4j version getting

* added test - changed version handling

* edit comment
vga91 added a commit that referenced this pull request May 27, 2022
…#2700)

* Fixes #558: Check for neo4j version being compatible with neo version

* doc addition - changed neo4j version getting

* added test - changed version handling

* edit comment
vga91 added a commit to vga91/neo4j-apoc-procedures that referenced this pull request May 27, 2022
…h neo version (neo4j-contrib#2700)

* Fixes neo4j-contrib#558: Check for neo4j version being compatible with neo version

* doc addition - changed neo4j version getting

* added test - changed version handling

* edit comment
vga91 added a commit that referenced this pull request May 27, 2022
…#2700)

* Fixes #558: Check for neo4j version being compatible with neo version

* doc addition - changed neo4j version getting

* added test - changed version handling

* edit comment
vga91 added a commit that referenced this pull request May 30, 2022
…#2700)

* Fixes #558: Check for neo4j version being compatible with neo version

* doc addition - changed neo4j version getting

* added test - changed version handling

* edit comment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
4.4 core-functionality Adding new procedure, function or signature to APOC core
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add automatic sanity checks for Neo4j/APOC version combination
4 participants