From ec28069b69a5635cc6a78fcde7b53c728956cd9e Mon Sep 17 00:00:00 2001 From: NotAShelf Date: Sat, 28 Feb 2026 21:46:59 +0300 Subject: [PATCH] fc-queue-runner: store build outputs in normalized table Replaces JSON blob storage with BuildOutput records and parse derivation outputs after successful build, then INSERT into `build_outputs` per output. Warnings are logged on storage failures, but it's not fatal. - Parse derivation outputs after successful build - INSERT into build_outputs table per output - Log warnings on storage failures (non-fatal) Signed-off-by: NotAShelf Change-Id: I30120a5ee4aea1bdb170987b22ddc2df6a6a6964 --- crates/queue-runner/src/worker.rs | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/crates/queue-runner/src/worker.rs b/crates/queue-runner/src/worker.rs index 4c0817a..ed852ad 100644 --- a/crates/queue-runner/src/worker.rs +++ b/crates/queue-runner/src/worker.rs @@ -596,6 +596,32 @@ async fn run_build( .map(|obj| obj.keys().cloned().collect()) .unwrap_or_default(); + // Store build outputs in normalized table + for (i, output_path) in build_result.output_paths.iter().enumerate() { + let output_name = output_names.get(i).cloned().unwrap_or_else(|| { + if i == 0 { + "out".to_string() + } else { + format!("out{i}") + } + }); + + if let Err(e) = repo::build_outputs::create( + pool, + build.id, + &output_name, + Some(output_path), + ) + .await + { + tracing::warn!( + build_id = %build.id, + output_name = %output_name, + "Failed to store build output: {e}" + ); + } + } + // Register GC roots and create build products for each output for (i, output_path) in build_result.output_paths.iter().enumerate() { let output_name = output_names.get(i).cloned().unwrap_or_else(|| {