Skip to content
Merged
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
16 changes: 14 additions & 2 deletions .github/workflows/msrv.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,23 @@ jobs:
with:
persist-credentials: false

# Keep in sync with `rust-version` in the crate manifests.
# The MSRV is `workspace.package.rust-version`, which every crate
# inherits; read it with the runner's preinstalled cargo.
- name: Read declared rust-version
id: msrv
run: |
versions=$(cargo metadata --no-deps --format-version 1 | jq -r '[.packages[].rust_version] | unique | .[]')
if [ "$(printf '%s\n' "$versions" | wc -l)" -ne 1 ] || [ -z "$versions" ] || [ "$versions" = "null" ]; then
echo "::error::expected one rust-version across the workspace, got: ${versions:-<none>}"
exit 1
fi
echo "Declared rust-version: $versions"
echo "version=$versions" >> "$GITHUB_OUTPUT"

- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@b725eda525362e7cf34af9a7243cac1e3f01a7ec # stable @ 2026-10-16
with:
toolchain: "1.94.1"
toolchain: ${{ steps.msrv.outputs.version }}

- name: Check all targets
run: |
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,9 @@ jobs:
DIR="clickhousectl-${TARGET}-v${VERSION}"
mkdir "$DIR"
cp "target/${TARGET}/release/clickhousectl" "$DIR/"
# install.sh, npm install.js and `update` take the binary by name,
# so the licence beside it changes nothing they extract.
cp LICENSE "$DIR/"
tar -czf "${DIR}.tar.gz" "$DIR"

- name: Upload artifact
Expand Down
2 changes: 1 addition & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ the unit layer by default. Where a unit test and a subprocess test overlap, keep
## Dependencies

Use `cargo add` with the latest version and an explicit crate, e.g. `cargo add -p clickhouse-cloud-api url`.
Every crate declares the same `rust-version`; raise it in all three manifests, both READMEs and `msrv.yml` together.
The MSRV is `rust-version` in the root `[workspace.package]` (`msrv.yml` reads it); raise it there and in both READMEs.

## Releases

Expand Down
9 changes: 9 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,12 @@ members = [
"crates/clickhouse-openapi-analyzer",
]
resolver = "3"

# Shared by every crate (`<key>.workspace = true`). `rust-version` is the one
# MSRV: msrv.yml reads it from `cargo metadata`. Versions stay per crate.
[workspace.package]
edition = "2024"
rust-version = "1.94.1"
license = "Apache-2.0"
repository = "https://github.com/ClickHouse/clickhousectl"
homepage = "https://github.com/ClickHouse/clickhousectl"
10 changes: 5 additions & 5 deletions crates/clickhouse-cloud-api/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
[package]
name = "clickhouse-cloud-api"
version = "0.6.0"
edition = "2024"
rust-version = "1.94.1"
edition.workspace = true
rust-version.workspace = true
description = "Typed Rust client for the ClickHouse Cloud API"
license = "Apache-2.0"
repository = "https://github.com/ClickHouse/clickhousectl"
homepage = "https://github.com/ClickHouse/clickhousectl"
license.workspace = true
repository.workspace = true
homepage.workspace = true
keywords = ["clickhouse", "cloud", "api", "client"]
categories = ["api-bindings", "database"]
# Ship the library and its documentation only: the spec snapshot, tests and
Expand Down
2 changes: 2 additions & 0 deletions crates/clickhouse-cloud-api/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@
//! spec drift of that kind is the job of the repository's daily OpenAPI drift
//! check, not of runtime deserialization.

#![forbid(unsafe_code)]

pub mod client;
pub mod convert;
pub mod error;
Expand Down
6 changes: 4 additions & 2 deletions crates/clickhouse-openapi-analyzer/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
[package]
name = "clickhouse-openapi-analyzer"
version = "0.0.0"
edition = "2024"
rust-version = "1.94.1"
edition.workspace = true
rust-version.workspace = true
license.workspace = true
repository.workspace = true
publish = false

[lib]
Expand Down
11 changes: 5 additions & 6 deletions crates/clickhousectl/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
[package]
name = "clickhousectl"
version = "0.6.0"
edition = "2024"
rust-version = "1.94.1"
edition.workspace = true
rust-version.workspace = true
description = "The CLI for ClickHouse: local and cloud."
license = "Apache-2.0"
repository = "https://github.com/ClickHouse/clickhousectl"
homepage = "https://github.com/ClickHouse/clickhousectl"
license.workspace = true
repository.workspace = true
homepage.workspace = true
keywords = ["clickhouse", "cli", "database", "cloud"]
categories = ["command-line-utilities", "database"]
readme = "../../README.md"
Expand Down Expand Up @@ -75,7 +75,6 @@ clap_complete = { version = "=4.6.11", features = ["unstable-dynamic"] }
[dev-dependencies]
rustls = { version = "0.23.46", default-features = false, features = ["aws_lc_rs", "std", "tls12"] }
rustls-native-certs = "0.8.5"
serde_json = "1"
tokio = { version = "1", features = ["test-util"] }
tokio-postgres = "0.7.18"
tokio-postgres-rustls = "0.14.0"
Expand Down
Loading