Skip to content

Commit a5b8b87

Browse files
committed
Merge remote-tracking branch 'upstream/main' into easier_access_to_shard_awareness_api
2 parents 59ced8f + 5dbb10b commit a5b8b87

File tree

201 files changed

+21928
-3922
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

201 files changed

+21928
-3922
lines changed

.github/workflows/authenticate_test.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,13 @@ name: Authenticate
22

33
on:
44
push:
5-
branches: [ main ]
5+
branches:
6+
- main
7+
- 'branch-*'
68
pull_request:
7-
branches: [ main ]
9+
branches:
10+
- main
11+
- 'branch-*'
812

913
env:
1014
CARGO_TERM_COLOR: always
@@ -24,4 +28,4 @@ jobs:
2428
steps:
2529
- uses: actions/checkout@v3
2630
- name: Run tests
27-
run: cargo test --verbose authenticate_superuser -- custom_authentication --ignored
31+
run: RUST_LOG=trace cargo test --verbose authenticate_superuser -- custom_authentication --ignored

.github/workflows/book.yml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,13 @@ name: Book
33

44
on:
55
push:
6-
branches: [ main ]
6+
branches:
7+
- main
8+
- 'branch-*'
79
pull_request:
8-
branches: [ main ]
10+
branches:
11+
- main
12+
- 'branch-*'
913

1014
env:
1115
CARGO_TERM_COLOR: always
@@ -20,7 +24,7 @@ jobs:
2024
image: scylladb/scylla
2125
ports:
2226
- 9042:9042
23-
options: --health-cmd "cqlsh --debug" --health-interval 5s --health-retries 10
27+
options: --health-cmd "cqlsh --debug scylladb" --health-interval 5s --health-retries 10
2428
steps:
2529
- uses: actions/checkout@v3
2630
- name: Install mdbook
@@ -29,7 +33,5 @@ jobs:
2933
run: cargo build --verbose --examples
3034
- name: Build the book
3135
run: mdbook build docs
32-
- name: Build the book using the script
33-
run: python3 docs/build_book.py
3436
- name: Run book tests
3537
run: mdbook test -L target/debug/deps docs

.github/workflows/cassandra.yml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,13 @@ name: Cassandra tests
33

44
on:
55
push:
6-
branches: [ main ]
6+
branches:
7+
- main
8+
- 'branch-*'
79
pull_request:
8-
branches: [ main ]
10+
branches:
11+
- main
12+
- 'branch-*'
913

1014
env:
1115
CARGO_TERM_COLOR: always
@@ -22,10 +26,10 @@ jobs:
2226
docker compose -f test/cluster/cassandra/docker-compose.yml up -d --wait
2327
# A separate step for building to separate measuring time of compilation and testing
2428
- name: Build the project
25-
run: cargo build --verbose --tests
29+
run: cargo build --verbose --tests --features "full-serialization"
2630
- name: Run tests on cassandra
2731
run: |
28-
CDC='disabled' SCYLLA_URI=172.42.0.2:9042 SCYLLA_URI2=172.42.0.3:9042 SCYLLA_URI3=172.42.0.4:9042 cargo test --verbose -- --skip test_views_in_schema_info
32+
CDC='disabled' RUST_LOG=trace SCYLLA_URI=172.42.0.2:9042 SCYLLA_URI2=172.42.0.3:9042 SCYLLA_URI3=172.42.0.4:9042 cargo test --verbose --features "full-serialization" -- --skip test_views_in_schema_info --skip test_large_batch_statements
2933
- name: Stop the cluster
3034
if: ${{ always() }}
3135
run: docker compose -f test/cluster/cassandra/docker-compose.yml stop

.github/workflows/docs-pages.yaml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ on:
66
push:
77
branches:
88
- main
9+
- 'branch-**'
910
paths:
1011
- "docs/**"
1112
workflow_dispatch:
@@ -16,14 +17,15 @@ jobs:
1617
timeout-minutes: 10
1718
steps:
1819
- name: Checkout
19-
uses: actions/checkout@v3
20+
uses: actions/checkout@v4
2021
with:
22+
ref: ${{ github.event.repository.default_branch }}
2123
persist-credentials: false
2224
fetch-depth: 0
2325
- name: Set up Python
24-
uses: actions/setup-python@v3
26+
uses: actions/setup-python@v5
2527
with:
26-
python-version: 3.7
28+
python-version: '3.10'
2729
- name: Set up env
2830
run: make -C docs setupenv
2931
- name: Build docs

.github/workflows/docs-pr.yaml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ on:
66
pull_request:
77
branches:
88
- main
9+
- 'branch-*'
910
paths:
1011
- "docs/**"
1112

@@ -15,14 +16,14 @@ jobs:
1516
timeout-minutes: 10
1617
steps:
1718
- name: Checkout
18-
uses: actions/checkout@v3
19+
uses: actions/checkout@v4
1920
with:
2021
persist-credentials: false
2122
fetch-depth: 0
2223
- name: Set up Python
23-
uses: actions/setup-python@v3
24+
uses: actions/setup-python@v5
2425
with:
25-
python-version: 3.7
26+
python-version: '3.10'
2627
- name: Set up env
2728
run: make -C docs setupenv
2829
- name: Build docs

.github/workflows/rust.yml

Lines changed: 37 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,19 @@ name: Rust
22

33
on:
44
push:
5-
branches: [ main ]
5+
branches:
6+
- main
7+
- 'branch-*'
68
pull_request:
7-
branches: [ main ]
9+
branches:
10+
- main
11+
- 'branch-*'
812

913
env:
1014
CARGO_TERM_COLOR: always
1115
RUSTFLAGS: -Dwarnings
1216
RUST_BACKTRACE: full
13-
rust_min: 1.65.0 # <- Update this when bumping up MSRV
17+
rust_min: 1.66.0 # <- Update this when bumping up MSRV
1418

1519
jobs:
1620
build:
@@ -25,17 +29,35 @@ jobs:
2529
- name: Format check
2630
run: cargo fmt --verbose --all -- --check
2731
- name: Clippy check
28-
run: cargo clippy --verbose --examples --tests -- -Aclippy::uninlined_format_args
32+
run: cargo clippy --verbose --all-targets
33+
- name: Clippy check with all features
34+
run: cargo clippy --verbose --all-targets --all-features
2935
- name: Cargo check without features
30-
run: cargo check --manifest-path "scylla/Cargo.toml" --features ""
31-
- name: Cargo check with secrecy feature
32-
run: cargo check --manifest-path "scylla/Cargo.toml" --features "secret"
36+
run: cargo check --all-targets --manifest-path "scylla/Cargo.toml" --features ""
37+
- name: Cargo check with all serialization features
38+
run: cargo check --all-targets --manifest-path "scylla/Cargo.toml" --features "full-serialization"
39+
- name: Cargo check with all features
40+
run: cargo check --all-targets --manifest-path "scylla/Cargo.toml" --all-features
41+
- name: Cargo check with secret feature
42+
run: cargo check --all-targets --manifest-path "scylla/Cargo.toml" --features "secret"
43+
- name: Cargo check with chrono feature
44+
run: cargo check --all-targets --manifest-path "scylla/Cargo.toml" --features "chrono"
45+
- name: Cargo check with time feature
46+
run: cargo check --all-targets --manifest-path "scylla/Cargo.toml" --features "time"
47+
- name: Cargo check with num-bigint-03 feature
48+
run: cargo check --all-targets --manifest-path "scylla/Cargo.toml" --features "num-bigint-03"
49+
- name: Cargo check with num-bigint-04 feature
50+
run: cargo check --all-targets --manifest-path "scylla/Cargo.toml" --features "num-bigint-04"
51+
- name: Cargo check with bigdecimal-04 feature
52+
run: cargo check --all-targets --manifest-path "scylla/Cargo.toml" --features "bigdecimal-04"
3353
- name: Build scylla-cql
34-
run: cargo build --verbose --all-targets --manifest-path "scylla-cql/Cargo.toml"
54+
run: cargo build --verbose --all-targets --manifest-path "scylla-cql/Cargo.toml" --features "full-serialization"
3555
- name: Build
36-
run: cargo build --verbose --examples
56+
run: cargo build --verbose --all-targets --features "full-serialization"
3757
- name: Run tests
38-
run: SCYLLA_URI=172.42.0.2:9042 SCYLLA_URI2=172.42.0.3:9042 SCYLLA_URI3=172.42.0.4:9042 cargo test --verbose
58+
run: |
59+
cargo clean
60+
RUST_LOG=trace SCYLLA_URI=172.42.0.2:9042 SCYLLA_URI2=172.42.0.3:9042 SCYLLA_URI3=172.42.0.4:9042 cargo test --verbose --features "full-serialization"
3961
- name: Stop the cluster
4062
if: ${{ always() }}
4163
run: docker compose -f test/cluster/docker-compose.yml stop
@@ -56,12 +78,14 @@ jobs:
5678
rustup override set ${{ env.rust_min }}
5779
- name: Print Rust version
5880
run: rustc --version
81+
- name: Use MSRV Cargo.lock
82+
run: mv Cargo.lock.msrv Cargo.lock
5983
- name: MSRV cargo check with features
60-
run: cargo check --verbose --examples --tests
84+
run: cargo check --verbose --all-targets --all-features --locked
6185
- name: MSRV cargo check without features
62-
run: cargo check --verbose --manifest-path "scylla/Cargo.toml"
86+
run: cargo check --verbose --all-targets --locked --manifest-path "scylla/Cargo.toml"
6387
- name: MSRV cargo check scylla-cql
64-
run: cargo check --verbose --all-targets --manifest-path "scylla-cql/Cargo.toml"
88+
run: cargo check --verbose --all-targets --locked --manifest-path "scylla-cql/Cargo.toml"
6589

6690
# Tests that docstrings generate docs without warnings
6791
cargo_docs:
Lines changed: 148 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,148 @@
1+
# This workflow tests semver compatibilty.
2+
# For PRs it checks if PR makes any API breaking changes, and assings appropriate label if so.
3+
name: Semver checks
4+
5+
on:
6+
pull_request_target:
7+
branches:
8+
- main
9+
- 'branch-*'
10+
push:
11+
tags:
12+
- v*.*.*
13+
14+
env:
15+
CARGO_TERM_COLOR: always
16+
RUST_BACKTRACE: full
17+
PR_BASE: ${{ github.event.pull_request.base.sha }}
18+
PR_HEAD: ${{ github.event.pull_request.head.sha }}
19+
PR_ID: ${{ github.event.number }}
20+
21+
jobs:
22+
semver-pull-request-check:
23+
runs-on: ubuntu-latest
24+
if: github.event_name == 'pull_request_target'
25+
# Disable all permissions
26+
# This is important, because this job runs on untrusted input from
27+
# the user and it's possible for the user to take over the job,
28+
# for example by adding malicious build.rs file. If the job had,
29+
# for example, `pull_requests: write` permission, malicous user
30+
# could do us a lot of harm. This is also the reason that there are
31+
# 2 jobs - it's so that it's not possible to take over a job that
32+
# has permissions.
33+
permissions: {}
34+
timeout-minutes: 30
35+
# This is to prevent a situation, when job A triggered by push 1 finishes
36+
# after job B triggered by push 2. That could result in incorrectly assigning
37+
# or removing a PR label.
38+
concurrency:
39+
# Can't use `env.PR_ID` because concurrency doesn't have access to env context.
40+
group: semver-pull-request-check-${{ github.event.number }}
41+
cancel-in-progress: true
42+
outputs:
43+
exitcode: ${{ steps.semver-pr-check.outputs.exitcode }}
44+
output: ${{ steps.semver-pr-check.outputs.output }}
45+
steps:
46+
- name: Checkout
47+
uses: actions/checkout@v3
48+
with:
49+
fetch-depth: "2"
50+
ref: "refs/pull/${{ env.PR_ID }}/merge"
51+
# Check if there was another push before this job started.
52+
# If there was, wrong commit would be checked out.
53+
- name: Sanity check
54+
run: |
55+
[[ "$(git rev-parse 'HEAD^2')" == "$PR_HEAD" ]]
56+
# I don't know any way to do this using checkout action
57+
- name: Fetch PR base
58+
run: git fetch origin "$PR_BASE"
59+
- name: Install semver-checks
60+
# Official action uses binary releases fetched from GitHub
61+
# If this pipeline becomes too slow, we should do this too
62+
run: cargo install cargo-semver-checks --no-default-features
63+
- name: Verify the API compatibilty with PR base
64+
id: semver-pr-check
65+
run: |
66+
set -e # So that failed commands exit the script
67+
set -o pipefail # So that if a command in a pipe fails, the whole command fails
68+
69+
echo "output<<SEMVER_STDOUT_EOF" >> $GITHUB_OUTPUT
70+
SEMVER_REV_OUTPUT=$(make semver-rev rev="$PR_BASE" 2>&1) && true # "&& true" preserves exit code but cancels effects of set -e
71+
exitcode=$?
72+
73+
# Weird sed strip ANSI colors from output
74+
# If any of the commands below fail, `set -e` and `set -o pipefail` should exit the script
75+
echo "${SEMVER_REV_OUTPUT}" | tee /proc/self/fd/2 | sed -r "s/\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[mGK]//g" >> $GITHUB_OUTPUT
76+
echo "SEMVER_STDOUT_EOF" >> $GITHUB_OUTPUT
77+
78+
echo "Semver checks exitcode: " $exitcode
79+
echo "exitcode=$exitcode" >> $GITHUB_OUTPUT
80+
81+
semver-pull-request-label:
82+
runs-on: ubuntu-latest
83+
if: github.event_name == 'pull_request_target'
84+
permissions:
85+
pull-requests: write
86+
needs: semver-pull-request-check
87+
timeout-minutes: 3
88+
steps:
89+
- name: Get ID of comment if posted previously.
90+
uses: peter-evans/find-comment@v3
91+
id: find-comment
92+
with:
93+
issue-number: ${{ env.PR_ID }}
94+
comment-author: 'github-actions[bot]'
95+
body-includes: semver
96+
- name: Remove breaking label on success
97+
run: gh pr edit "$PR_ID" --remove-label semver-checks-breaking
98+
if: needs.semver-pull-request-check.outputs.exitcode == '0'
99+
env:
100+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
101+
GH_REPO: ${{ github.repository }}
102+
- name: Report that there were no breaks
103+
uses: peter-evans/create-or-update-comment@v4
104+
with:
105+
issue-number: ${{ env.PR_ID }}
106+
comment-id: ${{ steps.find-comment.outputs.comment-id }}
107+
body: |
108+
`cargo semver-checks` found no API-breaking changes in this PR! 🎉🥳
109+
Checked commit: ${{ env.PR_HEAD }}
110+
edit-mode: replace
111+
if: needs.semver-pull-request-check.outputs.exitcode == '0'
112+
- name: Add breaking label on failure
113+
run: gh pr edit "$PR_ID" --add-label semver-checks-breaking
114+
if: needs.semver-pull-request-check.outputs.exitcode != '0'
115+
env:
116+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
117+
GH_REPO: ${{ github.repository }}
118+
- name: Post report on semver break
119+
uses: peter-evans/create-or-update-comment@v4
120+
with:
121+
issue-number: ${{ env.PR_ID }}
122+
comment-id: ${{ steps.find-comment.outputs.comment-id }}
123+
body: |
124+
`cargo semver-checks` detected some API incompatibilities in this PR.
125+
Checked commit: ${{ env.PR_HEAD }}
126+
127+
See the following report for details:
128+
<details>
129+
<summary>cargo semver-checks output</summary>
130+
131+
```
132+
${{ needs.semver-pull-request-check.outputs.output }}
133+
```
134+
135+
</details>
136+
edit-mode: replace
137+
if: needs.semver-pull-request-check.outputs.exitcode != '0'
138+
139+
semver-push-tag:
140+
runs-on: ubuntu-latest
141+
if: github.event_name == 'push'
142+
timeout-minutes: 30
143+
steps:
144+
- uses: actions/checkout@v3
145+
- name: Install semver-checks
146+
run: cargo install cargo-semver-checks --no-default-features
147+
- name: Run semver-checks to see if it agrees with version updates
148+
run: make semver-version

.github/workflows/serverless.yaml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,13 @@ name: Serverless
22

33
on:
44
push:
5-
branches: [ main ]
5+
branches:
6+
- main
7+
- 'branch-*'
68
pull_request:
7-
branches: [ main ]
9+
branches:
10+
- main
11+
- 'branch-*'
812

913
env:
1014
CARGO_TERM_COLOR: always
@@ -31,7 +35,7 @@ jobs:
3135
- name: Run cloud example
3236
run: cargo run --example cloud -- $HOME/.ccm/serverless/config_data.yaml
3337
- name: Run cloud tests
34-
run: CLOUD_CONFIG_PATH=$HOME/.ccm/serverless/config_data.yaml RUSTFLAGS="--cfg scylla_cloud_tests" cargo test --verbose
38+
run: CLOUD_CONFIG_PATH=$HOME/.ccm/serverless/config_data.yaml RUSTFLAGS="--cfg scylla_cloud_tests" RUST_LOG=trace cargo test --verbose
3539

3640
- name: Remove serverless cluster
3741
run: ccm remove serverless

0 commit comments

Comments
 (0)