Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
c75ff5f
Test fix for hostpool package
tengu-alt Mar 19, 2025
d32a392
CASSGO-11 Support vector type
lukasz-antoniak Oct 10, 2024
0094af0
Deprecate Session.ExecuteBatch() and move "execute batch" methods to …
tengu-alt Apr 24, 2025
b251492
CASSGO-23 Make Session immutable
ribaraka Apr 18, 2025
05e6036
Endless query execution fix
tengu-alt May 16, 2025
e517c94
Move all cicd steps into Makefile
dkropachev May 28, 2025
7279756
conn_test: address linter complaints
dkropachev May 28, 2025
0551773
Use golangci instead of govet
dkropachev May 30, 2025
5f4d36a
<framer> optimization `readTrace()` method
illia-li Apr 14, 2025
c0cefb0
<framer> optimization `writeHeader(...)` method
illia-li Apr 14, 2025
61c0b48
remove proto 1 and 2 support
dkropachev May 29, 2025
90bcc9c
Fix deadlock in refresh debouncer stop
joao-r-reis Apr 24, 2025
1fd2cba
CASSGO-43: externally-defined type registration
jameshartig Jan 2, 2025
f9a0f63
Changes to Query and Batch API
joao-r-reis Jun 10, 2025
f5fe483
Move the snappy compressor into a separate go package
OleksiienkoMykyta Mar 25, 2025
eda74b6
Change logger so it supports structured logging and log levels
joao-r-reis Jun 17, 2025
be35a5b
Add a way to create HostInfo objects for testing purposes
joao-r-reis Jun 13, 2025
f400b49
CASSGO-6 Accept peers with empty rack
jameshartig Jun 19, 2025
c7e5a24
Bump go version in go.mod to 1.19
joao-r-reis Jun 17, 2025
a9bfe80
Change module name to github.com/apache/cassandra-gocql-driver/v2
joao-r-reis Jun 18, 2025
a7f7f31
Fix tinyint silent unmarshal error and vector SliceMap bug
joao-r-reis Jul 3, 2025
61e64e6
Add missing Context variant methods to Query and Batch
joao-r-reis Jul 3, 2025
722707e
Change master to trunk in github workflow
joao-r-reis Jul 3, 2025
a6e8291
Remove release date from new releases and add 2.0.0-rc1
joao-r-reis Jul 15, 2025
d79b595
Fix protocol version negotiation issues with v5
joao-r-reis Aug 26, 2025
540cb3d
Fix issue where a timeout closes the connection
joao-r-reis Jul 18, 2025
759351e
Don't collect host metrics if a query/batch observer is not provided
joao-r-reis Sep 24, 2025
5fd2cdf
Update example and test code for 2.0 release
joao-r-reis Jul 15, 2025
b25d281
Update API documentation for 2.0 release
joao-r-reis Jul 22, 2025
5c60751
Update documentation for 2.0 (readme, upgrade guide, pkg.go.dev)
joao-r-reis Jul 22, 2025
f3e2b39
Prefer connection address over system table addresses
joao-r-reis Oct 10, 2025
22ab88e
CASSGO-92: add public method to retrieve StatementMetadata and LogFie…
jameshartig Oct 23, 2025
0326fae
Fix Iter.RowData Values to point to concrete types
jameshartig Oct 29, 2025
0089073
Prevent setting a compression flag in a frame header when native prot…
worryg0d Nov 18, 2025
6064d85
Protocol version negotiation doesn't work if server replies with stre…
worryg0d Nov 28, 2025
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
50 changes: 0 additions & 50 deletions .github/actions/setup-environment/action.yml

This file was deleted.

192 changes: 64 additions & 128 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,10 @@ name: Build
on:
push:
branches:
- master
- trunk
pull_request:
types: [ opened, synchronize, reopened ]

env:
CCM_VERSION: "6e71061146f7ae67b84ccd2b1d90d7319b640e4c"

jobs:
build:
name: Unit tests
Expand All @@ -22,9 +19,11 @@ jobs:
- uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go }}
- run: go vet
- name: Run linting
run: make check
- name: Run unit tests
run: go test -v -tags unit -race
run: make test-unit

integration-cassandra:
timeout-minutes: 15
needs:
Expand All @@ -35,7 +34,7 @@ jobs:
fail-fast: false
matrix:
go: [ '1.22', '1.23' ]
cassandra_version: [ '4.0.13', '4.1.6' ]
cassandra_version: [ '4.1.6', '5.0.3' ]
auth: [ "false" ]
compressor: [ "no-compression", "snappy", "lz4" ]
tags: [ "cassandra", "integration", "ccm" ]
Expand All @@ -45,82 +44,51 @@ jobs:
compressor: "snappy"
steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2

- uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go }}
- uses: actions/cache@v4
id: gomod-cache
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('go.mod') }}
restore-keys: |
${{ runner.os }}-go-
- name: Setup environment
uses: ./.github/actions/setup-environment
- name: Start cassandra nodes
run: |
source ~/venv/bin/activate
VERSION=${{ matrix.cassandra_version }}
keypath="$(pwd)/testdata/pki"
conf=(
"client_encryption_options.enabled: true"
"client_encryption_options.keystore: $keypath/.keystore"
"client_encryption_options.keystore_password: cassandra"
"client_encryption_options.require_client_auth: true"
"client_encryption_options.truststore: $keypath/.truststore"
"client_encryption_options.truststore_password: cassandra"
"concurrent_reads: 2"
"concurrent_writes: 2"
"write_request_timeout_in_ms: 5000"
"read_request_timeout_in_ms: 5000"
)

if [[ $VERSION == 3.*.* ]]; then
conf+=(
"rpc_server_type: sync"
"rpc_min_threads: 2"
"rpc_max_threads: 2"
"enable_user_defined_functions: true"
"enable_materialized_views: true"
)
elif [[ $VERSION == 4.0.* ]]; then
conf+=(
"enable_user_defined_functions: true"
"enable_materialized_views: true"
)
else
conf+=(
"user_defined_functions_enabled: true"
"materialized_views_enabled: true"
)
fi

ccm remove test || true

ccm create test -v $VERSION -n 3 -d --vnodes --jvm_arg="-Xmx256m -XX:NewSize=100m"
ccm updateconf "${conf[@]}"
- uses: actions/setup-python@v5
with:
python-version: '3.10'
cache: 'pip'
cache-dependency-path: Makefile

export JVM_EXTRA_OPTS=" -Dcassandra.test.fail_writes_ks=test -Dcassandra.custom_query_handler_class=org.apache.cassandra.cql3.CustomPayloadMirroringQueryHandler"
- name: Set up cache for SDKMAN
uses: actions/cache@v3
with:
path: ~/.sdkman
key: ${{ runner.os }}-sdkman

ccm start --wait-for-binary-proto --verbose
ccm status
ccm node1 nodetool status
- name: Set up cache for CCM
uses: actions/cache@v4
with:
path: ~/.ccm/repository
key: ${{ runner.os }}-ccm-${{ matrix.cassandra_version }}

args="-gocql.timeout=60s -runssl -proto=${{ matrix.proto_version }} -rf=3 -clusterSize=3 -autowait=2000ms -compressor=${{ matrix.compressor }} -gocql.cversion=$VERSION -cluster=$(ccm liveset) ./..."
- name: Start cassandra nodes
env:
CASSANDRA_VERSION: ${{ matrix.cassandra_version }}
run: |
make cassandra-start
sleep 30s

echo "args=$args" >> $GITHUB_ENV
echo "JVM_EXTRA_OPTS=$JVM_EXTRA_OPTS" >> $GITHUB_ENV
- name: Integration tests
env:
CASSANDRA_VERSION: ${{ matrix.cassandra_version }}
TEST_CQL_PROTOCOL: ${{ matrix.proto_version }}
TEST_COMPRESSOR: ${{ matrix.compressor }}
TEST_INTEGRATION_TAGS: ${{ matrix.tags }}
run: |
source ~/venv/bin/activate
export JVM_EXTRA_OPTS="${{env.JVM_EXTRA_OPTS}}"
go test -v -tags "${{ matrix.tags }} gocql_debug" -timeout=5m -race ${{ env.args }}
make test-integration

- name: 'Save ccm logs'
if: 'failure()'
uses: actions/upload-artifact@v4
with:
name: ccm-cluster-cassandra-${{ matrix.cassandra_version }}-go-${{ matrix.go }}-tag-${{ matrix.tags }}-proto-version-${{ matrix.proto_version }}-compressor-${{ matrix.compressor }}
path: /home/runner/.ccm/test
path: /home/runner/.ccm/gocql_integration_test
retention-days: 5
integration-auth-cassandra:
timeout-minutes: 15
Expand All @@ -144,69 +112,37 @@ jobs:
- uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go }}
- name: Setup environment
uses: ./.github/actions/setup-environment
- name: Start cassandra nodes
run: |
source ~/venv/bin/activate
VERSION=${{ matrix.cassandra_version }}
keypath="$(pwd)/testdata/pki"
conf=(
"client_encryption_options.enabled: true"
"client_encryption_options.keystore: $keypath/.keystore"
"client_encryption_options.keystore_password: cassandra"
"client_encryption_options.require_client_auth: true"
"client_encryption_options.truststore: $keypath/.truststore"
"client_encryption_options.truststore_password: cassandra"
"concurrent_reads: 2"
"concurrent_writes: 2"
"write_request_timeout_in_ms: 5000"
"read_request_timeout_in_ms: 5000"
"authenticator: PasswordAuthenticator"
"authorizer: CassandraAuthorizer"
"enable_user_defined_functions: true"
)

if [[ $VERSION == 3.*.* ]]; then
conf+=(
"rpc_server_type: sync"
"rpc_min_threads: 2"
"rpc_max_threads: 2"
"enable_user_defined_functions: true"
"enable_materialized_views: true"
)
elif [[ $VERSION == 4.0.* ]]; then
conf+=(
"enable_user_defined_functions: true"
"enable_materialized_views: true"
)
else
conf+=(
"user_defined_functions_enabled: true"
"materialized_views_enabled: true"
)
fi

ccm remove test || true

ccm create test -v $VERSION -n 1 -d --vnodes --jvm_arg="-Xmx256m -XX:NewSize=100m"
ccm updateconf "${conf[@]}"

rm -rf $HOME/.ccm/test/node1/data/system_auth

export JVM_EXTRA_OPTS=" -Dcassandra.test.fail_writes_ks=test -Dcassandra.custom_query_handler_class=org.apache.cassandra.cql3.CustomPayloadMirroringQueryHandler"
- uses: actions/setup-python@v5
with:
python-version: '3.10'
cache: 'pip'
cache-dependency-path: Makefile

ccm start --wait-for-binary-proto --verbose
ccm status
ccm node1 nodetool status
- name: Set up cache for SDKMAN
uses: actions/cache@v3
with:
path: ~/.sdkman
key: ${{ runner.os }}-sdkman

args="-gocql.timeout=60s -runssl -proto=${{ matrix.proto_version }} -rf=3 -clusterSize=1 -autowait=2000ms -compressor=${{ matrix.compressor }} -gocql.cversion=$VERSION -cluster=$(ccm liveset) ./..."
- name: Set up cache for CCM
uses: actions/cache@v4
with:
path: ~/.ccm/repository
key: ${{ runner.os }}-ccm-${{ matrix.cassandra_version }}

echo "args=$args" >> $GITHUB_ENV
echo "JVM_EXTRA_OPTS=$JVM_EXTRA_OPTS" >> $GITHUB_ENV
- name: Start cassandra nodes
env:
CASSANDRA_VERSION: ${{ matrix.cassandra_version }}
run: |
make cassandra-start
sleep 30s

- name: Integration tests
env:
CASSANDRA_VERSION: ${{ matrix.cassandra_version }}
TEST_CQL_PROTOCOL: ${{ matrix.proto_version }}
TEST_COMPRESSOR: ${{ matrix.compressor }}
TEST_INTEGRATION_TAGS: ${{ matrix.tags }}
run: |
source ~/venv/bin/activate
export JVM_EXTRA_OPTS="${{env.JVM_EXTRA_OPTS}}"
go test -v -run=TestAuthentication -tags "${{ matrix.tags }} gocql_debug" -timeout=15s -runauth ${{ env.args }}
make test-integration-auth
34 changes: 34 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
version: "2"

issues:
max-same-issues: 50

formatters:
enable:
- goimports

settings:
goimports:
local-prefixes:
- github.com/gocql/gocql
- github.com/apache/cassandra-gocql-driver
- github.com/apache/cassandra-gocql-driver/v2
golines:
max-len: 120

linters:
default: none
enable:
- nolintlint
- govet
settings:
govet:
enable-all: true
disable:
- shadow
- fieldalignment

nolintlint:
allow-no-explanation: [ golines ]
require-explanation: true
require-specific: true
Loading