From fc83fcd490ace806faf1429db5ad767adf16a56f Mon Sep 17 00:00:00 2001 From: Brandon Thomas Date: Mon, 17 Jun 2024 22:25:19 -0400 Subject: [PATCH] further cleanup --- Cargo.lock | 8 ++------ crates/cli/production/db-backup/Cargo.toml | 3 +-- crates/cli/production/db-backup/src/main.rs | 2 +- crates/cli/production/db-cleanup/Cargo.toml | 1 - crates/cli/production/db-cleanup/src/main.rs | 2 +- crates/lib/jobs_common/Cargo.toml | 1 - .../src/job_progress_reporter/job_progress_reporter.rs | 2 +- .../job_progress_reporter/noop_job_progress_reporter.rs | 2 +- .../job_progress_reporter/redis_job_progress_reporter.rs | 2 +- crates/lib/jobs_common/src/redis_job_status_logger.rs | 2 +- crates/lib/jobs_common/src/semi_persistent_cache_dir.rs | 2 +- crates/service/job/analytics_job/Cargo.toml | 1 - crates/service/job/es-update-job/Cargo.toml | 1 - crates/service/plugins/billing/Cargo.toml | 2 +- .../stripe/helpers/verify_stripe_webhook_ip_address.rs | 2 +- .../customer_subscription/subscription_event_extractor.rs | 2 +- .../invoice/invoice_paid_handler.rs | 5 ++--- 17 files changed, 15 insertions(+), 25 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 34195af920..bdb393b396 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -415,7 +415,6 @@ dependencies = [ "anyhow", "chrono", "config", - "container_common", "dotenv", "easyenv", "enums", @@ -869,8 +868,8 @@ dependencies = [ "async-trait", "base64 0.22.1", "chrono", - "container_common", "dotenv", + "errors", "http_server_common", "log", "mockall", @@ -1757,9 +1756,9 @@ name = "db-backup" version = "0.0.1" dependencies = [ "anyhow", - "container_common", "dotenv", "easyenv", + "errors", "log", "my-workspace-hack", "serde", @@ -1772,7 +1771,6 @@ version = "0.0.1" dependencies = [ "buckets", "clap", - "container_common", "dotenv", "easyenv", "enums", @@ -2355,7 +2353,6 @@ dependencies = [ "bootstrap", "chrono", "config", - "container_common", "dotenv", "easyenv", "elasticsearch", @@ -3616,7 +3613,6 @@ version = "0.0.1" dependencies = [ "anyhow", "chrono", - "container_common", "errors", "log", "my-workspace-hack", diff --git a/crates/cli/production/db-backup/Cargo.toml b/crates/cli/production/db-backup/Cargo.toml index 6a3cf06f64..5ea4ee3d44 100644 --- a/crates/cli/production/db-backup/Cargo.toml +++ b/crates/cli/production/db-backup/Cargo.toml @@ -16,10 +16,9 @@ path = "src/main.rs" normal = ["my-workspace-hack"] [dependencies] - # Internal -container_common = { path = "../../../lib/deprecated/container_common" } easyenv = { path = "../../../lib/easyenv" } +errors = { path = "../../../lib/errors" } # Workspace hack (faster compile times) my-workspace-hack = { version = "0.1", path = "../../../my-workspace-hack" } diff --git a/crates/cli/production/db-backup/src/main.rs b/crates/cli/production/db-backup/src/main.rs index 6dbab946fe..cff06bcbf6 100644 --- a/crates/cli/production/db-backup/src/main.rs +++ b/crates/cli/production/db-backup/src/main.rs @@ -1,7 +1,7 @@ use log::info; -use container_common::anyhow_result::AnyhowResult; use easyenv::init_all_with_default_logging; +use errors::AnyhowResult; fn main() -> AnyhowResult<()> { init_all_with_default_logging(None); diff --git a/crates/cli/production/db-cleanup/Cargo.toml b/crates/cli/production/db-cleanup/Cargo.toml index 96bcf783fa..bc6370fb31 100644 --- a/crates/cli/production/db-cleanup/Cargo.toml +++ b/crates/cli/production/db-cleanup/Cargo.toml @@ -18,7 +18,6 @@ normal = ["my-workspace-hack"] [dependencies] # Internal buckets = { path = "../../../_types/buckets" } -container_common = { path = "../../../lib/deprecated/container_common" } easyenv = { path = "../../../lib/easyenv" } enums = { path = "../../../_types/enums" } errors = { path = "../../../lib/errors" } diff --git a/crates/cli/production/db-cleanup/src/main.rs b/crates/cli/production/db-cleanup/src/main.rs index 73b12466e2..aa27839322 100644 --- a/crates/cli/production/db-cleanup/src/main.rs +++ b/crates/cli/production/db-cleanup/src/main.rs @@ -2,8 +2,8 @@ use log::info; use sqlx::{MySql, Pool}; use sqlx::mysql::MySqlPoolOptions; -use container_common::anyhow_result::AnyhowResult; use easyenv::init_all_with_default_logging; +use errors::AnyhowResult; use crate::cli_args::Action; use crate::operations::delete_all_anonymous_user_images::delete_all_anonymous_user_images::delete_all_anonymous_user_images; diff --git a/crates/lib/jobs_common/Cargo.toml b/crates/lib/jobs_common/Cargo.toml index 8dc887ca8b..8ecaffc846 100644 --- a/crates/lib/jobs_common/Cargo.toml +++ b/crates/lib/jobs_common/Cargo.toml @@ -21,7 +21,6 @@ normal = ["my-workspace-hack"] [dependencies] # Internal -container_common = { path = "../deprecated/container_common" } errors = { path = "../errors" } redis_common = { path = "../redis_common" } diff --git a/crates/lib/jobs_common/src/job_progress_reporter/job_progress_reporter.rs b/crates/lib/jobs_common/src/job_progress_reporter/job_progress_reporter.rs index 36a030d964..9af7aaed87 100644 --- a/crates/lib/jobs_common/src/job_progress_reporter/job_progress_reporter.rs +++ b/crates/lib/jobs_common/src/job_progress_reporter/job_progress_reporter.rs @@ -1,4 +1,4 @@ -use container_common::anyhow_result::AnyhowResult; +use errors::AnyhowResult; pub trait JobProgressReporterBuilder { // NB: Still learning "Box" vs "impl Trait"; diff --git a/crates/lib/jobs_common/src/job_progress_reporter/noop_job_progress_reporter.rs b/crates/lib/jobs_common/src/job_progress_reporter/noop_job_progress_reporter.rs index c00ffaca1c..5732cc068d 100644 --- a/crates/lib/jobs_common/src/job_progress_reporter/noop_job_progress_reporter.rs +++ b/crates/lib/jobs_common/src/job_progress_reporter/noop_job_progress_reporter.rs @@ -1,4 +1,4 @@ -use container_common::anyhow_result::AnyhowResult; +use errors::AnyhowResult; use crate::job_progress_reporter::job_progress_reporter::{JobProgressReporter, JobProgressReporterBuilder}; diff --git a/crates/lib/jobs_common/src/job_progress_reporter/redis_job_progress_reporter.rs b/crates/lib/jobs_common/src/job_progress_reporter/redis_job_progress_reporter.rs index 7a64c55d28..8bcd4ec087 100644 --- a/crates/lib/jobs_common/src/job_progress_reporter/redis_job_progress_reporter.rs +++ b/crates/lib/jobs_common/src/job_progress_reporter/redis_job_progress_reporter.rs @@ -2,7 +2,7 @@ use r2d2_redis::{r2d2, RedisConnectionManager}; use r2d2_redis::r2d2::PooledConnection; use r2d2_redis::redis::Commands; -use container_common::anyhow_result::AnyhowResult; +use errors::AnyhowResult; use redis_common::redis_keys::RedisKeys; use crate::job_progress_reporter::job_progress_reporter::{JobProgressReporter, JobProgressReporterBuilder}; diff --git a/crates/lib/jobs_common/src/redis_job_status_logger.rs b/crates/lib/jobs_common/src/redis_job_status_logger.rs index 40688dcbd9..8d07e90440 100644 --- a/crates/lib/jobs_common/src/redis_job_status_logger.rs +++ b/crates/lib/jobs_common/src/redis_job_status_logger.rs @@ -2,7 +2,7 @@ use r2d2_redis::r2d2::PooledConnection; use r2d2_redis::redis::Commands; use r2d2_redis::RedisConnectionManager; -use container_common::anyhow_result::AnyhowResult; +use errors::AnyhowResult; use redis_common::redis_keys::RedisKeys; #[deprecated(note="Use JobProgressReporterBuilder")] diff --git a/crates/lib/jobs_common/src/semi_persistent_cache_dir.rs b/crates/lib/jobs_common/src/semi_persistent_cache_dir.rs index 176e4f1949..0646bf640b 100644 --- a/crates/lib/jobs_common/src/semi_persistent_cache_dir.rs +++ b/crates/lib/jobs_common/src/semi_persistent_cache_dir.rs @@ -1,7 +1,7 @@ use std::fs; use std::path::{Path, PathBuf}; -use container_common::anyhow_result::AnyhowResult; +use errors::AnyhowResult; /// These are for files on the worker filesystems pub struct SemiPersistentCacheDir { diff --git a/crates/service/job/analytics_job/Cargo.toml b/crates/service/job/analytics_job/Cargo.toml index c0e122f84b..f2caeb34d8 100644 --- a/crates/service/job/analytics_job/Cargo.toml +++ b/crates/service/job/analytics_job/Cargo.toml @@ -19,7 +19,6 @@ normal = ["my-workspace-hack"] # Internal config = { path = "../../../lib/deprecated/config" } -container_common = { path = "../../../lib/deprecated/container_common" } easyenv = { path = "../../../lib/easyenv" } enums = { path = "../../../_types/enums" } errors = { path = "../../../lib/errors" } diff --git a/crates/service/job/es-update-job/Cargo.toml b/crates/service/job/es-update-job/Cargo.toml index d47062c1e6..0bf53bb615 100644 --- a/crates/service/job/es-update-job/Cargo.toml +++ b/crates/service/job/es-update-job/Cargo.toml @@ -20,7 +20,6 @@ normal = ["my-workspace-hack"] # Internal bootstrap = { path = "../../../lib/bootstrap" } config = { path = "../../../lib/deprecated/config" } -container_common = { path = "../../../lib/deprecated/container_common" } easyenv = { path = "../../../lib/easyenv" } elasticsearch_schema = { path = "../../../lib/elasticsearch_schema" } enums = { path = "../../../_types/enums" } diff --git a/crates/service/plugins/billing/Cargo.toml b/crates/service/plugins/billing/Cargo.toml index faafccc56e..a0a0f94113 100644 --- a/crates/service/plugins/billing/Cargo.toml +++ b/crates/service/plugins/billing/Cargo.toml @@ -18,7 +18,7 @@ normal = ["my-workspace-hack"] [dependencies] # Internal -container_common = { path = "../../../lib/deprecated/container_common" } +errors = { path = "../../../lib/errors" } http_server_common = { path = "../../../lib/deprecated/http_server_common" } mysql_queries = { path = "../../../lib/mysql_queries" } reusable_types = { path = "../../../_types/reusable_types" } diff --git a/crates/service/plugins/billing/src/stripe/helpers/verify_stripe_webhook_ip_address.rs b/crates/service/plugins/billing/src/stripe/helpers/verify_stripe_webhook_ip_address.rs index e06f6dbe33..ab054efa91 100644 --- a/crates/service/plugins/billing/src/stripe/helpers/verify_stripe_webhook_ip_address.rs +++ b/crates/service/plugins/billing/src/stripe/helpers/verify_stripe_webhook_ip_address.rs @@ -3,8 +3,8 @@ use std::collections::HashSet; use actix_web::HttpRequest; use anyhow::anyhow; use once_cell::sync::Lazy; +use errors::AnyhowResult; -use container_common::anyhow_result::AnyhowResult; use http_server_common::request::get_request_ip::get_request_ip; /// List of IP addresses that send webhook requests diff --git a/crates/service/plugins/billing/src/stripe/http_endpoints/webhook/webhook_event_handlers/customer_subscription/subscription_event_extractor.rs b/crates/service/plugins/billing/src/stripe/http_endpoints/webhook/webhook_event_handlers/customer_subscription/subscription_event_extractor.rs index fecfcd3102..c801932743 100644 --- a/crates/service/plugins/billing/src/stripe/http_endpoints/webhook/webhook_event_handlers/customer_subscription/subscription_event_extractor.rs +++ b/crates/service/plugins/billing/src/stripe/http_endpoints/webhook/webhook_event_handlers/customer_subscription/subscription_event_extractor.rs @@ -3,7 +3,7 @@ use chrono::NaiveDateTime; use log::error; use stripe::{Subscription, SubscriptionStatus}; -use container_common::anyhow_result::AnyhowResult; +use errors::AnyhowResult; use reusable_types::stripe::stripe_recurring_interval::StripeRecurringInterval; use reusable_types::stripe::stripe_subscription_status::StripeSubscriptionStatus; diff --git a/crates/service/plugins/billing/src/stripe/http_endpoints/webhook/webhook_event_handlers/invoice/invoice_paid_handler.rs b/crates/service/plugins/billing/src/stripe/http_endpoints/webhook/webhook_event_handlers/invoice/invoice_paid_handler.rs index e39788b897..2aba0ec874 100644 --- a/crates/service/plugins/billing/src/stripe/http_endpoints/webhook/webhook_event_handlers/invoice/invoice_paid_handler.rs +++ b/crates/service/plugins/billing/src/stripe/http_endpoints/webhook/webhook_event_handlers/invoice/invoice_paid_handler.rs @@ -2,7 +2,7 @@ use chrono::{DateTime, Utc}; use log::error; use stripe::{Invoice, InvoiceLineItemType, InvoiceStatus, SubscriptionInterval}; -use container_common::anyhow_result::AnyhowResult; +use errors::AnyhowResult; use crate::stripe::helpers::common_metadata_keys::METADATA_USER_TOKEN; use crate::stripe::helpers::expand_customer_id::expand_customer_id; @@ -157,8 +157,7 @@ fn invoice_paid_extractor(invoice: &Invoice) -> AnyhowResult