Skip to content

Fixes cypher 25 check for semver servers #508

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

Merged
merged 5 commits into from
May 22, 2025
Merged

Fixes cypher 25 check for semver servers #508

merged 5 commits into from
May 22, 2025

Conversation

anderson4j
Copy link
Collaborator

@anderson4j anderson4j commented May 21, 2025

New servers produce this from dbms.components():

image

Since semver.coerce(...) expects a string without zero-padding this format for neo4j server semvers break the coercion in the check for whether the server supports Cypher 25.

This PR switches so we use the new "Cypher" row returned from dbms.components(), in accordance with this comment

@anderson4j anderson4j requested a review from ncordon May 21, 2025 14:15
@anderson4j anderson4j added the bug Something isn't working label May 21, 2025
Copy link

changeset-bot bot commented May 21, 2025

⚠️ No Changeset found

Latest commit: 844c65d

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

}> {
const query = 'CALL dbms.components() YIELD versions';
const query = 'CALL dbms.components() YIELD name, versions';
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

originally I wanted this query to end with : WHERE name = "Cypher" RETURN versions
but this fails on system db.

Instead I opted to sort out the "Cypher" row and "versions" column in the resulttransformer.

/**
* Get dbms version
*/
export function getVersion(): ExecuteQueryArgs<{
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This old method became unused so I removed it, though I will reintroduce it in the "switch lintWorker" PR where we will once more want to match based off server version

Copy link
Collaborator

@ncordon ncordon May 22, 2025

Choose a reason for hiding this comment

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

If you are going to reintroduce the method later on, please don't delete it

export function getVersion(): ExecuteQueryArgs<{
serverVersion: string | undefined;
export function getCypherVersions(): ExecuteQueryArgs<{
cypherVersions: string[] | undefined;
Copy link
Collaborator

Choose a reason for hiding this comment

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

We should call this serverCypherVersions so it's clear what it means

@anderson4j anderson4j requested a review from ncordon May 22, 2025 12:07
@anderson4j anderson4j merged commit 34ddf0a into main May 22, 2025
7 checks passed
@anderson4j anderson4j deleted the semverFix branch May 22, 2025 13:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants