From ad098c8b80af7203a9b4723854e5f610fac3802b Mon Sep 17 00:00:00 2001 From: Ashley Coleman Date: Wed, 31 Jul 2024 15:12:42 -0700 Subject: [PATCH] rsc: Fix type for hidden_info --- rust/entity/src/job.rs | 3 +-- rust/migration/src/m20220101_000002_create_table.rs | 2 +- rust/rsc/.config.json | 2 +- rust/rsc/src/bin/rsc/types.rs | 10 ++++------ 4 files changed, 7 insertions(+), 10 deletions(-) diff --git a/rust/entity/src/job.rs b/rust/entity/src/job.rs index fc93fb91f..2e378ece7 100644 --- a/rust/entity/src/job.rs +++ b/rust/entity/src/job.rs @@ -16,8 +16,7 @@ pub struct Model { pub cwd: String, pub stdin: String, pub is_atty: bool, - #[sea_orm(column_type = "Binary(BlobSize::Blob(None))")] - pub hidden_info: Vec, + pub hidden_info: String, pub stdout_blob_id: Uuid, pub stderr_blob_id: Uuid, pub status: i32, diff --git a/rust/migration/src/m20220101_000002_create_table.rs b/rust/migration/src/m20220101_000002_create_table.rs index 3d8c022c6..fc5581506 100644 --- a/rust/migration/src/m20220101_000002_create_table.rs +++ b/rust/migration/src/m20220101_000002_create_table.rs @@ -35,7 +35,7 @@ impl MigrationTrait for Migration { .col(ColumnDef::new(Job::Cwd).string().not_null()) .col(ColumnDef::new(Job::Stdin).string().not_null()) .col(ColumnDef::new(Job::IsAtty).boolean().not_null()) - .col(ColumnDef::new(Job::HiddenInfo).ezblob()) + .col(ColumnDef::new(Job::HiddenInfo).string().not_null()) .col(ColumnDef::new(Job::StdoutBlobId).uuid().not_null()) .col(ColumnDef::new(Job::StderrBlobId).uuid().not_null()) .col(ColumnDef::new(Job::Status).integer().not_null()) diff --git a/rust/rsc/.config.json b/rust/rsc/.config.json index 51aece440..8315ac2fc 100644 --- a/rust/rsc/.config.json +++ b/rust/rsc/.config.json @@ -3,7 +3,7 @@ "server_address": "0.0.0.0:3002", "connection_pool_timeout": 60, "standalone": false, - "active_store": "3446d287-1d6f-439f-bc8a-9e73ab34065d", + "active_store": "6716a342-e800-40f8-a1c4-03f520fd64ff", "log_directory": null, "blob_eviction": { "tick_rate": 60, diff --git a/rust/rsc/src/bin/rsc/types.rs b/rust/rsc/src/bin/rsc/types.rs index 7617e957c..a96399240 100644 --- a/rust/rsc/src/bin/rsc/types.rs +++ b/rust/rsc/src/bin/rsc/types.rs @@ -40,8 +40,7 @@ pub struct AddJobPayload { pub cwd: String, pub stdin: String, pub is_atty: bool, - #[serde(with = "serde_bytes")] - pub hidden_info: Vec, + pub hidden_info: String, pub visible_files: Vec, pub output_dirs: Vec, pub output_symlinks: Vec, @@ -73,7 +72,7 @@ impl AddJobPayload { hasher.update(&self.stdin.len().to_le_bytes()); hasher.update(self.stdin.as_bytes()); hasher.update(&self.hidden_info.len().to_le_bytes()); - hasher.update(self.hidden_info.as_slice()); + hasher.update(self.hidden_info.as_bytes()); hasher.update(&[self.is_atty as u8]); hasher.update(&self.visible_files.len().to_le_bytes()); for file in &self.visible_files { @@ -93,8 +92,7 @@ pub struct ReadJobPayload { pub cwd: String, pub stdin: String, pub is_atty: bool, - #[serde(with = "serde_bytes")] - pub hidden_info: Vec, + pub hidden_info: String, pub visible_files: Vec, } @@ -111,7 +109,7 @@ impl ReadJobPayload { hasher.update(&self.stdin.len().to_le_bytes()); hasher.update(self.stdin.as_bytes()); hasher.update(&self.hidden_info.len().to_le_bytes()); - hasher.update(self.hidden_info.as_slice()); + hasher.update(self.hidden_info.as_bytes()); hasher.update(&[self.is_atty as u8]); hasher.update(&self.visible_files.len().to_le_bytes()); for file in &self.visible_files {