mirror of
https://github.com/mozilla-services/syncstorage-rs.git
synced 2026-05-05 12:16:21 +02:00
chore: updates for cargo release (#2234)
chore: updates for cargo release
This commit is contained in:
parent
525dba3a97
commit
3202c1f70e
39
.github/workflows/main-workflow.yml
vendored
39
.github/workflows/main-workflow.yml
vendored
@ -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
4
Cargo.lock
generated
@ -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",
|
||||
|
||||
12
Makefile
12
Makefile
@ -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
|
||||
|
||||
|
||||
@ -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();
|
||||
|
||||
@ -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();
|
||||
|
||||
@ -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();
|
||||
|
||||
@ -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)
|
||||
|
||||
@ -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";
|
||||
|
||||
|
||||
@ -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)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user