Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion lib/api_server/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ schemars = { workspace = true, optional = true }
serde = { workspace = true, optional = true }
serde_json.workspace = true
slog.workspace = true
tokio = { workspace = true, features = ["fs"] }

[dev-dependencies]
bencher_api_tests.workspace = true
Expand Down
4 changes: 2 additions & 2 deletions lib/api_server/src/backup.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use bencher_endpoint::{CorsResponse, Endpoint, Post, ResponseCreated};
use bencher_json::{JsonBackup, JsonBackupCreated, JsonRestart};
use bencher_json::{JsonBackup, JsonBackupCreated};
use bencher_schema::{
context::ApiContext,
error::bad_request_error,
Expand All @@ -17,7 +17,7 @@ use dropshot::{HttpError, RequestContext, TypedBody, endpoint};
}]
pub async fn server_backup_options(
_rqctx: RequestContext<ApiContext>,
_body: TypedBody<JsonRestart>,
_body: TypedBody<JsonBackup>,
) -> Result<CorsResponse, HttpError> {
Ok(Endpoint::cors(&[Post.into()]))
}
Expand Down
5 changes: 2 additions & 3 deletions lib/api_server/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@
use bencher_api_tests as _;
#[cfg(test)]
use http as _;
#[cfg(test)]
use tokio as _;

mod backup;
mod config;
mod restart;
mod root;
mod spec;
mod stats;
Expand All @@ -32,14 +33,12 @@ impl bencher_endpoint::Registrar for Api {
if http_options {
api_description.register(version::server_version_options)?;
api_description.register(spec::server_spec_options)?;
api_description.register(restart::server_restart_options)?;
api_description.register(config::server_config_options)?;
api_description.register(config::server_config_console_options)?;
api_description.register(backup::server_backup_options)?;
}
api_description.register(version::server_version_get)?;
api_description.register(spec::server_spec_get)?;
api_description.register(restart::server_restart_post)?;
api_description.register(config::server_config_get)?;
api_description.register(config::server_config_console_get)?;
api_description.register(backup::server_backup_post)?;
Expand Down
83 changes: 0 additions & 83 deletions lib/api_server/src/restart.rs

This file was deleted.

83 changes: 0 additions & 83 deletions lib/api_server/tests/restart.rs

This file was deleted.

6 changes: 1 addition & 5 deletions lib/bencher_api_tests/src/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ use diesel::{
};
use dropshot::{ApiDescription, ConfigDropshot, ConfigLogging, ConfigLoggingLevel, HttpServer};
use tempfile::NamedTempFile;
use tokio::sync::{Mutex, mpsc};
use tokio::sync::Mutex;

const ISSUER: &str = "http://localhost:3000";

Expand Down Expand Up @@ -95,7 +95,6 @@ impl TestServer {
// Build minimal ApiContext
let token_key = TokenKey::new(ISSUER.to_owned(), &DEFAULT_SECRET_KEY);
let rbac = init_rbac().expect("Failed to init RBAC").into();
let (restart_tx, _restart_rx) = mpsc::channel(1);

let database = Database {
path: PathBuf::from(&db_path),
Expand All @@ -116,7 +115,6 @@ impl TestServer {
rbac,
messenger: Messenger::default(),
database,
restart_tx,
rate_limiting: bencher_schema::context::RateLimiting::max(),
github_client: None,
google_client: None,
Expand Down Expand Up @@ -182,7 +180,6 @@ impl TestServer {
// Build minimal ApiContext
let token_key = TokenKey::new(ISSUER.to_owned(), &DEFAULT_SECRET_KEY);
let rbac = init_rbac().expect("Failed to init RBAC").into();
let (restart_tx, _restart_rx) = mpsc::channel(1);

let database = Database {
path: PathBuf::from(&db_path),
Expand All @@ -201,7 +198,6 @@ impl TestServer {
rbac,
messenger: Messenger::default(),
database,
restart_tx,
clock: bencher_json::Clock::System,
};

Expand Down
8 changes: 1 addition & 7 deletions lib/bencher_config/src/config_tx.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ use dropshot::{
ConfigTls, HttpServer,
};
use slog::{Logger, debug, error, info};
use tokio::sync::mpsc::Sender;

#[cfg(feature = "plus")]
use super::plus::Plus;
Expand All @@ -52,7 +51,6 @@ const SQLITE_TMPDIR: &str = "SQLITE_TMPDIR";

pub struct ConfigTx {
pub config: Config,
pub restart_tx: Sender<()>,
}

#[derive(Debug, thiserror::Error)]
Expand Down Expand Up @@ -106,7 +104,7 @@ impl ConfigTx {
where
R: Registrar,
{
let ConfigTx { config, restart_tx } = self;
let ConfigTx { config } = self;

let Config(JsonConfig {
console,
Expand All @@ -129,7 +127,6 @@ impl ConfigTx {
request_body_max_bytes,
smtp,
database,
restart_tx,
#[cfg(feature = "plus")]
plus,
)
Expand Down Expand Up @@ -176,7 +173,6 @@ impl ConfigTx {
}

#[expect(
clippy::too_many_arguments,
clippy::too_many_lines,
reason = "Context initialization needs to handle DB setup, PRAGMAs, migrations, and pool creation"
)]
Expand All @@ -187,7 +183,6 @@ async fn into_context(
request_body_max_bytes: usize,
smtp: Option<JsonSmtp>,
json_database: JsonDatabase,
restart_tx: Sender<()>,
#[cfg(feature = "plus")] plus: Option<JsonPlus>,
) -> Result<ApiContext, ConfigTxError> {
let console_url: url::Url = console.url.try_into().map_err(ConfigTxError::Endpoint)?;
Expand Down Expand Up @@ -313,7 +308,6 @@ async fn into_context(
rbac,
messenger: smtp.into(),
database,
restart_tx,
#[cfg(feature = "plus")]
rate_limiting,
#[cfg(feature = "plus")]
Expand Down
1 change: 0 additions & 1 deletion lib/bencher_json/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,6 @@ pub use system::{
auth::{JsonAccept, JsonAuthAck, JsonAuthUser, JsonConfirm, JsonLogin, JsonSignup},
backup::{JsonBackup, JsonBackupCreated},
config::{JsonConfig, JsonConsole},
restart::JsonRestart,
spec::JsonOpenApiSpec,
version::JsonApiVersion,
};
Expand Down
1 change: 0 additions & 1 deletion lib/bencher_json/src/system/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ pub mod auth;
pub mod backup;
pub mod config;
pub mod payment;
pub mod restart;
pub mod server;
pub mod spec;
pub mod version;
11 changes: 0 additions & 11 deletions lib/bencher_json/src/system/restart.rs

This file was deleted.

2 changes: 0 additions & 2 deletions lib/bencher_schema/src/context/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ use bencher_oci_storage::OciStorage;
use bencher_token::TokenKey;
#[cfg(feature = "plus")]
use dropshot::HttpError;
use tokio::sync::mpsc::Sender;
use url::Url;

#[cfg(feature = "plus")]
Expand Down Expand Up @@ -52,7 +51,6 @@ pub struct ApiContext {
pub rbac: Rbac,
pub messenger: Messenger,
pub database: Database,
pub restart_tx: Sender<()>,
#[cfg(feature = "plus")]
pub rate_limiting: RateLimiting,
#[cfg(feature = "plus")]
Expand Down
2 changes: 2 additions & 0 deletions services/api/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@ bencher_schema.workspace = true
bencher_otel = { workspace = true, optional = true }
bencher_otel_provider = { workspace = true, optional = true }
dropshot.workspace = true
futures-concurrency.workspace = true
futures-util.workspace = true
libsqlite3-sys.workspace = true
sentry = { workspace = true, optional = true }
serde_yaml.workspace = true
Expand Down
Loading
Loading