Skip to content

Commit cf360bb

Browse files
committed
Redo all the damn work I did before that renovate undid
1 parent f2add17 commit cf360bb

20 files changed

+250
-137
lines changed

Cargo.lock

+222-121
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

+1
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ ringbuffer = "0.15.0"
8383
rusqlite = { version = "0.32" }
8484
rustls-pemfile = { version = "1.0.4" }
8585
schemars = { version = "0.8", features = [ "chrono", "uuid1" ] }
86+
semver = "1"
8687
serde = { version = "1", features = [ "derive" ] }
8788
serde_json = "1"
8889
sha2 = "0.10"

agent/Cargo.toml

+1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ http.workspace = true
1616
hyper.workspace = true
1717
omicron-common.workspace = true
1818
schemars.workspace = true
19+
semver.workspace = true
1920
serde.workspace = true
2021
serde_json.workspace = true
2122
slog.workspace = true

agent/src/main.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ use anyhow::{anyhow, bail, Result};
44
use clap::Parser;
55
use dropshot::{ConfigLogging, ConfigLoggingIfExists, ConfigLoggingLevel};
66
use slog::{debug, error, info, o, Logger};
7+
use semver::Version;
78
use std::collections::HashSet;
89
use std::io::Write;
910
use std::net::SocketAddr;
@@ -341,7 +342,7 @@ async fn main() -> Result<()> {
341342

342343
fn write_openapi<W: Write>(f: &mut W) -> Result<()> {
343344
let api = server::make_api()?;
344-
api.openapi("Crucible Agent", "0.0.0").write(f)?;
345+
api.openapi("Crucible Agent", Version::new(0, 0, 1)).write(f)?;
345346
Ok(())
346347
}
347348

agent/src/server.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,7 @@ pub async fn run_server(
352352
let server = dropshot::HttpServerStarter::new(
353353
&dropshot::ConfigDropshot {
354354
bind_address,
355-
request_body_max_bytes: 1024 * 10,
355+
default_request_body_max_bytes: 1024 * 10,
356356
default_handler_task_mode: HandlerTaskMode::Detached,
357357
log_headers: vec![],
358358
},

downstairs/Cargo.toml

+1
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ reqwest.workspace = true
3737
ringbuffer.workspace = true
3838
rusqlite.workspace = true
3939
schemars.workspace = true
40+
semver.workspace = true
4041
serde.workspace = true
4142
serde_json.workspace = true
4243
sha2.workspace = true

downstairs/src/repair.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ use dropshot::RequestContext;
1313
use dropshot::{endpoint, Path};
1414
use hyper::{Response, StatusCode};
1515
use schemars::JsonSchema;
16+
use semver::Version;
1617
use serde::Deserialize;
1718

1819
use super::*;
@@ -30,7 +31,7 @@ pub struct FileServerContext {
3031

3132
pub fn write_openapi<W: Write>(f: &mut W) -> Result<()> {
3233
let api = build_api();
33-
api.openapi("Downstairs Repair", "0.0.0").write(f)?;
34+
api.openapi("Downstairs Repair", Version::new(0, 0, 1)).write(f)?;
3435
Ok(())
3536
}
3637

@@ -57,7 +58,7 @@ pub fn repair_main(
5758
*/
5859
let config_dropshot = ConfigDropshot {
5960
bind_address: addr,
60-
request_body_max_bytes: 1024,
61+
default_request_body_max_bytes: 1024,
6162
default_handler_task_mode: HandlerTaskMode::Detached,
6263
log_headers: vec![],
6364
};

dsc/Cargo.toml

+1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ dropshot.workspace = true
1717
rand.workspace = true
1818
rand_chacha.workspace = true
1919
schemars.workspace = true
20+
semver.workspace = true
2021
serde.workspace = true
2122
statistical.workspace = true
2223
tokio.workspace = true

dsc/src/control.rs

+4-2
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ use dropshot::Path;
1111
use dropshot::RequestContext;
1212
use dropshot::{HttpResponseOk, HttpResponseUpdatedNoContent};
1313
use schemars::JsonSchema;
14+
use semver::Version;
1415
use serde::Deserialize;
1516
use std::sync::Arc;
1617

@@ -51,7 +52,7 @@ pub async fn begin(dsci: Arc<DscInfo>, addr: SocketAddr) -> Result<(), String> {
5152
// Setup dropshot
5253
let config_dropshot = ConfigDropshot {
5354
bind_address: addr,
54-
request_body_max_bytes: 1024,
55+
default_request_body_max_bytes: 1024,
5556
default_handler_task_mode: HandlerTaskMode::Detached,
5657
log_headers: vec![],
5758
};
@@ -588,14 +589,15 @@ async fn dsc_enable_random_max(
588589
#[cfg(test)]
589590
mod test {
590591
use openapiv3::OpenAPI;
592+
use semver::Version;
591593

592594
use super::build_api;
593595

594596
#[test]
595597
fn test_dsc_openapi() {
596598
let api = build_api();
597599
let mut raw = Vec::new();
598-
api.openapi("DownStairs Control", "0.0.0")
600+
api.openapi("DownStairs Control", Version::new(0, 0, 1))
599601
.write(&mut raw)
600602
.unwrap();
601603
let actual = String::from_utf8(raw).unwrap();

openapi/crucible-agent.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"openapi": "3.0.3",
33
"info": {
44
"title": "Crucible Agent",
5-
"version": "0.0.0"
5+
"version": "0.0.1"
66
},
77
"paths": {
88
"/crucible/0/regions": {

openapi/crucible-control.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"openapi": "3.0.3",
33
"info": {
44
"title": "Crucible Control",
5-
"version": "0.0.0"
5+
"version": "0.0.1"
66
},
77
"paths": {
88
"/info": {

openapi/crucible-pantry.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"openapi": "3.0.3",
33
"info": {
44
"title": "Crucible Pantry",
5-
"version": "0.0.0"
5+
"version": "0.0.1"
66
},
77
"paths": {
88
"/crucible/pantry/0": {

openapi/downstairs-repair.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"openapi": "3.0.3",
33
"info": {
44
"title": "Downstairs Repair",
5-
"version": "0.0.0"
5+
"version": "0.0.1"
66
},
77
"paths": {
88
"/extent/{eid}/files": {

openapi/dsc-control.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"openapi": "3.0.3",
33
"info": {
44
"title": "DownStairs Control",
5-
"version": "0.0.0"
5+
"version": "0.0.1"
66
},
77
"paths": {
88
"/allrunning": {

pantry/Cargo.toml

+1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ futures.workspace = true
1515
http.workspace = true
1616
hyper.workspace = true
1717
schemars.workspace = true
18+
semver.workspace = true
1819
serde.workspace = true
1920
serde_json.workspace = true
2021
slog.workspace = true

pantry/src/main.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
use anyhow::{anyhow, Result};
44
use clap::Parser;
5+
use semver::Version;
56
use std::io::Write;
67
use std::net::SocketAddr;
78
use std::path::PathBuf;
@@ -46,7 +47,7 @@ async fn main() -> Result<()> {
4647

4748
fn write_openapi<W: Write>(f: &mut W) -> Result<()> {
4849
let api = server::make_api().map_err(|e| anyhow!(e))?;
49-
api.openapi("Crucible Pantry", "0.0.0").write(f)?;
50+
api.openapi("Crucible Pantry", Version::new(0, 0, 1)).write(f)?;
5051
Ok(())
5152
}
5253

pantry/src/pantry.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -851,7 +851,7 @@ impl Pantry {
851851
"volume {} is no longer active!",
852852
volume_id
853853
)),
854-
hyper::StatusCode::GONE,
854+
dropshot::ClientErrorStatusCode::GONE,
855855
format!("volume {} is no longer active!", volume_id),
856856
))
857857
} else {

pantry/src/server.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -469,7 +469,7 @@ pub fn run_server(
469469
bind_address,
470470
// max import, multiplied by worst case base64 overhead, plus room
471471
// for metadata
472-
request_body_max_bytes: 1024
472+
default_request_body_max_bytes: 1024
473473
+ crate::pantry::PantryEntry::MAX_CHUNK_SIZE * 2,
474474
default_handler_task_mode: HandlerTaskMode::Detached,
475475
log_headers: vec![],

upstairs/Cargo.toml

+1
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ rand.workspace = true
3939
rayon.workspace = true
4040
ringbuffer.workspace = true
4141
schemars.workspace = true
42+
semver.workspace = true
4243
serde.workspace = true
4344
serde_json.workspace = true
4445
slog.workspace = true

upstairs/src/control.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ pub async fn start(
3535
*/
3636
let config_dropshot = ConfigDropshot {
3737
bind_address: addr,
38-
request_body_max_bytes: 1024,
38+
default_request_body_max_bytes: 1024,
3939
default_handler_task_mode: HandlerTaskMode::Detached,
4040
log_headers: vec![],
4141
};
@@ -186,14 +186,15 @@ async fn downstairs_work_queue(
186186
#[cfg(test)]
187187
mod test {
188188
use openapiv3::OpenAPI;
189+
use semver::Version;
189190

190191
use super::build_api;
191192

192193
#[test]
193194
fn test_crucible_control_openapi() {
194195
let api = build_api();
195196
let mut raw = Vec::new();
196-
api.openapi("Crucible Control", "0.0.0")
197+
api.openapi("Crucible Control", Version::new(0, 0, 1))
197198
.write(&mut raw)
198199
.unwrap();
199200
let actual = String::from_utf8(raw).unwrap();

0 commit comments

Comments
 (0)