Skip to content

armgit / macro

Public Imported from GitHub
0

Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.

chore: sqlx clippy rule (#3562)

Will Hutchinsonf8f2ad644c6f
diff --git a/.github/workflows/code-check-cloud-storage.yml b/.github/workflows/code-check-cloud-storage.yml
index 6c82e1a938..d8f88808ea 100644
--- a/.github/workflows/code-check-cloud-storage.yml
+++ b/.github/workflows/code-check-cloud-storage.yml
@@ -166,7 +166,7 @@ jobs:
if: needs.path-check.outputs.should_run == 'true' && github.event.pull_request.draft == false
runs-on: linux-extra-beefy
env:
- RUSTFLAGS: "-Dwarnings -C link-arg=-fuse-ld=mold"
+ RUSTFLAGS: "-Dwarnings -Dclippy::disallowed_methods -C link-arg=-fuse-ld=mold"
RUSTDOCFLAGS: "-Dwarnings"
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
@@ -190,7 +190,7 @@ jobs:
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID || secrets.AWS_ACCESS_KEY }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
- run: cd rust/cloud-storage && cargo clippy --all-features
+ run: cd rust/cloud-storage && cargo clippy --workspace --all-features
- name: show sccache stats
if: always()
env:
diff --git a/rust/cloud-storage/backfill_entity_access/src/main.rs b/rust/cloud-storage/backfill_entity_access/src/main.rs
index 3c38ad1004..aee586cfca 100644
--- a/rust/cloud-storage/backfill_entity_access/src/main.rs
+++ b/rust/cloud-storage/backfill_entity_access/src/main.rs
@@ -66,6 +66,7 @@ async fn main() -> anyhow::Result<()> {
/// `(Option<Uuid>, i64)` — the maximum `UserItemAccess.id` processed in this
/// batch (NULL when empty = termination), and the number of source rows
/// considered in the batch.
+#[allow(clippy::disallowed_methods, reason = "legacy code. fix later")]
async fn run_keyset(
db: &Pool<Postgres>,
label: &str,
diff --git a/rust/cloud-storage/call/src/outbound/pg_call_repo.rs b/rust/cloud-storage/call/src/outbound/pg_call_repo.rs
index 3698aac409..8c744f4a3f 100644
--- a/rust/cloud-storage/call/src/outbound/pg_call_repo.rs
+++ b/rust/cloud-storage/call/src/outbound/pg_call_repo.rs
@@ -879,6 +879,7 @@ impl CallRepository for PgCallRepo {
}
#[tracing::instrument(err, skip(self))]
+ #[allow(clippy::disallowed_methods, reason = "legacy code. fix later")]
async fn get_transcript_voice_id_for_speaker(
&self,
call_id: &Uuid,
@@ -907,6 +908,7 @@ impl CallRepository for PgCallRepo {
}
#[tracing::instrument(err, skip(self))]
+ #[allow(clippy::disallowed_methods, reason = "legacy code. fix later")]
async fn get_call_record_by_call_id(
&self,
call_id: &Uuid,
diff --git a/rust/cloud-storage/call/src/outbound/pg_call_repo/edit.rs b/rust/cloud-storage/call/src/outbound/pg_call_repo/edit.rs
index 5524b07547..b51d87568c 100644
--- a/rust/cloud-storage/call/src/outbound/pg_call_repo/edit.rs
+++ b/rust/cloud-storage/call/src/outbound/pg_call_repo/edit.rs
@@ -224,6 +224,7 @@ pub(super) async fn set_custom_speakers(
}
/// Update the SharePermission row (isPublic, publicAccessLevel).
+#[allow(clippy::disallowed_methods, reason = "legacy code. fix later")]
async fn update_share_permission_row(
transaction: &mut Transaction<'_, Postgres>,
share_permission_id: &str,
diff --git a/rust/cloud-storage/call/src/outbound/pg_voice_repo.rs b/rust/cloud-storage/call/src/outbound/pg_voice_repo.rs
index 522c6c26f7..c566dd357b 100644
--- a/rust/cloud-storage/call/src/outbound/pg_voice_repo.rs
+++ b/rust/cloud-storage/call/src/outbound/pg_voice_repo.rs
@@ -47,6 +47,7 @@ impl PgVoiceRepo {
impl VoiceRepository for PgVoiceRepo {
type Err = sqlx::Error;
+ #[allow(clippy::disallowed_methods, reason = "legacy code. fix later")]
async fn upsert_voice(&self, embedding: &[f32]) -> Result<Uuid, Self::Err> {
let id = macro_uuid::generate_uuid_v7();
let lock_key = embedding_advisory_lock_key(embedding);
diff --git a/rust/cloud-storage/chat/src/outbound/postgres/queries/edit_share_permission.rs b/rust/cloud-storage/chat/src/outbound/postgres/queries/edit_share_permission.rs
index 6ba9020f34..dcc4c47aeb 100644
--- a/rust/cloud-storage/chat/src/outbound/postgres/queries/edit_share_permission.rs
+++ b/rust/cloud-storage/chat/src/outbound/postgres/queries/edit_share_permission.rs
@@ -39,6 +39,7 @@ pub(crate) async fn edit_chat_permission(
/// Update a `SharePermission` row and its channel share permissions.
#[tracing::instrument(err, skip(tx))]
+#[allow(clippy::disallowed_methods, reason = "legacy code. fix later")]
async fn edit_share_permission(
tx: &mut Transaction<'_, Postgres>,
chat_id: &str,
diff --git a/rust/cloud-storage/clippy.toml b/rust/cloud-storage/clippy.toml
new file mode 100644
index 0000000000..17c472482d
--- /dev/null
+++ b/rust/cloud-storage/clippy.toml
@@ -0,0 +1,5 @@
+disallowed-methods = [
+ { path = "sqlx::query", replacement = "sqlx::query!" },
+ { path = "sqlx::query_as", replacement = "sqlx::query_as!" },
+ { path = "sqlx::query_scalar", replacement = "sqlx::query_scalar!" },
+]
diff --git a/rust/cloud-storage/documents/src/outbound/pg_document_repo.rs b/rust/cloud-storage/documents/src/outbound/pg_document_repo.rs
index 504de7771c..bae2993bb5 100644
--- a/rust/cloud-storage/documents/src/outbound/pg_document_repo.rs
+++ b/rust/cloud-storage/documents/src/outbound/pg_document_repo.rs
@@ -575,6 +575,7 @@ impl DocumentRepo for PgDocumentRepo {
}
#[tracing::instrument(err, skip(self))]
+ #[allow(clippy::disallowed_methods, reason = "legacy code. fix later")]
async fn mark_document_uploaded(&self, document_id: &str) -> Result<(), Self::Err> {
let result = sqlx::query(
r#"
@@ -598,6 +599,7 @@ impl DocumentRepo for PgDocumentRepo {
}
#[tracing::instrument(err, skip(self))]
+ #[allow(clippy::disallowed_methods, reason = "legacy code. fix later")]
async fn get_persisted_document_content(
&self,
document_id: &str,
@@ -624,6 +626,7 @@ impl DocumentRepo for PgDocumentRepo {
}
#[tracing::instrument(err, skip(self, content))]
+ #[allow(clippy::disallowed_methods, reason = "legacy code. fix later")]
async fn set_document_content(
&self,
document_id: &str,
diff --git a/rust/cloud-storage/documents/src/outbound/pg_document_repo/copy.rs b/rust/cloud-storage/documents/src/outbound/pg_document_repo/copy.rs
index 074096e747..fa4f94e94d 100644
--- a/rust/cloud-storage/documents/src/outbound/pg_document_repo/copy.rs
+++ b/rust/cloud-storage/documents/src/outbound/pg_document_repo/copy.rs
@@ -243,6 +243,7 @@ pub async fn copy_pdf_parts(
}
/// Creates bom parts for a document bom.
+#[allow(clippy::disallowed_methods, reason = "legacy code. fix later")]
async fn create_bom_parts(
transaction: &mut Transaction<'_, Postgres>,
document_bom_id: i64,
diff --git a/rust/cloud-storage/documents/src/outbound/pg_document_repo/edit.rs b/rust/cloud-storage/documents/src/outbound/pg_document_repo/edit.rs
index 93d8cf6910..514fc2fafd 100644
--- a/rust/cloud-storage/documents/src/outbound/pg_document_repo/edit.rs
+++ b/rust/cloud-storage/documents/src/outbound/pg_document_repo/edit.rs
@@ -8,6 +8,7 @@ use sqlx::{Postgres, Transaction};
/// Update document metadata (name, projectId, fileType, updatedAt).
///
/// `file_type`: None = no change, Some(None) = set to NULL, Some(Some(ft)) = set to ft.
+#[allow(clippy::disallowed_methods, reason = "legacy code. fix later")]
pub(super) async fn update_document_metadata(
transaction: &mut Transaction<'_, Postgres>,
document_id: &str,
@@ -98,6 +99,7 @@ pub(super) async fn update_share_permission(
}
/// Update the SharePermission row (isPublic, publicAccessLevel).
+#[allow(clippy::disallowed_methods, reason = "legacy code. fix later")]
async fn update_share_permission_row(
transaction: &mut Transaction<'_, Postgres>,
share_permission_id: &str,
diff --git a/rust/cloud-storage/documents/src/outbound/pg_document_repo/markdown_backfill.rs b/rust/cloud-storage/documents/src/outbound/pg_document_repo/markdown_backfill.rs
index f72abe7938..f19846f349 100644
--- a/rust/cloud-storage/documents/src/outbound/pg_document_repo/markdown_backfill.rs
+++ b/rust/cloud-storage/documents/src/outbound/pg_document_repo/markdown_backfill.rs
@@ -5,6 +5,7 @@ use crate::outbound::pg_document_repo::PgDocumentRepo;
impl MarkdownBackfillRepo for PgDocumentRepo {
#[tracing::instrument(err, skip(self))]
+ #[allow(clippy::disallowed_methods, reason = "legacy code. fix later")]
async fn fetch_markdown_backfill_candidates(
&self,
start_after: Option<&str>,
@@ -61,6 +62,7 @@ impl MarkdownBackfillRepo for PgDocumentRepo {
}
#[tracing::instrument(err, skip(self, candidates), fields(count = candidates.len()))]
+ #[allow(clippy::disallowed_methods, reason = "legacy code. fix later")]
async fn mark_markdown_sync_service_ready(
&self,
candidates: &[MarkdownBackfillCandidate],
diff --git a/rust/cloud-storage/email/src/outbound/email_pg_repo/test/crm_scope_dynamic_query.rs b/rust/cloud-storage/email/src/outbound/email_pg_repo/test/crm_scope_dynamic_query.rs
index e0eb292a08..4602e60318 100644
--- a/rust/cloud-storage/email/src/outbound/email_pg_repo/test/crm_scope_dynamic_query.rs
+++ b/rust/cloud-storage/email/src/outbound/email_pg_repo/test/crm_scope_dynamic_query.rs
@@ -733,6 +733,7 @@ async fn crm_scope_pagination_across_team_links(pool: Pool<Postgres>) -> anyhow:
scripts("email_dynamic_query_crm_scope")
)
)]
+#[allow(clippy::disallowed_methods, reason = "legacy code. fix later")]
async fn crm_scope_collapses_to_empty_when_killswitch_off(
pool: Pool<Postgres>,
) -> anyhow::Result<()> {
diff --git a/rust/cloud-storage/email/src/outbound/email_pg_repo/test/draft.rs b/rust/cloud-storage/email/src/outbound/email_pg_repo/test/draft.rs
index 770cbf9207..1b4b9d8913 100644
--- a/rust/cloud-storage/email/src/outbound/email_pg_repo/test/draft.rs
+++ b/rust/cloud-storage/email/src/outbound/email_pg_repo/test/draft.rs
@@ -221,6 +221,7 @@ async fn test_upsert_contacts_new_contact(pool: Pool<Postgres>) -> anyhow::Resul
migrator = "MACRO_DB_MIGRATIONS",
fixtures(path = "../../../../fixtures", scripts("email_draft"))
)]
+#[allow(clippy::disallowed_methods, reason = "legacy code. fix later")]
async fn test_upsert_contacts_fills_missing_name(pool: Pool<Postgres>) -> anyhow::Result<()> {
let repo = EmailPgRepo::new(pool.clone());
@@ -328,6 +329,7 @@ async fn test_upsert_contacts_case_insensitive(pool: Pool<Postgres>) -> anyhow::
migrator = "MACRO_DB_MIGRATIONS",
fixtures(path = "../../../../fixtures", scripts("email_draft"))
)]
+#[allow(clippy::disallowed_methods, reason = "legacy code. fix later")]
async fn test_insert_draft_message_into_existing_thread(
pool: Pool<Postgres>,
) -> anyhow::Result<()> {
@@ -418,6 +420,7 @@ async fn test_insert_draft_message_into_existing_thread(
migrator = "MACRO_DB_MIGRATIONS",
fixtures(path = "../../../../fixtures", scripts("email_draft"))
)]
+#[allow(clippy::disallowed_methods, reason = "legacy code. fix later")]
async fn test_insert_draft_message_with_new_thread(pool: Pool<Postgres>) -> anyhow::Result<()> {
let repo = EmailPgRepo::new(pool.clone());
@@ -488,6 +491,7 @@ async fn test_insert_draft_message_with_new_thread(pool: Pool<Postgres>) -> anyh
migrator = "MACRO_DB_MIGRATIONS",
fixtures(path = "../../../../fixtures", scripts("email_draft"))
)]
+#[allow(clippy::disallowed_methods, reason = "legacy code. fix later")]
async fn test_insert_draft_message_with_scheduled_send(pool: Pool<Postgres>) -> anyhow::Result<()> {
let repo = EmailPgRepo::new(pool.clone());
@@ -539,6 +543,7 @@ async fn test_insert_draft_message_with_scheduled_send(pool: Pool<Postgres>) ->
migrator = "MACRO_DB_MIGRATIONS",
fixtures(path = "../../../../fixtures", scripts("email_draft"))
)]
+#[allow(clippy::disallowed_methods, reason = "legacy code. fix later")]
async fn test_insert_draft_message_upsert_existing(pool: Pool<Postgres>) -> anyhow::Result<()> {
let repo = EmailPgRepo::new(pool.clone());
@@ -594,6 +599,7 @@ async fn test_insert_draft_message_upsert_existing(pool: Pool<Postgres>) -> anyh
migrator = "MACRO_DB_MIGRATIONS",
fixtures(path = "../../../../fixtures", scripts("email_draft"))
)]
+#[allow(clippy::disallowed_methods, reason = "legacy code. fix later")]
async fn test_insert_draft_message_updates_thread_metadata(
pool: Pool<Postgres>,
) -> anyhow::Result<()> {
@@ -647,6 +653,7 @@ async fn test_insert_draft_message_updates_thread_metadata(
migrator = "MACRO_DB_MIGRATIONS",
fixtures(path = "../../../../fixtures", scripts("email_draft"))
)]
+#[allow(clippy::disallowed_methods, reason = "legacy code. fix later")]
async fn test_insert_message_with_is_draft_false(pool: Pool<Postgres>) -> anyhow::Result<()> {
let repo = EmailPgRepo::new(pool.clone());
diff --git a/rust/cloud-storage/email/src/outbound/email_pg_repo/test/message.rs b/rust/cloud-storage/email/src/outbound/email_pg_repo/test/message.rs
index 22870da9f1..8fe31b6abf 100644
--- a/rust/cloud-storage/email/src/outbound/email_pg_repo/test/message.rs
+++ b/rust/cloud-storage/email/src/outbound/email_pg_repo/test/message.rs
@@ -459,6 +459,7 @@ async fn test_scheduled_send_times_by_message_ids_empty_input(
migrator = "MACRO_DB_MIGRATIONS",
fixtures(path = "../../../../fixtures", scripts("email_draft"))
)]
+#[allow(clippy::disallowed_methods, reason = "legacy code. fix later")]
async fn test_process_scheduled_message_insert(pool: Pool<Postgres>) -> anyhow::Result<()> {
let link_id = Uuid::parse_str("aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa")?;
let msg_id = Uuid::parse_str("ee000001-0000-0000-0000-000000000001")?;
@@ -493,6 +494,7 @@ async fn test_process_scheduled_message_insert(pool: Pool<Postgres>) -> anyhow::
migrator = "MACRO_DB_MIGRATIONS",
fixtures(path = "../../../../fixtures", scripts("email_draft"))
)]
+#[allow(clippy::disallowed_methods, reason = "legacy code. fix later")]
async fn test_process_scheduled_message_upsert(pool: Pool<Postgres>) -> anyhow::Result<()> {
let link_id = Uuid::parse_str("aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa")?;
let msg_id = Uuid::parse_str("ee000001-0000-0000-0000-000000000001")?;
@@ -542,6 +544,7 @@ async fn test_process_scheduled_message_upsert(pool: Pool<Postgres>) -> anyhow::
migrator = "MACRO_DB_MIGRATIONS",
fixtures(path = "../../../../fixtures", scripts("email_draft"))
)]
+#[allow(clippy::disallowed_methods, reason = "legacy code. fix later")]
async fn test_process_scheduled_message_delete(pool: Pool<Postgres>) -> anyhow::Result<()> {
let link_id = Uuid::parse_str("aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa")?;
let msg_id = Uuid::parse_str("ee000001-0000-0000-0000-000000000001")?;
@@ -594,6 +597,7 @@ async fn test_process_scheduled_message_delete_nonexistent(
migrator = "MACRO_DB_MIGRATIONS",
fixtures(path = "../../../../fixtures", scripts("email_draft"))
)]
+#[allow(clippy::disallowed_methods, reason = "legacy code. fix later")]
async fn test_upsert_recipients_insert(pool: Pool<Postgres>) -> anyhow::Result<()> {
// msg2 (draft) currently has no recipients in the fixture
let msg_id = Uuid::parse_str("ee000002-0000-0000-0000-000000000002")?;
@@ -634,6 +638,7 @@ async fn test_upsert_recipients_insert(pool: Pool<Postgres>) -> anyhow::Result<(
migrator = "MACRO_DB_MIGRATIONS",
fixtures(path = "../../../../fixtures", scripts("email_draft"))
)]
+#[allow(clippy::disallowed_methods, reason = "legacy code. fix later")]
async fn test_upsert_recipients_removes_stale(pool: Pool<Postgres>) -> anyhow::Result<()> {
// msg1 has bob=TO in the fixture. Replace with carol=CC.
let msg_id = Uuid::parse_str("ee000001-0000-0000-0000-000000000001")?;
@@ -678,6 +683,7 @@ async fn test_upsert_recipients_removes_stale(pool: Pool<Postgres>) -> anyhow::R
migrator = "MACRO_DB_MIGRATIONS",
fixtures(path = "../../../../fixtures", scripts("email_draft"))
)]
+#[allow(clippy::disallowed_methods, reason = "legacy code. fix later")]
async fn test_upsert_recipients_empty_deletes_all(pool: Pool<Postgres>) -> anyhow::Result<()> {
// msg1 has bob=TO. Calling upsert with empty recipients should delete all existing.
let msg_id = Uuid::parse_str("ee000001-0000-0000-0000-000000000001")?;
diff --git a/rust/cloud-storage/email/src/outbound/email_pg_repo/test/thread.rs b/rust/cloud-storage/email/src/outbound/email_pg_repo/test/thread.rs
index 987ae94d71..c1e4114e00 100644
--- a/rust/cloud-storage/email/src/outbound/email_pg_repo/test/thread.rs
+++ b/rust/cloud-storage/email/src/outbound/email_pg_repo/test/thread.rs
@@ -282,6 +282,7 @@ async fn test_insert_thread_conflict_with_provider_id(pool: Pool<Postgres>) -> a
migrator = "MACRO_DB_MIGRATIONS",
fixtures(path = "../../../../fixtures", scripts("email_draft"))
)]
+#[allow(clippy::disallowed_methods, reason = "legacy code. fix later")]
async fn test_update_thread_metadata_with_inbound_message(
pool: Pool<Postgres>,
) -> anyhow::Result<()> {
@@ -310,6 +311,7 @@ async fn test_update_thread_metadata_with_inbound_message(
migrator = "MACRO_DB_MIGRATIONS",
fixtures(path = "../../../../fixtures", scripts("email_draft"))
)]
+#[allow(clippy::disallowed_methods, reason = "legacy code. fix later")]
async fn test_update_thread_metadata_read_status(pool: Pool<Postgres>) -> anyhow::Result<()> {
use sqlx::Row;
@@ -338,6 +340,7 @@ async fn test_update_thread_metadata_read_status(pool: Pool<Postgres>) -> anyhow
migrator = "MACRO_DB_MIGRATIONS",
fixtures(path = "../../../../fixtures", scripts("email_draft"))
)]
+#[allow(clippy::disallowed_methods, reason = "legacy code. fix later")]
async fn test_upsert_user_history_insert(pool: Pool<Postgres>) -> anyhow::Result<()> {
let link_id = Uuid::parse_str("aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa")?;
let thread_id = Uuid::parse_str("11111111-1111-1111-1111-111111111111")?;
@@ -363,6 +366,7 @@ async fn test_upsert_user_history_insert(pool: Pool<Postgres>) -> anyhow::Result
migrator = "MACRO_DB_MIGRATIONS",
fixtures(path = "../../../../fixtures", scripts("email_draft"))
)]
+#[allow(clippy::disallowed_methods, reason = "legacy code. fix later")]
async fn test_upsert_user_history_updates_timestamp(pool: Pool<Postgres>) -> anyhow::Result<()> {
use sqlx::Row;
diff --git a/rust/cloud-storage/email/src/outbound/email_pg_repo/test/thread_labels.rs b/rust/cloud-storage/email/src/outbound/email_pg_repo/test/thread_labels.rs
index 25f955e468..cd837bd9fa 100644
--- a/rust/cloud-storage/email/src/outbound/email_pg_repo/test/thread_labels.rs
+++ b/rust/cloud-storage/email/src/outbound/email_pg_repo/test/thread_labels.rs
@@ -150,6 +150,7 @@ async fn test_get_thread_label_messages_wrong_link(pool: Pool<Postgres>) -> anyh
migrator = "MACRO_DB_MIGRATIONS",
fixtures(path = "../../../../fixtures", scripts("email_thread_labels"))
)]
+#[allow(clippy::disallowed_methods, reason = "legacy code. fix later")]
async fn test_insert_message_labels_batch(pool: Pool<Postgres>) -> anyhow::Result<()> {
let repo = EmailPgRepo::new(pool.clone());
let link_id = Uuid::parse_str("aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa")?;
@@ -177,6 +178,7 @@ async fn test_insert_message_labels_batch(pool: Pool<Postgres>) -> anyhow::Resul
migrator = "MACRO_DB_MIGRATIONS",
fixtures(path = "../../../../fixtures", scripts("email_thread_labels"))
)]
+#[allow(clippy::disallowed_methods, reason = "legacy code. fix later")]
async fn test_insert_message_labels_batch_idempotent(pool: Pool<Postgres>) -> anyhow::Result<()> {
let repo = EmailPgRepo::new(pool.clone());
let link_id = Uuid::parse_str("aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa")?;
@@ -222,6 +224,7 @@ async fn test_insert_message_labels_batch_empty(pool: Pool<Postgres>) -> anyhow:
migrator = "MACRO_DB_MIGRATIONS",
fixtures(path = "../../../../fixtures", scripts("email_thread_labels"))
)]
+#[allow(clippy::disallowed_methods, reason = "legacy code. fix later")]
async fn test_delete_message_labels_batch(pool: Pool<Postgres>) -> anyhow::Result<()> {
let repo = EmailPgRepo::new(pool.clone());
let link_id = Uuid::parse_str("aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa")?;
@@ -281,6 +284,7 @@ async fn test_delete_message_labels_batch_empty(pool: Pool<Postgres>) -> anyhow:
migrator = "MACRO_DB_MIGRATIONS",
fixtures(path = "../../../../fixtures", scripts("email_thread_labels"))
)]
+#[allow(clippy::disallowed_methods, reason = "legacy code. fix later")]
async fn test_update_message_read_status_batch_mark_read(
pool: Pool<Postgres>,
) -> anyhow::Result<()> {
@@ -310,6 +314,7 @@ async fn test_update_message_read_status_batch_mark_read(
migrator = "MACRO_DB_MIGRATIONS",
fixtures(path = "../../../../fixtures", scripts("email_thread_labels"))
)]
+#[allow(clippy::disallowed_methods, reason = "legacy code. fix later")]
async fn test_update_message_read_status_batch_wrong_link(
pool: Pool<Postgres>,
) -> anyhow::Result<()> {
@@ -350,6 +355,7 @@ async fn test_update_message_read_status_batch_empty(pool: Pool<Postgres>) -> an
migrator = "MACRO_DB_MIGRATIONS",
fixtures(path = "../../../../fixtures", scripts("email_thread_labels"))
)]
+#[allow(clippy::disallowed_methods, reason = "legacy code. fix later")]
async fn test_update_message_starred_status_batch_star(pool: Pool<Postgres>) -> anyhow::Result<()> {
let repo = EmailPgRepo::new(pool.clone());
let link_id = Uuid::parse_str("aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa")?;
@@ -374,6 +380,7 @@ async fn test_update_message_starred_status_batch_star(pool: Pool<Postgres>) ->
migrator = "MACRO_DB_MIGRATIONS",
fixtures(path = "../../../../fixtures", scripts("email_thread_labels"))
)]
+#[allow(clippy::disallowed_methods, reason = "legacy code. fix later")]
async fn test_update_message_starred_status_batch_unstar(
pool: Pool<Postgres>,
) -> anyhow::Result<()> {
@@ -401,6 +408,7 @@ async fn test_update_message_starred_status_batch_unstar(
migrator = "MACRO_DB_MIGRATIONS",
fixtures(path = "../../../../fixtures", scripts("email_thread_labels"))
)]
+#[allow(clippy::disallowed_methods, reason = "legacy code. fix later")]
async fn test_update_message_starred_status_batch_wrong_link(
pool: Pool<Postgres>,
) -> anyhow::Result<()> {
diff --git a/rust/cloud-storage/email_db_client/src/attachments/provider/mod.rs b/rust/cloud-storage/email_db_client/src/attachments/provider/mod.rs
index 5405b8e9ce..22e28a2d05 100644
--- a/rust/cloud-storage/email_db_client/src/attachments/provider/mod.rs
+++ b/rust/cloud-storage/email_db_client/src/attachments/provider/mod.rs
@@ -13,6 +13,7 @@ use std::collections::HashMap;
/// inserts the metadata for attachments of an email into the database in a batch
#[tracing::instrument(skip(tx, attachments, message_id), err)]
+#[allow(clippy::disallowed_methods, reason = "legacy code. fix later")]
pub async fn insert_attachments(
tx: &mut sqlx::PgConnection,
message_id: Uuid,
diff --git a/rust/cloud-storage/email_db_client/src/attachments/provider/upload.rs b/rust/cloud-storage/email_db_client/src/attachments/provider/upload.rs
index 661517898e..157f5ba655 100644
--- a/rust/cloud-storage/email_db_client/src/attachments/provider/upload.rs
+++ b/rust/cloud-storage/email_db_client/src/attachments/provider/upload.rs
@@ -18,6 +18,7 @@ use sqlx::{Pool, Postgres, Row};
/// sent a message to in the past. but those attachments are fetched once backfill is complete, in
/// a different call.
#[tracing::instrument(skip(db), err)]
+#[allow(clippy::disallowed_methods, reason = "legacy code. fix later")]
pub async fn thread_document_atts_for_backfill(
db: &Pool<Postgres>,
thread_id: Uuid,
@@ -83,6 +84,7 @@ pub async fn thread_document_atts_for_backfill(
/// fetch videos and images from a thread for insertion into sfs. we insert them into
/// sfs so we can display thumbnails for them in the FE.
#[tracing::instrument(skip(db), err)]
+#[allow(clippy::disallowed_methods, reason = "legacy code. fix later")]
pub async fn thread_media_atts_for_backfill(
db: &Pool<Postgres>,
thread_id: Uuid,
@@ -133,6 +135,7 @@ pub async fn thread_media_atts_for_backfill(
/// fetch_attachment_threads_for_backfill, but the BackfillAttachment job has logic to ensure
/// duplicate attachments are not inserted by checking the DocumentEmail table.
#[tracing::instrument(skip(db), err)]
+#[allow(clippy::disallowed_methods, reason = "legacy code. fix later")]
pub async fn fetch_job_attachments_for_backfill(
db: &Pool<Postgres>,
link_id: Uuid,
@@ -234,6 +237,7 @@ pub async fn fetch_job_attachments_for_backfill(
/// and fetch_job_attachments_for_backfill respectively, except they also verify the attachment
/// doesn't already exist in document_email table.
#[tracing::instrument(skip(db), err)]
+#[allow(clippy::disallowed_methods, reason = "legacy code. fix later")]
pub async fn new_email_document_atts(
db: &Pool<Postgres>,
link_id: Uuid,
@@ -413,6 +417,7 @@ pub async fn new_email_document_atts(
/// The query atomically claims attachments (sets upload_claimed_at) to prevent duplicate
/// uploads from concurrent workers processing the same message.
#[tracing::instrument(skip(db), err)]
+#[allow(clippy::disallowed_methods, reason = "legacy code. fix later")]
pub async fn new_email_media_atts(
db: &Pool<Postgres>,
link_id: Uuid,
diff --git a/rust/cloud-storage/email_db_client/src/labels/insert.rs b/rust/cloud-storage/email_db_client/src/labels/insert.rs
index 52e0b31142..2c2c49f7f6 100644
--- a/rust/cloud-storage/email_db_client/src/labels/insert.rs
+++ b/rust/cloud-storage/email_db_client/src/labels/insert.rs
@@ -259,6 +259,7 @@ pub async fn insert_label(
}
/// inserts the labels of an email into the database in a batch
+#[allow(clippy::disallowed_methods, reason = "legacy code. fix later")]
pub async fn insert_message_labels(
tx: &mut sqlx::PgConnection,
link_id: Uuid,
diff --git a/rust/cloud-storage/email_db_client/src/messages/get.rs b/rust/cloud-storage/email_db_client/src/messages/get.rs
index 3e04f4ceba..e934b56512 100644
--- a/rust/cloud-storage/email_db_client/src/messages/get.rs
+++ b/rust/cloud-storage/email_db_client/src/messages/get.rs
@@ -63,6 +63,7 @@ pub async fn get_message_sender_and_pretty_sender(
/// Returns the (message_id, thread_id) for a message with the given (link_id, provider_id).
/// Errors if no row is found.
#[tracing::instrument(skip(pool), err)]
+#[allow(clippy::disallowed_methods, reason = "legacy code. fix later")]
pub async fn get_message_and_thread_id_by_provider_id(
pool: &PgPool,
link_id: Uuid,
@@ -93,6 +94,7 @@ pub async fn get_message_and_thread_id_by_provider_id(
/// Returns `true` if a message already exists for this (provider_id, link_id), else `false`.
#[tracing::instrument(skip(pool), err)]
+#[allow(clippy::disallowed_methods, reason = "legacy code. fix later")]
pub async fn message_exists_by_provider_id(
pool: &PgPool,
provider_id: &str,
diff --git a/rust/cloud-storage/email_service/src/bin/backfill_gmail_attachments/database.rs b/rust/cloud-storage/email_service/src/bin/backfill_gmail_attachments/database.rs
index 69348fc2de..760a83a227 100644
--- a/rust/cloud-storage/email_service/src/bin/backfill_gmail_attachments/database.rs
+++ b/rust/cloud-storage/email_service/src/bin/backfill_gmail_attachments/database.rs
@@ -166,6 +166,7 @@ pub async fn create_db_pool(database_url: &str, min_connections: u32) -> anyhow:
/// Fetches attachments from the database that match one of several conditions.
/// Uses a combined query for conditions 1-4, and a separate query for condition 5.
+#[allow(clippy::disallowed_methods, reason = "legacy code. fix later")]
pub async fn fetch_unique_attachments(
db: &PgPool,
link_id: Uuid,
diff --git a/rust/cloud-storage/email_service/src/bin/backfill_sfs_attachments/database.rs b/rust/cloud-storage/email_service/src/bin/backfill_sfs_attachments/database.rs
index f39fde61b0..fdcc4ae30b 100644
--- a/rust/cloud-storage/email_service/src/bin/backfill_sfs_attachments/database.rs
+++ b/rust/cloud-storage/email_service/src/bin/backfill_sfs_attachments/database.rs
@@ -16,6 +16,7 @@ pub async fn create_db_pool(database_url: &str, min_connections: u32) -> anyhow:
}
/// fetch the user's image and video attachments, ordered from oldest to newest
+#[allow(clippy::disallowed_methods, reason = "legacy code. fix later")]
pub async fn fetch_sfs_attachments(
db: &sqlx::Pool<sqlx::Postgres>,
macro_id: &str,
diff --git a/rust/cloud-storage/email_service/src/bin/cleanup_unused_sfs/process.rs b/rust/cloud-storage/email_service/src/bin/cleanup_unused_sfs/process.rs
index 9d9aa79a73..da1d355e4e 100644
--- a/rust/cloud-storage/email_service/src/bin/cleanup_unused_sfs/process.rs
+++ b/rust/cloud-storage/email_service/src/bin/cleanup_unused_sfs/process.rs
@@ -100,6 +100,7 @@ pub async fn delete_from_sfs(
}
/// Deletes the mapping row from email_sfs_mappings by destination URL.
+#[allow(clippy::disallowed_methods, reason = "legacy code. fix later")]
pub async fn delete_mapping_from_db(db: &PgPool, destination_url: &str) -> anyhow::Result<bool> {
let result = sqlx::query("DELETE FROM public.email_sfs_mappings WHERE destination = $1")
.bind(destination_url)
@@ -112,6 +113,7 @@ pub async fn delete_mapping_from_db(db: &PgPool, destination_url: &str) -> anyho
/// Deletes multiple mapping rows from email_sfs_mappings by destination URLs.
/// Returns the number of rows deleted.
+#[allow(clippy::disallowed_methods, reason = "legacy code. fix later")]
pub async fn bulk_delete_mappings_from_db(
db: &PgPool,
destination_urls: &[String],
diff --git a/rust/cloud-storage/email_service/src/bin/find_unused_sfs_ids/process.rs b/rust/cloud-storage/email_service/src/bin/find_unused_sfs_ids/process.rs
index 713595f16e..5eefdad3a8 100644
--- a/rust/cloud-storage/email_service/src/bin/find_unused_sfs_ids/process.rs
+++ b/rust/cloud-storage/email_service/src/bin/find_unused_sfs_ids/process.rs
@@ -14,6 +14,7 @@ const UUID_LENGTH: usize = 36;
/// Streams mapping destinations from the database, extracts UUIDs, and writes them to a file.
/// Returns the number of UUIDs written.
+#[allow(clippy::disallowed_methods, reason = "legacy code. fix later")]
pub async fn stream_mapping_uuids_to_file(db: &PgPool, file_path: &Path) -> anyhow::Result<usize> {
let file = File::create(file_path)
.with_context(|| format!("Failed to create file: {}", file_path.display()))?;
diff --git a/rust/cloud-storage/email_service/src/bin/find_used_sfs_ids/process.rs b/rust/cloud-storage/email_service/src/bin/find_used_sfs_ids/process.rs
index a7ab69788b..05545abc7b 100644
--- a/rust/cloud-storage/email_service/src/bin/find_used_sfs_ids/process.rs
+++ b/rust/cloud-storage/email_service/src/bin/find_used_sfs_ids/process.rs
@@ -13,6 +13,7 @@ use uuid::Uuid;
use crate::config::Config;
/// Fetches all message IDs from the database.
+#[allow(clippy::disallowed_methods, reason = "legacy code. fix later")]
pub async fn fetch_all_message_ids(db: &PgPool) -> anyhow::Result<Vec<Uuid>> {
let rows: Vec<(Uuid,)> = sqlx::query_as("SELECT id FROM public.email_messages")
.fetch_all(db)
@@ -84,6 +85,7 @@ pub struct MessageBody {
}
/// Fetches message bodies in batch for the given message IDs.
+#[allow(clippy::disallowed_methods, reason = "legacy code. fix later")]
pub async fn fetch_message_bodies_batch(
db: &PgPool,
message_ids: &[Uuid],
diff --git a/rust/cloud-storage/email_service/src/bin/reverse_sfs_mappings/process.rs b/rust/cloud-storage/email_service/src/bin/reverse_sfs_mappings/process.rs
index a32e05dfde..046929236a 100644
--- a/rust/cloud-storage/email_service/src/bin/reverse_sfs_mappings/process.rs
+++ b/rust/cloud-storage/email_service/src/bin/reverse_sfs_mappings/process.rs
@@ -55,6 +55,7 @@ pub struct MessageRow {
}
/// Counts messages with non-null body_html_sanitized for the given link_ids (or all if None).
+#[allow(clippy::disallowed_methods, reason = "legacy code. fix later")]
pub async fn count_messages(db: &PgPool, link_ids: &Option<Vec<Uuid>>) -> anyhow::Result<i64> {
let count: i64 = if let Some(link_ids) = link_ids {
sqlx::query_scalar(
@@ -77,6 +78,7 @@ pub async fn count_messages(db: &PgPool, link_ids: &Option<Vec<Uuid>>) -> anyhow
/// Fetches all message IDs for a single link_id where body_html_sanitized is not null.
/// Uses the (link_id) index for filtering.
+#[allow(clippy::disallowed_methods, reason = "legacy code. fix later")]
pub async fn fetch_message_ids_for_link(db: &PgPool, link_id: Uuid) -> anyhow::Result<Vec<Uuid>> {
let ids: Vec<Uuid> = sqlx::query_scalar(
"SELECT id FROM public.email_messages WHERE link_id = $1 AND body_html_sanitized IS NOT NULL",
@@ -89,6 +91,7 @@ pub async fn fetch_message_ids_for_link(db: &PgPool, link_id: Uuid) -> anyhow::R
}
/// Fetches all message IDs where body_html_sanitized is not null (no link_id filter).
+#[allow(clippy::disallowed_methods, reason = "legacy code. fix later")]
pub async fn fetch_all_message_ids(db: &PgPool) -> anyhow::Result<Vec<Uuid>> {
let ids: Vec<Uuid> = sqlx::query_scalar(
"SELECT id FROM public.email_messages WHERE body_html_sanitized IS NOT NULL",
@@ -100,6 +103,7 @@ pub async fn fetch_all_message_ids(db: &PgPool) -> anyhow::Result<Vec<Uuid>> {
}
/// Fetches messages by their IDs. Uses PK index directly.
+#[allow(clippy::disallowed_methods, reason = "legacy code. fix later")]
pub async fn fetch_messages_by_ids(db: &PgPool, ids: &[Uuid]) -> anyhow::Result<Vec<MessageRow>> {
if ids.is_empty() {
return Ok(vec![]);
@@ -136,6 +140,7 @@ pub struct SfsMapping {
/// Looks up original source URLs for multiple SFS destination URLs in a single query.
/// Retries with a 5s timeout per attempt.
+#[allow(clippy::disallowed_methods, reason = "legacy code. fix later")]
pub async fn lookup_source_urls_bulk(
db: &PgPool,
destination_urls: &[String],
@@ -161,6 +166,7 @@ pub async fn lookup_source_urls_bulk(
/// Bulk updates body_html_sanitized for multiple messages in a single query.
/// Retries with a 5s timeout per attempt.
+#[allow(clippy::disallowed_methods, reason = "legacy code. fix later")]
pub async fn bulk_update_message_html(
db: &PgPool,
ids: &[Uuid],
diff --git a/rust/cloud-storage/entity_access/src/outbound/pg_access_repo/queries/call_channel.rs b/rust/cloud-storage/entity_access/src/outbound/pg_access_repo/queries/call_channel.rs
index 6ec6a19321..a595f03dba 100644
--- a/rust/cloud-storage/entity_access/src/outbound/pg_access_repo/queries/call_channel.rs
+++ b/rust/cloud-storage/entity_access/src/outbound/pg_access_repo/queries/call_channel.rs
@@ -16,6 +16,7 @@ pub struct CallChannelRow {
///
/// Checks both active calls and archived call records.
#[tracing::instrument(err, skip(pool))]
+#[allow(clippy::disallowed_methods, reason = "legacy code. fix later")]
pub async fn get_call_channel(
pool: &PgPool,
call_id: &Uuid,
@@ -42,6 +43,7 @@ pub async fn get_call_channel(
/// Checks both active calls and archived call records.
/// Active calls are checked first.
#[tracing::instrument(err, skip(pool))]
+#[allow(clippy::disallowed_methods, reason = "legacy code. fix later")]
pub async fn get_call_channel_by_channel_id(
pool: &PgPool,
channel_id: &Uuid,
diff --git a/rust/cloud-storage/entity_access/src/outbound/pg_access_repo/queries/channel_role.rs b/rust/cloud-storage/entity_access/src/outbound/pg_access_repo/queries/channel_role.rs
index dc552ce68a..d4d58563e8 100644
--- a/rust/cloud-storage/entity_access/src/outbound/pg_access_repo/queries/channel_role.rs
+++ b/rust/cloud-storage/entity_access/src/outbound/pg_access_repo/queries/channel_role.rs
@@ -33,6 +33,7 @@ fn parse_role(s: &str) -> ParticipantRole {
/// - Organization channels: default to Member only if user's org matches
/// - Private/DM: require explicit participation
#[tracing::instrument(err, skip(pool))]
+#[allow(clippy::disallowed_methods, reason = "legacy code. fix later")]
pub async fn get_channel_role(
pool: &PgPool,
channel_id: &Uuid,
diff --git a/rust/cloud-storage/frecency/src/outbound/postgres.rs b/rust/cloud-storage/frecency/src/outbound/postgres.rs
index 5bf7fa4236..706391bbf7 100644
--- a/rust/cloud-storage/frecency/src/outbound/postgres.rs
+++ b/rust/cloud-storage/frecency/src/outbound/postgres.rs
@@ -311,6 +311,7 @@ impl AggregateFrecencyStorage for FrecencyPgStorage {
}
#[tracing::instrument(err, skip(self, entities))]
+ #[allow(clippy::disallowed_methods, reason = "legacy code. fix later")]
async fn get_aggregate_for_user_entities<'a>(
&self,
user_id: MacroUserIdStr<'a>,
diff --git a/rust/cloud-storage/justfile b/rust/cloud-storage/justfile
index 8e0addfcf1..9f7fe67a03 100644
--- a/rust/cloud-storage/justfile
+++ b/rust/cloud-storage/justfile
@@ -6,7 +6,7 @@ check:
RUSTFLAGS=-Dwarnings RUSTDOCFLAGS=-Dwarnings CARGO_TERM_COLOR=always SQLX_OFFLINE=true cargo check
clippy:
- RUSTFLAGS=-Dwarnings RUSTDOCFLAGS=-Dwarnings CARGO_TERM_COLOR=always SQLX_OFFLINE=true cargo clippy
+ RUSTFLAGS="-Dwarnings -Dclippy::disallowed_methods" RUSTDOCFLAGS=-Dwarnings CARGO_TERM_COLOR=always SQLX_OFFLINE=true cargo clippy --workspace --all-features
# This can be used in any crate that uses macrodb under the hood
[no-cd]
diff --git a/rust/cloud-storage/macro_db_client/src/activity/get_recent_activities.rs b/rust/cloud-storage/macro_db_client/src/activity/get_recent_activities.rs
index b10d43f522..f71007aa66 100644
--- a/rust/cloud-storage/macro_db_client/src/activity/get_recent_activities.rs
+++ b/rust/cloud-storage/macro_db_client/src/activity/get_recent_activities.rs
@@ -9,6 +9,7 @@ use sqlx::{Pool, Postgres, Row};
use system_properties::{StatusOption, SystemPropertyKey};
#[tracing::instrument(skip(db))]
+#[allow(clippy::disallowed_methods, reason = "legacy code. fix later")]
pub async fn get_recent_activities(
db: Pool<Postgres>,
user_id: &str,
diff --git a/rust/cloud-storage/macro_db_client/src/chat_history/mod.rs b/rust/cloud-storage/macro_db_client/src/chat_history/mod.rs
index 1d23a4ffea..b053c13e4d 100644
--- a/rust/cloud-storage/macro_db_client/src/chat_history/mod.rs
+++ b/rust/cloud-storage/macro_db_client/src/chat_history/mod.rs
@@ -14,6 +14,7 @@ struct ChatHistoryRow {
}
/// Get chat history for a single chat by ID
+#[allow(clippy::disallowed_methods, reason = "legacy code. fix later")]
pub async fn get_chat_history<'e, E>(db: E, chat_id: &str) -> Result<ChatHistory, Error>
where
E: Executor<'e, Database = Postgres>,
@@ -41,6 +42,7 @@ where
}
/// Get chat history for messages by their IDs
+#[allow(clippy::disallowed_methods, reason = "legacy code. fix later")]
pub async fn get_chat_history_for_messages<'e, E>(
db: E,
message_ids: &[String],
diff --git a/rust/cloud-storage/macro_db_client/src/document/get_user_documents.rs b/rust/cloud-storage/macro_db_client/src/document/get_user_documents.rs
index 62562d554a..13bf6c9f1c 100644
--- a/rust/cloud-storage/macro_db_client/src/document/get_user_documents.rs
+++ b/rust/cloud-storage/macro_db_client/src/document/get_user_documents.rs
@@ -50,6 +50,7 @@ pub async fn get_user_document_ids(
}
#[tracing::instrument(skip(db))]
+#[allow(clippy::disallowed_methods, reason = "legacy code. fix later")]
pub async fn get_user_documents(
db: &Pool<Postgres>,
user_id: &str,
diff --git a/rust/cloud-storage/macro_db_client/src/document/initialize_onboarding_documents.rs b/rust/cloud-storage/macro_db_client/src/document/initialize_onboarding_documents.rs
index 5aaf979902..283bb2941e 100644
--- a/rust/cloud-storage/macro_db_client/src/document/initialize_onboarding_documents.rs
+++ b/rust/cloud-storage/macro_db_client/src/document/initialize_onboarding_documents.rs
@@ -55,6 +55,7 @@ pub async fn create_project_transaction(
/// Creates documents under a project
/// This does not include creating the docx file as that requires special handling
#[tracing::instrument(skip(transaction, document_names))]
+#[allow(clippy::disallowed_methods, reason = "legacy code. fix later")]
pub async fn create_onboarding_documents(
transaction: &mut Transaction<'_, Postgres>,
user_id: MacroUserIdStr<'static>,
diff --git a/rust/cloud-storage/macro_db_client/src/document/save_document.rs b/rust/cloud-storage/macro_db_client/src/document/save_document.rs
index 1704717ab1..79d806047c 100644
--- a/rust/cloud-storage/macro_db_client/src/document/save_document.rs
+++ b/rust/cloud-storage/macro_db_client/src/document/save_document.rs
@@ -371,6 +371,7 @@ DELETE FROM "PdfHighlightAnchor" WHERE "documentId" = $1;
Ok(())
}
+#[allow(clippy::disallowed_methods, reason = "legacy code. fix later")]
pub async fn try_insert_comment_data(
transaction: &mut Transaction<'_, Postgres>,
document: &DocumentBasic,
@@ -405,6 +406,7 @@ pub async fn try_insert_comment_data(
/// Inserts the bom parts into the database for a docx document
#[tracing::instrument(skip(transaction, document_bom_parts))]
+#[allow(clippy::disallowed_methods, reason = "legacy code. fix later")]
pub async fn insert_bom_parts(
transaction: &mut Transaction<'_, Postgres>,
document_id: &str,
diff --git a/rust/cloud-storage/macro_db_client/src/docx_unzip/mod.rs b/rust/cloud-storage/macro_db_client/src/docx_unzip/mod.rs
index f6ef5dee8f..73800e1f0e 100644
--- a/rust/cloud-storage/macro_db_client/src/docx_unzip/mod.rs
+++ b/rust/cloud-storage/macro_db_client/src/docx_unzip/mod.rs
@@ -2,6 +2,7 @@ use model::document::{BomPart, SaveBomPart};
/// Saves the bom parts to the db under the documents bom id
#[tracing::instrument(skip(db, bom_parts))]
+#[allow(clippy::disallowed_methods, reason = "legacy code. fix later")]
pub async fn save_bom_parts_to_db(
db: &sqlx::Pool<sqlx::Postgres>,
bom_parts: &[SaveBomPart],
@@ -36,6 +37,7 @@ pub async fn save_bom_parts_to_db(
/// Updates the `uploaded` status of the document to be true.
#[tracing::instrument(skip(db))]
+#[allow(clippy::disallowed_methods, reason = "legacy code. fix later")]
pub async fn update_uploaded_status(
db: &sqlx::Pool<sqlx::Postgres>,
document_id: &str,
diff --git a/rust/cloud-storage/macro_db_client/src/pins/mod.rs b/rust/cloud-storage/macro_db_client/src/pins/mod.rs
index e30cfa3118..3a8c624d13 100644
--- a/rust/cloud-storage/macro_db_client/src/pins/mod.rs
+++ b/rust/cloud-storage/macro_db_client/src/pins/mod.rs
@@ -296,6 +296,7 @@ pub async fn remove_pin_by_pinned_item_id(
}
#[tracing::instrument(skip(db))]
+#[allow(clippy::disallowed_methods, reason = "legacy code. fix later")]
pub async fn reorder_pins(
db: Pool<Postgres>,
user_id: &str,
diff --git a/rust/cloud-storage/macro_db_client/src/projects/edit_project.rs b/rust/cloud-storage/macro_db_client/src/projects/edit_project.rs
index 24dee11910..8ee97fb3dd 100644
--- a/rust/cloud-storage/macro_db_client/src/projects/edit_project.rs
+++ b/rust/cloud-storage/macro_db_client/src/projects/edit_project.rs
@@ -18,6 +18,7 @@ pub async fn update_project_modified_date(
}
#[tracing::instrument(skip(transaction))]
+#[allow(clippy::disallowed_methods, reason = "legacy code. fix later")]
pub async fn edit_project_v2(
transaction: &mut sqlx::Transaction<'_, Postgres>,
user_id: &str,
diff --git a/rust/cloud-storage/macro_db_client/src/share_permission/channel_permission/create.rs b/rust/cloud-storage/macro_db_client/src/share_permission/channel_permission/create.rs
index cba0340676..2fbafb0e22 100644
--- a/rust/cloud-storage/macro_db_client/src/share_permission/channel_permission/create.rs
+++ b/rust/cloud-storage/macro_db_client/src/share_permission/channel_permission/create.rs
@@ -5,6 +5,7 @@ use sqlx::{Executor, Postgres, Transaction};
use super::ChannelSharePermissionParamaters;
#[tracing::instrument(skip(transaction, channel_share_permissions))]
+#[allow(clippy::disallowed_methods, reason = "legacy code. fix later")]
pub async fn create_channel_share_permissions(
transaction: &mut Transaction<'_, Postgres>,
share_permission_id: &str,
diff --git a/rust/cloud-storage/macro_db_client/src/share_permission/edit.rs b/rust/cloud-storage/macro_db_client/src/share_permission/edit.rs
index 763853f34c..fe50321ca2 100644
--- a/rust/cloud-storage/macro_db_client/src/share_permission/edit.rs
+++ b/rust/cloud-storage/macro_db_client/src/share_permission/edit.rs
@@ -6,6 +6,7 @@ use sqlx::{Postgres, Transaction};
use super::channel_permission::edit::edit_channel_share_permission;
#[tracing::instrument(skip(transaction))]
+#[allow(clippy::disallowed_methods, reason = "legacy code. fix later")]
pub async fn edit_share_permission(
transaction: &mut Transaction<'_, Postgres>,
entity_id: &uuid::Uuid,
diff --git a/rust/cloud-storage/properties/src/outbound/entity_property_queries.rs b/rust/cloud-storage/properties/src/outbound/entity_property_queries.rs
index 8cdeea0cad..bb4d211ffe 100644
--- a/rust/cloud-storage/properties/src/outbound/entity_property_queries.rs
+++ b/rust/cloud-storage/properties/src/outbound/entity_property_queries.rs
@@ -94,6 +94,7 @@ pub async fn upsert_entity_property(
}
/// Counts how many of the provided option IDs exist for the property definition.
+#[allow(clippy::disallowed_methods, reason = "legacy code. fix later")]
pub async fn count_valid_property_options(
pool: &Pool<Postgres>,
property_definition_id: Uuid,
diff --git a/rust/cloud-storage/properties_db_client/src/property_options/get.rs b/rust/cloud-storage/properties_db_client/src/property_options/get.rs
index 745d55e181..6fe918d060 100644
--- a/rust/cloud-storage/properties_db_client/src/property_options/get.rs
+++ b/rust/cloud-storage/properties_db_client/src/property_options/get.rs
@@ -11,6 +11,7 @@ type Result<T> = std::result::Result<T, PropertiesDatabaseError>;
/// Gets a single property option by ID.
#[tracing::instrument(skip(db))]
+#[allow(clippy::disallowed_methods, reason = "legacy code. fix later")]
pub async fn get_property_option_by_id(
db: &Pool<Postgres>,
option_id: uuid::Uuid,
@@ -38,6 +39,7 @@ pub async fn get_property_option_by_id(
/// Gets all property options for a property definition.
#[tracing::instrument(skip(db))]
+#[allow(clippy::disallowed_methods, reason = "legacy code. fix later")]
pub async fn get_property_options(
db: &Pool<Postgres>,
property_definition_id: uuid::Uuid,
@@ -68,6 +70,7 @@ pub async fn get_property_options(
/// Counts property options by their IDs.
#[tracing::instrument(skip(db))]
+#[allow(clippy::disallowed_methods, reason = "legacy code. fix later")]
pub async fn count_property_options_by_ids(
db: &Pool<Postgres>,
property_definition_id: uuid::Uuid,
@@ -92,6 +95,7 @@ pub async fn count_property_options_by_ids(
/// Gets property options for multiple properties in a single query.
/// Returns a HashMap where the key is property_definition_id and value is the list of options.
#[tracing::instrument(skip(db))]
+#[allow(clippy::disallowed_methods, reason = "legacy code. fix later")]
pub async fn get_property_options_batch(
db: &Pool<Postgres>,
property_definition_ids: &[Uuid],
diff --git a/rust/cloud-storage/seed_cli/src/service/db/mod.rs b/rust/cloud-storage/seed_cli/src/service/db/mod.rs
index c8c879b588..ebf2577567 100644
--- a/rust/cloud-storage/seed_cli/src/service/db/mod.rs
+++ b/rust/cloud-storage/seed_cli/src/service/db/mod.rs
@@ -37,6 +37,7 @@ impl SeedDb {
/// Execute a semicolon-delimited SQL script inside a transaction.
#[tracing::instrument(skip(self, sql), err)]
+ #[allow(clippy::disallowed_methods, reason = "legacy code. fix later")]
pub async fn execute_sql_script(&self, sql: &str) -> anyhow::Result<()> {
let mut transaction = self.inner.begin().await?;
@@ -50,6 +51,7 @@ impl SeedDb {
/// Execute SQL only when the table exists in the current database.
#[tracing::instrument(skip(self, sql), err)]
+ #[allow(clippy::disallowed_methods, reason = "legacy code. fix later")]
pub async fn execute_sql_if_table_exists(
&self,
table_name: &str,
diff --git a/rust/cloud-storage/stream/src/outbound/redis_pg/queries/mod.rs b/rust/cloud-storage/stream/src/outbound/redis_pg/queries/mod.rs
index 6da0d3bed5..cd8ab4920c 100644
--- a/rust/cloud-storage/stream/src/outbound/redis_pg/queries/mod.rs
+++ b/rust/cloud-storage/stream/src/outbound/redis_pg/queries/mod.rs
@@ -6,6 +6,7 @@ use sqlx::PgPool;
/// Insert a new active stream entry, ignoring conflicts.
#[tracing::instrument(err, skip(pool))]
+#[allow(clippy::disallowed_methods, reason = "legacy code. fix later")]
pub(crate) async fn insert_active_stream(
pool: &PgPool,
stream_id: &StreamId,
@@ -22,6 +23,7 @@ pub(crate) async fn insert_active_stream(
/// Delete an active stream entry.
#[tracing::instrument(err, skip(pool))]
+#[allow(clippy::disallowed_methods, reason = "legacy code. fix later")]
pub(crate) async fn delete_active_stream(
pool: &PgPool,
stream_id: &StreamId,
@@ -35,6 +37,7 @@ pub(crate) async fn delete_active_stream(
}
/// Get all stream keys for a given entity.
+#[allow(clippy::disallowed_methods, reason = "legacy code. fix later")]
pub(crate) async fn get_active_stream_keys(
pool: &PgPool,
entity_id: &str,
diff --git a/rust/cloud-storage/teams/src/outbound/team_repo.rs b/rust/cloud-storage/teams/src/outbound/team_repo.rs
index 023bc63104..4fdb29d7df 100644
--- a/rust/cloud-storage/teams/src/outbound/team_repo.rs
+++ b/rust/cloud-storage/teams/src/outbound/team_repo.rs
@@ -277,6 +277,7 @@ impl TeamRepository for TeamRepositoryImpl {
}
#[tracing::instrument(skip(self), err)]
+ #[allow(clippy::disallowed_methods, reason = "legacy code. fix later")]
async fn has_user_trialed(&self, user_id: &MacroUserIdStr<'_>) -> Result<bool, TeamError> {
let has_trialed = sqlx::query_scalar::<_, bool>(
r#"
@@ -519,6 +520,7 @@ impl TeamRepository for TeamRepositoryImpl {
}
#[tracing::instrument(skip(self), err)]
+ #[allow(clippy::disallowed_methods, reason = "legacy code. fix later")]
async fn remove_user_from_team(
&self,
team_id: &uuid::Uuid,
@@ -727,6 +729,7 @@ impl TeamRepository for TeamRepositoryImpl {
}
#[tracing::instrument(skip(self), err)]
+ #[allow(clippy::disallowed_methods, reason = "legacy code. fix later")]
async fn accept_team_invite(
&self,
team_invite_id: &uuid::Uuid,
@@ -819,6 +822,7 @@ impl TeamRepository for TeamRepositoryImpl {
}
#[tracing::instrument(skip(self), err)]
+ #[allow(clippy::disallowed_methods, reason = "legacy code. fix later")]
async fn rollback_accept_team_invite(
&self,
accepted_invite: &AcceptedTeamInvite<'_>,
@@ -869,6 +873,7 @@ impl TeamRepository for TeamRepositoryImpl {
}
#[tracing::instrument(skip(self), err)]
+ #[allow(clippy::disallowed_methods, reason = "legacy code. fix later")]
async fn rollback_remove_user_from_team(
&self,
removed_member: &TeamMember<'_>,
@@ -1167,6 +1172,7 @@ impl TeamRepository for TeamRepositoryImpl {
}
#[tracing::instrument(skip(self), err)]
+ #[allow(clippy::disallowed_methods, reason = "legacy code. fix later")]
async fn patch_team(
&self,
team_id: &uuid::Uuid,