chore: updates for cargo release (#2234)

chore: updates for cargo release
This commit is contained in:
Taddes 2026-04-22 17:58:40 +03:00 committed by GitHub
parent 525dba3a97
commit 3202c1f70e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
9 changed files with 59 additions and 4 deletions

View File

@ -212,6 +212,45 @@ jobs:
- name: Rust Clippy ${{ matrix.target }}
run: make clippy_${{ matrix.target }}
# Rust clippy release mode lint checker
clippy-release:
needs: rust-env
runs-on: ubuntu-latest
permissions:
contents: read
strategy:
matrix:
target: [spanner, mysql, postgres]
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
with:
persist-credentials: false
- name: Restore Rust toolchain
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5
with:
path: |
~/.rustup/toolchains
~/.rustup/update-hashes
key: ${{ runner.os }}-rust-toolchain-${{ env.RUST_VERSION }}
- name: Restore Rust cache
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-release-${{ matrix.target }}-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-release-${{ matrix.target }}-
- name: Set Rust toolchain
run: rustup default ${{ env.RUST_VERSION }}
- name: Rust Clippy release ${{ matrix.target }}
run: make clippy_release_${{ matrix.target }}
# Postgres unit tests ======
build-and-unit-test-postgres:
needs: [rust-env, python-env]

4
Cargo.lock generated
View File

@ -3567,9 +3567,9 @@ checksum = "f87165f0995f63a9fbeea62b64d10b4d9d8e78ec6d7d51fb2125fda7bb36788f"
[[package]]
name = "rustls-webpki"
version = "0.103.12"
version = "0.103.13"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8279bb85272c9f10811ae6a6c547ff594d6a7f3c6c6b02ee9726d1d0dcfcdd06"
checksum = "61c429a8649f110dddef65e2a5ad240f747e85f7758a6bccc7e5777bd33f756e"
dependencies = [
"aws-lc-rs",
"ring",

View File

@ -66,6 +66,18 @@ clippy_spanner:
# Matches what's run in circleci
cargo clippy --workspace --all-targets --no-default-features --features=syncstorage-db/spanner --features=py_verifier -- -D clippy::dbg_macro -D warnings
clippy_release_mysql:
# Release mode clippy — catches dead code and issues only visible with optimizations
cargo clippy --release --workspace --no-default-features --features=syncstorage-db/mysql --features=py_verifier -- -D warnings
clippy_release_postgres:
# Release mode clippy — catches dead code and issues only visible with optimizations
cargo clippy --release --workspace --no-default-features --features=syncstorage-db/postgres --features=tokenserver-db/postgres --features=py_verifier -- -D warnings
clippy_release_spanner:
# Release mode clippy — catches dead code and issues only visible with optimizations
cargo clippy --release --workspace --no-default-features --features=syncstorage-db/spanner --features=py_verifier -- -D warnings
clean:
cargo clean

View File

@ -216,6 +216,7 @@ impl CollectionCache {
.cloned())
}
#[allow(dead_code)]
pub fn clear(&self) {
self.by_name.write().expect("by_name write").clear();
self.by_id.write().expect("by_id write").clear();

View File

@ -212,6 +212,7 @@ impl CollectionCache {
.cloned())
}
#[allow(dead_code)]
pub fn clear(&self) {
self.by_name.write().expect("by_name write").clear();
self.by_id.write().expect("by_id write").clear();

View File

@ -190,6 +190,7 @@ impl CollectionCache {
(names, missing)
}
#[allow(dead_code)]
pub async fn clear(&self) {
self.by_name.write().await.clear();
self.by_id.write().await.clear();

View File

@ -97,7 +97,7 @@ impl Db for TokenserverDb {
AND replaced_at IS NULL
"#;
let now = chrono::Utc::now().timestamp_millis();
let now = Utc::now().timestamp_millis();
diesel::sql_query(QUERY)
.bind::<Bigint, _>(tokenserver_db_common::MAX_GENERATION)

View File

@ -20,6 +20,7 @@ impl TokenserverDb {
// most recently-inserted record *for a given connection*. If connections were shared across
// requests, using this function would introduce a race condition, as we could potentially
// get IDs from records created during other requests.
#[allow(dead_code)]
const LAST_INSERT_ID_QUERY: &'static str = "SELECT LAST_INSERT_ID() AS id";
const LAST_INSERT_UID_QUERY: &'static str = "SELECT LAST_INSERT_ID() AS uid";

View File

@ -486,7 +486,7 @@ impl Db for TokenserverPgDb {
AND replaced_at IS NULL
"#;
let now = chrono::Utc::now().timestamp_millis();
let now = Utc::now().timestamp_millis();
diesel::sql_query(QUERY)
.bind::<BigInt, _>(tokenserver_db_common::MAX_GENERATION)