Skip to content

Added migration helper project - #3084

Open
chernser wants to merge 2 commits into
mainfrom
08/26/26/migration_helper
Open

Added migration helper project#3084
chernser wants to merge 2 commits into
mainfrom
08/26/26/migration_helper

Conversation

@chernser

@chernser chernser commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Adds migration helper project
  • Adds migration helper for covnerting v1 properties to v2 ones. Especially useful for server settings.

Checklist

Delete items not relevant to your PR:

  • Closes #
  • Unit and integration tests covering the common scenarios were added
  • A human-readable description of the changes was provided to include in CHANGELOG
  • For significant changes, documentation in https://github.com/ClickHouse/clickhouse-docs was updated with further explanations or tutorials

@chernser
chernser requested a review from mzitnik as a code owner August 27, 2026 03:11
Comment thread migration-helpers/pom.xml
<version>${revision}</version>
</parent>

<artifactId>migration-helpers</artifactId>

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

New module omitted from Maven reactor

High Severity

The new migration-helpers artifact is never registered in the parent pom.xml <modules> list, so a root mvn install or deploy does not compile, test, or publish it even though the changelog advertises the module.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 5210019. Configure here.

}
}
}
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Composite settings parser ignores escapes

Medium Severity

parseAndAddKeyValuePairs splits custom_settings and custom_http_headers on commas and the first =, without honoring the backslash escaping used by v1 ClickHouseOption.toKeyValuePairs and v2 ClientConfigProperties.toKeyValuePairs. Values that contain \, or \= are split into the wrong keys and values.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 5210019. Configure here.

Comment thread migration-helpers/pom.xml
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<version>${slf4j.version}</version>
</dependency>

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

slf4j-simple pulled in at compile scope

Medium Severity

slf4j-simple is declared as a default-scope dependency. Other modules such as jdbc-v2 and clickhouse-client keep it test-scoped. Consumers of migration-helpers inherit that binding and can get duplicate or hijacked SLF4J logging.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 5210019. Configure here.

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes using high effort and found 2 potential issues.

There are 5 total unresolved issues (including 3 from previous reviews).

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 5314c1c. Configure here.

sslkey=ssl_key
proxy_username=proxy_user
alive_timeout=http_keep_alive_timeout
http_keep_alive=http_keep_alive_timeout

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Boolean keep-alive mapped to timeout

High Severity

The new http_keep_alive mapping treats a v1 boolean keep-alive flag as http_keep_alive_timeout. Typical v1 values like true become a Long timeout, and v2 config parsing then fails with NumberFormatException during client or JDBC startup. The v1 timeout that actually maps to http_keep_alive_timeout is alive_timeout.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 5314c1c. Configure here.

Class<?> clazz = Class.forName("com.clickhouse.jdbc.JdbcConfig", false, getClass().getClassLoader());
Method getDriverPropertiesMethod = clazz.getMethod("getDriverProperties");
Object driverProps = getDriverPropertiesMethod.invoke(null);
if (driverProps != null && driverProps.getClass().isArray()) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

JdbcConfig reflection expects an array

Low Severity

The new classpath loader for JdbcConfig.getDriverProperties() only handles arrays, but that method returns a List. The isArray() check never succeeds, so runtime enrichment of v1 JDBC property names is a silent no-op.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 5314c1c. Configure here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant