chore(v1.1.9): clippy clean — workspace -D warnings

Surfaced + fixed during the F3 attestation:

- executor-core/sdk/queue.rs: drop redundant .map(|()| ()) call sites;
  enqueue_blocking discards QueueMessageId via .map(|_id| ()) (intentional)
- executor-core/sdk/retry.rs: hoist use std::collections::hash_map::DefaultHasher
  + use std::hash::Hasher to the top of the file (clippy::items_after_statements);
  replace `as i64` casts with i64::try_from + clear comment about jitter
  bound (clippy::cast_possible_wrap)
- executor-core/sdk/invoke.rs: move _LIMITS_IS_COPY const before #[cfg(test)]
  mod tests (clippy::items_after_test_module)
- manager-core/dispatcher.rs: dispatch_one_queue gains #[allow(too_many_lines)]
  (it's the queue tick's whole logic — split makes it less readable than
  the lint); .map(...).unwrap_or(default) → .map_or(default, ...)
- picloud/lib.rs: Limits { trigger_depth_max, ..Limits::default() } via
  struct-update instead of let-mut-assign (clippy::field_reassign_with_default)
- tests: r#"..."# → r"..." where there are no `"` inside (clippy::needless_raw_string_hashes);
  combine InvokeTarget::Name | InvokeTarget::Path arms with identical bodies
  in sdk_invoke.rs (clippy::match_same_arms)

cargo fmt --all -- --check 2>&1 | tail -3: no output (exit 0)
cargo clippy --workspace --all-targets --all-features -- -D warnings:
  Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.41s
Workspace lib smoke: 432 passing (306 manager-core + 74 executor-core + 34 shared + 18 orchestrator-core).
DB-gated E2E (against docker compose postgres on localhost:15432):
  queue_e2e: 4 ok / invoke_e2e: 4 ok / retry_e2e: 3 ok / migration_queue_messages: 4 ok / schema_snapshot: 1 ok

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
MechaCat02
2026-06-07 11:02:22 +02:00
parent c38c46b8bc
commit c3baa87415
18 changed files with 197 additions and 154 deletions

View File

@@ -31,7 +31,9 @@ async fn pool_or_skip() -> Option<PgPool> {
#[tokio::test(flavor = "multi_thread", worker_threads = 2)]
async fn queue_messages_table_exists_with_expected_columns() {
let Some(pool) = pool_or_skip().await else { return };
let Some(pool) = pool_or_skip().await else {
return;
};
let rows: Vec<(String, String, String)> = sqlx::query_as(
"SELECT column_name, data_type, is_nullable \
FROM information_schema.columns \
@@ -63,10 +65,8 @@ async fn queue_messages_table_exists_with_expected_columns() {
}
// Verify nullability on the right columns.
let nullable: std::collections::HashMap<String, String> = rows
.into_iter()
.map(|(n, _, nl)| (n, nl))
.collect();
let nullable: std::collections::HashMap<String, String> =
rows.into_iter().map(|(n, _, nl)| (n, nl)).collect();
assert_eq!(nullable["app_id"], "NO");
assert_eq!(nullable["queue_name"], "NO");
assert_eq!(nullable["payload"], "NO");
@@ -77,7 +77,9 @@ async fn queue_messages_table_exists_with_expected_columns() {
#[tokio::test(flavor = "multi_thread", worker_threads = 2)]
async fn queue_trigger_details_table_exists() {
let Some(pool) = pool_or_skip().await else { return };
let Some(pool) = pool_or_skip().await else {
return;
};
let rows: Vec<(String,)> = sqlx::query_as(
"SELECT column_name FROM information_schema.columns \
WHERE table_name = 'queue_trigger_details' \
@@ -87,7 +89,12 @@ async fn queue_trigger_details_table_exists() {
.await
.expect("read");
let names: Vec<&str> = rows.iter().map(|(n,)| n.as_str()).collect();
for required in ["trigger_id", "queue_name", "visibility_timeout_secs", "last_fired_at"] {
for required in [
"trigger_id",
"queue_name",
"visibility_timeout_secs",
"last_fired_at",
] {
assert!(
names.contains(&required),
"queue_trigger_details should have {required}, columns are {names:?}"
@@ -97,7 +104,9 @@ async fn queue_trigger_details_table_exists() {
#[tokio::test(flavor = "multi_thread", worker_threads = 2)]
async fn queue_widens_trigger_kind_and_outbox_source_kind() {
let Some(pool) = pool_or_skip().await else { return };
let Some(pool) = pool_or_skip().await else {
return;
};
// The triggers.kind constraint must accept 'queue'.
sqlx::query(
"DO $$ BEGIN PERFORM 1 FROM pg_constraint WHERE conname = 'triggers_kind_check'; END $$;",
@@ -133,7 +142,9 @@ async fn queue_widens_trigger_kind_and_outbox_source_kind() {
#[tokio::test(flavor = "multi_thread", worker_threads = 2)]
async fn queue_messages_dispatch_index_is_partial() {
let Some(pool) = pool_or_skip().await else { return };
let Some(pool) = pool_or_skip().await else {
return;
};
let (defn,): (String,) = sqlx::query_as(
"SELECT indexdef FROM pg_indexes \
WHERE indexname = 'idx_queue_messages_dispatch'",