Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
version: 2
updates:
- package-ecosystem: maven
directory: /
schedule:
interval: weekly
open-pull-requests-limit: 5
groups:
maven-minor-and-patch:
patterns:
- "*"
update-types:
- minor
- patch

- package-ecosystem: github-actions
directory: /
schedule:
interval: weekly
open-pull-requests-limit: 3
groups:
github-actions:
patterns:
- "*"
6 changes: 4 additions & 2 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@
Closes <!-- Link to an issue to close on merge. -->
<!-- Description can be only appended not replaced. PR title should stay unchanged after creation but can be changed by user.
All appended comments should contain author and time.
Read AGENTS.md and docs/ai_review.md for review instructions.
Read AGENTS.md and docs/ai-review.md for review instructions.
Use docs/README.md to choose the authoritative documentation layer. Published website changes belong in
docs/clickhouse-docs/; repository integration guidance belongs in docs/integration-*.md.
-->
## Checklist
Delete items not relevant to your PR:
- [ ] Closes #<issue ref>
- [ ] 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
- [ ] For significant changes, the authoritative source under `docs/clickhouse-docs/` was updated for publication
75 changes: 75 additions & 0 deletions .github/workflows/api-compatibility.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
name: API compatibility

on:
pull_request:
paths:
- "**/pom.xml"
- "**/src/main/java/**"
- "VERSION"
- ".github/workflows/api-compatibility.yml"
workflow_dispatch:

permissions:
contents: read

jobs:
compare-last-ga:
name: Compare public API with last GA
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- name: Check out repository and release tags
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install JDKs and Maven cache
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: |
11
17
cache: maven
- name: Set up JDK toolchain
shell: bash
run: |
mkdir -p "$HOME/.m2"
cat > "$HOME/.m2/toolchains.xml" <<EOF
<?xml version="1.0" encoding="UTF8"?>
<toolchains>
<toolchain>
<type>jdk</type>
<provides><version>11</version></provides>
<configuration><jdkHome>${JAVA_HOME_11_X64}</jdkHome></configuration>
</toolchain>
<toolchain>
<type>jdk</type>
<provides><version>17</version></provides>
<configuration><jdkHome>${JAVA_HOME_17_X64}</jdkHome></configuration>
</toolchain>
</toolchains>
EOF
- name: Resolve last GA version
id: baseline
shell: bash
run: |
tag="$(
git tag --list 'v[0-9]*' --sort=-version:refname |
awk '/^v[0-9]+\.[0-9]+\.[0-9]+$/ { print; exit }'
)"
test -n "$tag" || {
echo "No vMAJOR.MINOR.PATCH GA tag was found" >&2
exit 1
}
echo "version=${tag#v}" >> "$GITHUB_OUTPUT"
echo "Comparing against $tag"
- name: Validate development version
run: python3 scripts/release/validate_version.py
- name: Check binary compatibility
run: |
mvn --batch-mode --no-transfer-progress \
-DskipTests -Dmaven.javadoc.skip=true install
mvn --batch-mode --no-transfer-progress \
--projects clickhouse-data,clickhouse-client,clickhouse-http-client,client-v2,jdbc-v2,clickhouse-jdbc,clickhouse-r2dbc \
-Dapi.compatibility.version="${{ steps.baseline.outputs.version }}" \
-Papi-compatibility japicmp:cmp
4 changes: 4 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@ jobs:
git fetch --no-tags --prune --progress --no-recurse-submodules --depth=1 \
origin pull/${{ github.event.inputs.pr }}/merge:merged-pr && git checkout merged-pr
if: github.event.inputs.pr != ''
- name: Validate release version metadata
run: |
python3 -m unittest discover -s scripts/release -p 'test_*.py'
python3 scripts/release/validate_version.py
- name: Install JDK 8 and Maven
uses: actions/setup-java@v4
with:
Expand Down
154 changes: 119 additions & 35 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,88 +2,172 @@ name: Release

on:
workflow_dispatch:
inputs:
publish:
description: "Publish to Maven Central and create the GitHub release"
required: true
default: false
type: boolean

env:
CH_VERSION: "25.8"

jobs:
release:
name: "Build and Publish Artifact"
name: Verify release artifacts
runs-on: "ubuntu-latest"

timeout-minutes: 60
outputs:
version: ${{ steps.version.outputs.version }}
permissions:
contents: write
contents: read

steps:
- name: Check out Git repository
uses: actions/checkout@v4
- name: Read release version
id: version
shell: bash
run: echo "version=$(cat VERSION)" >> "$GITHUB_OUTPUT"
- name: Install JDK and Maven
run: |
python3 scripts/release/validate_version.py
echo "version=$(cat VERSION)" >> "$GITHUB_OUTPUT"
- name: Install JDKs and Maven cache
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: |
8
11
17
cache: 'maven'
server-id: central
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }}
gpg-passphrase: MAVEN_GPG_PASSPHRASE
- name: Setup Toolchain
shell: bash
run: |
mkdir -p $HOME/.m2 \
&& cat << EOF > $HOME/.m2/toolchains.xml
mkdir -p "$HOME/.m2"
cat > "$HOME/.m2/toolchains.xml" << EOF
<?xml version="1.0" encoding="UTF8"?>
<toolchains>
<toolchain>
<type>jdk</type>
<provides>
<version>11</version>
</provides>
<configuration>
<jdkHome>${JAVA_HOME_11_X64}</jdkHome>
</configuration>
</toolchain>
<toolchain>
<type>jdk</type>
<provides>
<version>17</version>
</provides>
<configuration>
<jdkHome>${{ env.JAVA_HOME }}</jdkHome>
<jdkHome>${JAVA_HOME_17_X64}</jdkHome>
</configuration>
</toolchain>
</toolchains>
EOF
- name: Update Configuration
- name: Verify release build
env:
TEST_CLICKHOUSE_IMAGE_VERSION: ${{ env.CH_VERSION }}
run: |
sed -i 's|<revision>.*</revision>|<revision>${{ steps.version.outputs.version }}</revision>|g' pom.xml
find . -type f -name "simplelogger.*" -exec rm -fv '{}' \;
- name: Release Maven package
mvn --batch-mode --no-transfer-progress \
-Drevision="${{ steps.version.outputs.version }}" \
-Dgpg.skip=true -DskipITs \
-P release clean verify
- name: Inventory release artifacts
run: |
python3 scripts/release/inventory_artifacts.py \
--version "${{ steps.version.outputs.version }}"
- name: Upload dry-run artifacts
uses: actions/upload-artifact@v4
with:
name: release-${{ steps.version.outputs.version }}
path: release-assets/
if-no-files-found: error

publish:
name: Publish verified release
needs: release
if: ${{ inputs.publish }}
runs-on: ubuntu-latest
timeout-minutes: 45
environment: release
permissions:
contents: write
steps:
- name: Check out verified commit
uses: actions/checkout@v4
- name: Download verified release artifacts
uses: actions/download-artifact@v4
with:
name: release-${{ needs.release.outputs.version }}
path: release-assets
- name: Install JDK 11
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 11
- name: Configure Maven Central signing
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 17
cache: maven
server-id: central
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }}
gpg-passphrase: MAVEN_GPG_PASSPHRASE
- name: Set up JDK toolchain
shell: bash
run: |
mkdir -p "$HOME/.m2"
cat > "$HOME/.m2/toolchains.xml" << EOF
<?xml version="1.0" encoding="UTF8"?>
<toolchains>
<toolchain>
<type>jdk</type>
<provides><version>11</version></provides>
<configuration><jdkHome>${JAVA_HOME_11_X64}</jdkHome></configuration>
</toolchain>
<toolchain>
<type>jdk</type>
<provides><version>17</version></provides>
<configuration><jdkHome>${JAVA_HOME_17_X64}</jdkHome></configuration>
</toolchain>
</toolchains>
EOF
- name: Publish verified version to Maven Central
env:
MAVEN_USERNAME: ${{ secrets.SONATYPE_TOKEN_USER }}
MAVEN_PASSWORD: ${{ secrets.SONATYPE_TOKEN }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
TEST_CLICKHOUSE_IMAGE_VERSION: ${{ env.CH_VERSION }}
run: mvn -q --batch-mode -P release clean deploy
- name: Create Pre-release on Github
run: |
mvn --batch-mode --no-transfer-progress \
-Drevision="${{ needs.release.outputs.version }}" \
-DskipTests \
-P release deploy
- name: Create RC or GA GitHub release
shell: bash
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release create "v${{ steps.version.outputs.version }}" \
--prerelease \
--title "Release v${{ steps.version.outputs.version }}" \
LICENSE \
clickhouse-client/target/clickhouse*.jar \
clickhouse-data/target/clickhouse*.jar \
clickhouse-http-client/target/clickhouse*.jar \
clickhouse-jdbc/target/clickhouse*.jar \
clickhouse-jdbc/target/bundle/clickhouse*.jar \
clickhouse-r2dbc/target/clickhouse*.jar \
client-v2/target/client-v2*.jar \
jdbc-v2/target/jdbc-v2*.jar
version="${{ needs.release.outputs.version }}"
release_flags=(--generate-notes --target "$GITHUB_SHA")
if [[ "$version" == *-* ]]; then
release_flags+=(--prerelease --latest=false)
else
release_flags+=(--latest)
fi
gh release create "v${version}" \
--title "Release v${version}" \
"${release_flags[@]}" \
release-assets/*
# Mirror Tableau TDVT after release (non-blocking).
tdvt:
name: "Tableau TDVT"
needs: release
if: ${{ needs.release.result == 'success' && startsWith(github.repository, 'ClickHouse/') }}
needs: publish
if: ${{ needs.publish.result == 'success' && startsWith(github.repository, 'ClickHouse/') }}
runs-on: "ubuntu-latest"
timeout-minutes: 150 # the TDVT matrix (latest/head/cloud, single-threaded) runs ~1h; allow for a queue
steps:
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ jdbc-v2/src/main/antlr4/com/clickhouse/jdbc/internal/ClickHouseLexer.tokens
# test configuration
**/test/resources/test.properties
performance/jmh-simple-results.json
performance/results/
*.csv
*.sql
*.json
Expand Down
2 changes: 1 addition & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ Prefer targeted Maven commands over full-repo runs.

Also compile examples or packaging modules (e.g. `packages/clickhouse-jdbc-all`) when a change affects examples, packaging, public APIs, or other user-facing behavior — running the touched module's tests alone isn't enough.

Run benchmarks under `clickhouse-benchmark` when a change touches a performance-sensitive path (see
Run benchmarks under `performance` when a change touches a performance-sensitive path (see
`docs/ai-review.md`); this is optional and only worth doing when performance is actually in question.

Avoid broad dependency, formatting, or unrelated cleanup churn unless required by the task.
Expand Down
11 changes: 5 additions & 6 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -214,11 +214,10 @@ mvn -DskipTests -Pnative clean package
Run benchmarks when the change may affect performance:

```bash
cd clickhouse-benchmark
mvn clean package
mvn -DskipTests -pl packages/clickhouse-jdbc-all -am install
mvn -f performance/pom.xml clean package

# single thread mode
java -DdbHost=localhost -jar target/benchmarks.jar -t 1 \
-p client=clickhouse-jdbc -p connection=reuse \
-p statement=prepared -p type=default Query.selectInt8
# list available benchmarks
java -cp performance/target/jmh-benchmark-0.1-SNAPSHOT-jar-with-dependencies.jar \
org.openjdk.jmh.Main -l
```
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ Nightly Builds: https://s01.oss.sonatype.org/content/repositories/snapshots/com/

### Examples

[Begin-with Usage Examples](../../tree/main/examples/client-v2)
[Begin-with Usage Examples](examples/client-v2)

[Spring Demo Service](https://github.com/ClickHouse/clickhouse-java/tree/main/examples/demo-spring-service)

Expand All @@ -105,7 +105,7 @@ Nightly Builds: https://s01.oss.sonatype.org/content/repositories/snapshots/com/

### Examples

See [JDBC examples](../../tree/main/examples/jdbc)
See [JDBC examples](examples/jdbc)

## R2DBC Driver

Expand Down
Loading
Loading